summaryrefslogtreecommitdiffstats
path: root/src/analyze (follow)
Commit message (Collapse)AuthorAgeFilesLines
* analyze/cat-config: add switch to print only "interesting" parts of config filesZbigniew Jędrzejewski-Szmek2023-10-243-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | When looking at configuration, often a user wants to suppress the comments and just look at the parts that actually configure something, roughly equivalent to systemd-analyze cat-config … | rg -v '^(#|;|$) This switch implements this natively, skipping lines that start with a comment character or only contain whitespace. For formats that have section headers, section headers are skipped, if only followed by stuff that would be skipped. (The last section header is printed when we're about to print some actual output.) Note that the caller doesn't know if the format has headers or not. We do format type detection in pretty-print.c. So the caller only specifies tldr=true|false, and conf_files_cat() figures out if the format has headers and whether those should be handled specially. The comments that show the file name are always printed, even if all of the file is suppressed. This is a partial answer to the discussions in https://github.com/systemd/systemd/pull/28919, https://github.com/systemd/systemd/pull/29248. If the default config is shown in config files, the user can conveniently use '--tldr' to show the relevant parts.
* analyze: add tooltips with dependency information to "plot"Jade Lovelace2023-10-043-12/+61
| | | | | | | This helps a lot with figuring out why units were started when they were, rather than guessing there is a dependency relation. We could perhaps also do fun JavaScript things in the future to highlight dependencies on mouse-over.
* tpm2: unify symbolic name infra for PCRsLennart Poettering2023-08-241-3/+3
| | | | | | | | | | | | | We so far maintained two places for symboic names for PCRs. One in tpm2-util.h and one in tpm-pcr.h. Let's unify this into one, i.e. move the full list from tpm2-util.h into tpm-pcr.h, replacing the short list placed so far there. Systematically prefix the definitions with TPM2_ or tpm2_, to follow how we do this for all other defines in this context. No change in behaviour, just unification of tables.
* tree-wide: don't ifdef seccomp-util.h, drop seccomp.h inclusion everywhereLennart Poettering2023-08-211-3/+1
| | | | | | | | | | seccomp-util.h doesn't need ifdeffing, hence don't. It has worked since quite a while with HAVE_SECCOMP is off, hence use it everywhere. Also drop explicit seccomp.h inclusion everywhere (which needs HAVE_SECCOMP ifdeffery everywhere). seccomp-util.h includes it anyway, automatically, which we can just rely on, and it deals with HAVE_SECCOMP at one central place.
* add an @ option for confextMaanya Goenka2023-08-151-0/+2
|
* meson: merge declarations of normal and test executablesYu Watanabe2023-08-031-5/+1
|
* meson: move declaration of systemd-analyzeYu Watanabe2023-07-311-0/+15
|
* Merge pull request #28567 from yuwata/meson-versiondepLuca Boccassi2023-07-311-1/+0
|\ | | | | meson: cleanups for version dependency
| * tree-wide: drop unnecessary inclusion of version.hYu Watanabe2023-07-291-1/+0
| |
* | analyze: fix pcrs verb output without TPM supportFrantisek Sumsal2023-07-301-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we don't have TPM support then `alg` is NULL and passing this to table_new() means we'd get a table with only two columns instead of three, leading up to a very confusing output: $ build/systemd-analyze pcrs System lacks full TPM2 support, not showing PCR state. NR NAME 0 platform-code - 1 platform-config - 2 external-code - 3 external-config - 4 boot-loader-code - 5 boot-loader-config - 6 - - 7 ... Let's name the header in this case with a simple dash, as it's going to be hidden anyway, to make the table nice again: $ build/systemd-analyze pcrs System lacks full TPM2 support, not showing PCR state. NR NAME 0 platform-code 1 platform-config 2 external-code 3 external-config 4 boot-loader-code 5 boot-loader-config 6 - 7 secure-boot-policy ...
* Merge pull request #28359 from keszybz/ret-gatherDaan De Meyer2023-07-282-48/+21
|\ | | | | Add RET_GATHER macro to make continue-but-remember-first-error functions easier
| * various: use RET_GATHERZbigniew Jędrzejewski-Szmek2023-07-132-48/+21
| | | | | | | | No functional change indentended.
* | analyze: don't warn about version spec compliant versionsJoerg Behrmann2023-07-181-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | This commits adds version_is_valid_versionspec and uses it in analyze-compare-version.c. version_is_valid_versionspec differs from version_is_valid in that it acepts empty strings and since valid characters in a version spec version are all ASCII letters and digits as well as "-.~^", but ",_+" allowed by version_is_valid are not. Also give a more specific warning message on invalid characters.
* | tree-wide: a bunch of Coccinelle-suggested tweaksFrantisek Sumsal2023-07-141-1/+1
|/ | | | rc2 edition
* analyze-pcrs: Fix typoDaan De Meyer2023-07-101-1/+1
|
* analyze: add new "pcrs" verbLennart Poettering2023-06-284-2/+154
| | | | | It shows the PCRs we know about along with their name strings and current values.
* systemd-analyze: allow --quiet for condition checksRonan Pigott2023-06-211-4/+5
| | | | | | I figure these messages are rather unnecessary, so let the user quiet them with the existing --quiet flag if desired. Makes systemd-analyze condition a little more ergonomic in scripts.
* analyze: also check for version string validityLennart Poettering2023-06-201-4/+14
| | | | | | It's highly interesting to see if tools such as systemd-sysupdate consider a version valid, hence let's output that too (though gracefully, not fatally)
* tree-wide: use _cleanup_set_free_ and friendsYu Watanabe2023-05-311-1/+1
| | | | Instead of _cleanup_(set_freep) or so.
* tree-wide: use timestamp_is_set() at more placesDavid Tardon2023-05-243-16/+16
|
* dissect-image: port mount_image_privately_interactively() to use ↵Lennart Poettering2023-05-161-3/+3
| | | | | | | | | | /run/systemd/mount-rootfs/ too Let's use the same common directory as the unit logic uses. This means we have less to clean up, and opens the door to eventually allow unprivileged operation of the mount_image_privately_interactively() logic.
* image-policy: introduce parse_image_policy_argument() helperYu Watanabe2023-04-131-14/+8
| | | | | | | | | Addresses https://github.com/systemd/systemd/pull/25608/commits/84be0c710d9d562f6d2cf986cc2a8ff4c98a138b#r1060130312, https://github.com/systemd/systemd/pull/25608/commits/84be0c710d9d562f6d2cf986cc2a8ff4c98a138b#r1067927293, and https://github.com/systemd/systemd/pull/25608/commits/84be0c710d9d562f6d2cf986cc2a8ff4c98a138b#r1067926416. Follow-up for 84be0c710d9d562f6d2cf986cc2a8ff4c98a138b.
* Merge pull request #25608 from poettering/dissect-moarLennart Poettering2023-04-125-0/+179
|\ | | | | dissect: add dissection policies
| * sysext: default to a stricter image policy when reading /.extra/sysext/ DDIsLennart Poettering2023-04-051-0/+2
| |
| * analyze: add 'image-policy' tool for analyzing image dissection policiesLennart Poettering2023-04-054-0/+158
| |
| * tree-wide: hook up image dissection policy logic everywhereLennart Poettering2023-04-052-0/+19
| |
* | analyze: make blame command work even the default target not reachedYu Watanabe2023-04-095-25/+36
|/
* analyze: add new fdstore verbLennart Poettering2023-03-294-3/+122
|
* analyze: don't claim "@known" was an unlisted syscallLennart Poettering2023-03-241-6/+27
| | | | | | | | | | It's a sycall group of our own definition, and the output is erroneous to claim otherwise. Let's hide it. This adds syscall_set_add() which is nicely symmetric to the existing syscall_set_remove(). Follow-up for: 6d6a08547c03f96dc798cda1ef4a8d3013d292d5
* copy: Move chattr arguments to full function signaturesDaan De Meyer2023-03-212-2/+2
| | | | | These are almost never used, so let's move them to the _full() functions signatures.
* tree-wide: simplify x ? x : y to x ?: y where applicableFrantisek Sumsal2023-03-181-1/+1
|
* basic: add RuntimeScope enumLennart Poettering2023-03-1011-47/+55
| | | | | | | | | | | | In various tools and services we have a per-system and per-user concept. So far we sometimes used a boolean indicating whether we are in system mode, or a reversed boolean indicating whether we are in user mode, or the LookupScope enum used by the lookup path logic. Let's address that, in introduce a common enum for this, we can use all across the board. This is mostly just search/replace, no actual code changes.
* analyze: add 'malloc' verb to dump malloc_info()Luca Boccassi2023-02-236-15/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | Gets the memory state of the manager: root@image:~# systemd-analyze malloc <malloc version=1> <heap nr=0> <sizes> <size from=33 to=33 total=396 count=12/> <unsorted from=20385 to=20385 total=20385 count=1/> </sizes> <total type=fast count=0 size=0/> <total type=rest count=14 size=36589/> <system type=current size=1691648/> <system type=max size=1839104/> <aspace type=total size=1691648/> <aspace type=mprotect size=1691648/> </heap> <total type=fast count=0 size=0/> <total type=rest count=14 size=36589/> <total type=mmap count=0 size=0/> <system type=current size=1691648/> <system type=max size=1839104/> <aspace type=total size=1691648/> <aspace type=mprotect size=1691648/> </malloc>
* meson: Use dicts for test definitionsJan Janssen2023-02-211-7/+7
| | | | | | | Although this slightly more verbose it makes it much easier to reason about. The code that produces the tests heavily benefits from this. Test lists are also now sorted by test name.
* dissect-image: Return mount point fd if requestedDaan De Meyer2023-02-171-0/+1
|
* meson: Do not include headers in source listsJan Janssen2023-01-241-26/+2
| | | | | | Meson+ninja+compiler do this for us and are better at it. https://mesonbuild.com/FAQ.html#do-i-need-to-add-my-headers-to-the-sources-list-like-in-autotools
* tree-wide: unify how we pick OS pretty name to displayLennart Poettering2023-01-241-1/+2
|
* systemd-analyze: Add table and JSON output implementation to plotJoshua Zivkovic2023-01-183-52/+154
|
* analyze: basename() → path_extract_filename()Lennart Poettering2022-12-231-6/+6
|
* tree-wide: use -EBADF for fd initializationZbigniew Jędrzejewski-Szmek2022-12-191-1/+1
| | | | | | | | | | | | | | | | -1 was used everywhere, but -EBADF or -EBADFD started being used in various places. Let's make things consistent in the new style. Note that there are two candidates: EBADF 9 Bad file descriptor EBADFD 77 File descriptor in bad state Since we're initializating the fd, we're just assigning a value that means "no fd yet", so it's just a bad file descriptor, and the first errno fits better. If instead we had a valid file descriptor that became invalid because of some operation or state change, the other errno would fit better. In some places, initialization is dropped if unnecessary.
* localectl,analyze: some minor vertical table rework fixesLennart Poettering2022-11-161-4/+0
| | | | Follow-up for #25339
* analyze-inspect-elf: port to vertical tableDavid Tardon2022-11-131-19/+5
|
* analyze-timespan: port to vertical tableDavid Tardon2022-11-131-10/+4
|
* analyze-timestamp: port to vertical tableDavid Tardon2022-11-131-12/+6
|
* analyze-calendar: port to vertical tableDavid Tardon2022-11-131-14/+8
|
* analyze-calendar: avoid unnecessary abbreviationDavid Tardon2022-11-131-1/+1
|
* nulstr-util: Declare NULSTR_FOREACH() iterator inlineDaan De Meyer2022-11-114-13/+0
|
* Rename def.h to constants.hZbigniew Jędrzejewski-Szmek2022-11-082-2/+2
| | | | | | The name "def.h" originates from before the rule of "no needless abbreviations" was established. Let's rename the file to clarify that it contains a collection of various semi-related constants.
* basic: move version() to build.h+cZbigniew Jędrzejewski-Szmek2022-11-081-1/+1
|
* analyze: add --image= + --root= to --help textLennart Poettering2022-10-251-0/+2
|