summaryrefslogtreecommitdiffstats
path: root/src/analyze (follow)
Commit message (Collapse)AuthorAgeFilesLines
* coredump: AccessContainer= bunch of followups (#34333)Luca Boccassi2024-10-301-14/+5
|\ | | | | Fixes #34130
| * analyze: don't use Yoda conditionsMichal Sekletar2024-10-291-1/+1
| |
| * analyze: modernize opening ELF binary a bitMichal Sekletar2024-10-291-13/+4
| |
* | analyze: Add times in seconds for Activating and Activated in tooltiphugo3032024-10-301-1/+3
|/ | | | | | Print the times in seconds in the tooltip to remove the need to count and trying to follow the lines in the svg diagram in order to see at what times these events happen.
* sd-json,tree-wide: add sd_json_format_enabled() and use it everwhereZbigniew Jędrzejewski-Szmek2024-10-285-11/+12
| | | | | | | | | | | | | | | | | | | We often used a pattern like if (!FLAGS_SET(flags, SD_JSON_FORMAT_OFF)), which is rather verbose and also contains a double negative, which we try to avoid. Add a little helper to avoid an explicit bit check. This change clarifies an aditional thing: in some cases we treated SD_JSON_FORMAT_OFF as a flag (flags & SD_JSON_FORMAT_OFF), while in other cases we treated it as an independent enum value (flags == SD_JSON_FORMAT_OFF). In the first form, flags like SD_JSON_FORMAT_SSE do _not_ turn the json output on, while in the second form they do. Let's use the first form everywhere. No functional change intended. Initially I wasn't sure if this helper should be made public or just internal, but it seems such a common pattern that if we expose the flags, we might just as well expose it too, to make life easier for any consumers.
* bus-message-util: introduce bus_message_dump_fd() and _string()Yu Watanabe2024-10-124-37/+7
| | | | Then, use them in analyze and oomctl.
* analyze: fall back to simple method from dump_patterns() and friendsYu Watanabe2024-10-121-18/+16
| | | | No functional change, just refactoring.
* Merge pull request #34679 from DaanDeMeyer/bus-logDaan De Meyer2024-10-0911-11/+11
|\ | | | | Various logging improvements
| * bus-util: Log more information when connecting to a bus socket failsDaan De Meyer2024-10-0911-11/+11
| | | | | | | | | | Let's log about which bus we're trying to connect to and what transport we're using to do it.
* | analyze: use RET_GATHER()Yu Watanabe2024-10-082-10/+2
| |
* | tree-wide: drop doubled empty linesYu Watanabe2024-10-071-1/+0
| |
* | path-lookup: move find_portable_profile() to portable-utilMike Yuan2024-10-061-0/+1
|/
* tpm2-util: introduce tpm2_is_fully_supported()Yu Watanabe2024-09-191-1/+1
|
* analyze: move "has-tpm2" from systemd-creds to systemd-analyzeLennart Poettering2024-09-124-0/+17
| | | | | | The verb s not really specific to credential management, it was always a bit misplaced. Hence move it to systemd-analyze, where we already have some general TPM related verbs such as "srk" and "pcrs"
* analyze: add some roughly useful subsections to --help textLennart Poettering2024-09-091-6/+14
| | | | | It's a long long list of verbs we support now, let's make it easier to digest, like we did in systemctl --help and elsewhere.
* analyze: add section underlining to --help textLennart Poettering2024-09-091-8/+10
| | | | Do this like we usually do these days.
* tree-wide: use isatty_safe() moreLennart Poettering2024-08-201-1/+1
|
* Merge pull request #34022 from YHNdnzj/unit-is-filteredYu Watanabe2024-08-181-1/+1
|\ | | | | core/unit: two trivial cleanups
| * core/unit: rename set_unit_path() -> setenv_unit_path()Mike Yuan2024-08-171-1/+1
| | | | | | | | | | The previous name is quite vague on what this precisely do.
* | analyze: introduce --instance= option to control instance name for template ↵Yu Watanabe2024-08-185-2/+14
|/ | | | | | | | | | | | | | | | | | units Note, `systemd-analyze foo@.service --instance=hoge` is equivalent to `systemd-analyze foo@hoge.service`. But, the option may be useful when e.g. passing multiple template units that have restriction on their instance name: ``` $ ls template_aaa@.service template_bbb@.service template_ccc@.service $ systemd-analyze ./template_* --instance=hoge ``` Without the option, we need to embed an instance name into each unit name, so cannot use globs. Prompted by #33681.
* coredump: generate properly symbolized stacktrace for containerized processesMichal Sekletar2024-08-062-6/+24
|
* systemd-analyze: Add svg scaling optionsrajmohan r2024-08-053-1/+25
| | | | | | | + Scale the x-axis of the resulting plot by a factor (default 1.0) + Add activation timestamps to each bar Signed-off-by: rajmohan r <rajmohan.r@kpit.com>
* analyze: capability: add support for decoding capability masksIvan Shapovalov2024-07-243-11/+59
| | | | | | | | | | | | | | | | | This adds support in `systemd-analyze capability` for decoding capability masks (sets), e.g.: ```console $ systemd-analyze capability --mask 0000000000003c00 NAME NUMBER cap_net_bind_service 10 cap_net_broadcast 11 cap_net_admin 12 cap_net_raw 13 ``` This is intended as a convenience tool for pretty-printing capability values as found in e.g. `/proc/$PID/status`.
* analyze: capability: cosmetic, fix error message spellingIvan Shapovalov2024-07-161-1/+1
|
* Fix typo in CAP_BPF description (#33464)Eugeny Shcheglov2024-06-241-2/+2
| | | description_good and description_bad are mixed up. Disabling CAP_BPF results in the inability to load BPF, not the other way around.
* analyze: show pcrs also in sha384 bankLennart Poettering2024-06-141-1/+1
| | | | | | SHA384 is pretty much the bank we actually *want* to use, since it's faster to calculate than SHA256, hence at the very least, start considering.
* libsystemd: turn json.[ch] into a public APILennart Poettering2024-06-126-61/+64
| | | | | | | | | | | | | | | This is preparation for making our Varlink API a public API. Since our Varlink API is built on top of our JSON API we need to make that public first (it's a nice API, but JSON APIs there are already enough, this is purely about the Varlink angle). I made most of the json.h APIs public, and just placed them in sd-json.h. Sometimes I wasn't so sure however, since the underlying data structures would have to be made public too. If in doubt I didn#t risk it, and moved the relevant API to src/libsystemd/sd-json/json-util.h instead (without any sd_* symbol prefixes). This is mostly a giant search/replace patch.
* analyze: add verb for dumping SMBIOS Type #11 dataLennart Poettering2024-06-124-0/+81
| | | | | | I find myself wanting to check this data with a quick command, and browsing through /sys/ manually getting binary data sucks. Hence let's do add a nice little analysis tool.
* analyze: do not print timestamps before "start of userspace"Zbigniew Jędrzejewski-Szmek2024-05-201-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have the following timestamp status: $ systemctl show systemd-fsck-root.service | grep InactiveExitTimestamp InactiveExitTimestamp=Thu 2023-11-02 12:27:24 CET InactiveExitTimestampMonotonic=15143158 $ systemctl show | grep UserspaceTimestamp UserspaceTimestamp=Thu 2023-11-02 12:27:25 CET UserspaceTimestampMonotonic=15804273 i.e. UserspaceTimestamp is before InactiveExit of systemd-fsck-root.service. This is fine, but on display, we'd subtract those values and print a huge negative value bogusly: $ build/systemd-analyze critical-chain systemd-remount-fs.service The time when unit became active or started is printed after the "@" character. The time the unit took to start is printed after the "+" character. systemd-remount-fs.service +137ms └─systemd-fsck-root.service @584542y 2w 2d 20h 1min 48.890s +45ms └─systemd-journald.socket └─system.slice └─-.slice In fact, list_dependencies_print() already had a branch where the check that 'times->activating > boot->userspace_time', but it didn't cover all cases. So make it cover both branches, and also change to '>=', since it's fine if something happened with the same timestamp. With the patch: $ build/systemd-analyze critical-chain systemd-remount-fs.service The time when unit became active or started is printed after the "@" character. The time the unit took to start is printed after the "+" character. systemd-remount-fs.service +42ms └─systemd-fsck-root.service └─systemd-journald.socket └─system.slice └─-.slice Fixes https://github.com/systemd/systemd/issues/17191.
* tree-wide: 'allows to' -> 'allows one to'Luca Boccassi2024-05-141-1/+1
| | | | As flagged by Lintian
* tree-wise: several cleanups for loggingYu Watanabe2024-04-301-1/+1
| | | | | | | | | | | - drop unnecessary SYNTHETIC_ERRNO() when the logger does not propagate error code, - drop unnecessary '%m' in error message when the error code is specified with SYNTHETIC_ERRNO(), - add missing full stop at the end of log message, - use RET_GATHER(), - add missing ", ignoring.", - upeercase the first letter, etc., etc...
* tpm2-util: add generic wrapper tpm2_context_new_or_warn() that wrpas ↵Lennart Poettering2024-04-221-2/+2
| | | | | | | | | | tpm2_context_new and logs about errors We so far just print a short log message that is not very useful, let's add some recognizable error codes, and output better log messages if we can't get TPM stuff to work. Fixes: #31925
* use FOREACH_ELEMENTMatteo Croce2024-04-183-4/+4
| | | | | | | | Use FOREACH_ELEMENT where possible. Generated with this command, and checked manually: git grep -l 'FOREACH_ARRAY.*ELEMENTSOF' | \ xargs sed -ri 's/FOREACH_ARRAY\((.*), (.*), (ELEMENTSOF.*)\)/FOREACH_ELEMENT(\1, \2)/'
* core: rename SoftRebootStartTimestamp -> ShutdownStartTimestamp and generalizeLuca Boccassi2024-04-173-11/+11
| | | | Follow-up for 54f86b86ba8168faccbfc2ad16ceeccefde98a51
* analyze: show soft-reboot counter next to time deltasLuca Boccassi2024-04-162-4/+7
|
* analyze: reset more timestamps when analyzing soft rebootsLuca Boccassi2024-04-161-1/+4
| | | | Follow-up for 7addfba9c45af97305a628e98acf684eedb7d510
* analyze: fix plot with soft-rebootLuca Boccassi2024-03-272-7/+51
| | | | | | Clamp times and start counting from when soft-reboot is started to avoid creating a huge graph, like it's done for the user instance.
* analyze: show only current times after soft-rebootLuca Boccassi2024-03-272-1/+8
| | | | | The firmware/loader/kernel times are no longer relevant for the startup sequence on soft-reboot, so use only the userspace timestamps
* analyze: refuse --global dot/verifyMike Yuan2024-03-231-3/+2
| | | | | | | | | | I don't quite understand the rationale of making these verbs work with --global back in the day. But realistically they interact with/spawn manager, while there's no --global runtime scope manager. And to verify/inspect user units it's sufficient to just use --user. Fixes #31911
* analyze-dot: also show BindsTo= in --requireMike Yuan2024-03-231-0/+5
|
* analyze-dot: minor modernizationMike Yuan2024-03-231-7/+19
|
* analyze-security: use FOREACH_ARRAYMike Yuan2024-03-231-3/+2
|
* systemd-analyze: use strdup_to()Zbigniew Jędrzejewski-Szmek2024-03-201-54/+44
|
* Merge pull request #30480 from keszybz/kernel-install-more-pathsZbigniew Jędrzejewski-Szmek2024-03-081-2/+1
|\ | | | | Read kernel-install config from /run/kernel too
| * various: use modern strv helpersZbigniew Jędrzejewski-Szmek2024-02-281-2/+1
| | | | | | | | | | If we're building a strv, let's just use strv_new() with the CONF_PATHS macro, which gives as an exploded string set.
* | path-lookup: rename lookup_paths_free -> _doneMike Yuan2024-03-062-2/+2
| | | | | | | | This is stack-allocated, so update to match our usual rules.
* | dissect-image: add flag for explicitly enabling userspace verity signature ↵Lennart Poettering2024-02-281-1/+2
|/ | | | | | | | | | checking let's make userspace verity signature checking optional. This adds a dissection flag to enable the logic and patches through all our users to enable it by default, thus effectively not changing anything from the status quo ante. However, know we have a knob to turn this off in certain scenarios.
* analyze: always recommend saving the output to a fileZbigniew Jędrzejewski-Szmek2024-02-201-1/+1
| | | | | | | | The command will refuse to write to a TTY, so give a strong hint that redirecting to a file is recommended. This makes the synopsis, man page text, and --help output consistent. Also drop the space after the redirection operator everywhere.
* analyze: skip to check ExecCommand for .mount and .swap unitsYu Watanabe2024-02-201-8/+0
| | | | | | | | They are not set by a unit file, but dynamically generated. Fixes a bug caused by abf0ccc1c6fb81fdcb801566695600a518a28b43. Fixes #31396.
* macro: rename VA_ARGS_FOREACH to FOREACH_ARGUMENTMike Yuan2024-01-241-1/+1
| | | | | "VA_ARGS" is kinda confusing, as the macro just iterates through all arguments passed and has nothing to do with va_arg.