summaryrefslogtreecommitdiff
path: root/src/analyze
Commit message (Collapse)AuthorAgeFilesLines
...
* analyze: show list of syscalls the kernel supports but not included in any ↵Lennart Poettering2018-11-161-2/+79
| | | | | | group in the output This is quite useful for making sure our list is complete.
* Merge pull request #10753 from keszybz/pager-no-interruptLennart Poettering2018-11-141-8/+8
|\ | | | | Add mode in journalctl where ^C is handled by the pager
| * basic/pager: convert the pager options to a flags argumentZbigniew Jędrzejewski-Szmek2018-11-141-8/+8
| | | | | | | | | | Pretty much everything uses just the first argument, and this doesn't make this common pattern more complicated, but makes it simpler to pass multiple options.
* | id128,analyze: fix layout of help messageYu Watanabe2018-11-101-3/+3
|/
* analyze: Add "timespan" command to dump time span in usecChris Down2018-10-231-0/+27
| | | | | | | | | | | | | | | | | | | | | | This is useful for a couple of cases, I'm mostly interested in case #1: 1. Verifying "reasonable" values in a trivially scriptable way 2. Debugging unexpected time span parsing directly Test Plan: ``` % build/systemd-analyze timespan 20 Original: 20 μs: 20 Human: 20us % build/systemd-analyze timespan 20ms Original: 20ms μs: 20000 Human: 20ms % build/systemd-analyze timespan 20z Failed to parse time span '20z': Invalid argument ```
* Merge pull request #10470 from yuwata/log-message-updatesLennart Poettering2018-10-192-3/+3
|\ | | | | Log message updates
| * analyze: include error cause in the log messageYu Watanabe2018-10-201-1/+1
| |
| * analyze: update log messageYu Watanabe2018-10-201-2/+2
| |
* | tree-wide: replace 'unsigned int' with 'unsigned'Yu Watanabe2018-10-191-4/+4
|/
* core: log in all cases in manager_startup()Lennart Poettering2018-10-091-1/+1
| | | | | We missed some cases where we'd fail without any logging at all. Let's fix that.
* core: clean up test run flagsLennart Poettering2018-10-091-3/+4
| | | | | | Let's make them typesafe, and let's add a nice macro helper for checking if we are in a test run, which should make testing for this much easier to read for most cases.
* tree-wide: use typesafe_qsort()Yu Watanabe2018-09-191-14/+9
|
* analyze: use temporary var to simplify codeZbigniew Jędrzejewski-Szmek2018-08-231-4/+4
|
* Merge pull request #9801 from yuwata/analyze-cleanupsZbigniew Jędrzejewski-Szmek2018-08-201-130/+79
|\ | | | | analyze: several improvements
| * analyze: fix condition for pretty printing kernel timeKirill Marinushkin2018-08-061-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On target boards without RTC, `t->kernel_time` is 0 or 1 usec. `systemd-analyze` reads this value over D-Bus from `org.freedesktop.systemd1.Manager`, property `KernelTimestamp`. The issue is: if `t->kernel_time` is 0, `systemd-analyze` does not print the kernel time: ~~~~ $ systemd-analyze Startup finished in 1.860s (userspace) = 5.957s ~~~~ This commit fixes the misbehaviour: ~~~~ $ systemd-analyze Startup finished in 3.866s (kernel) + 2.015s (userspace) = 5.881s ~~~~ Fixes #7721. v2: fixes one more condition (by Yu Watanabe <watanabe.yu+github@gmail.com>) v3: fixes one more condition (by Kirill Marinushkin <kmarinushkin@de.adit-jv.com>)
| * analyze: set reverse_offset for containerized systemYu Watanabe2018-08-061-5/+9
| |
| * analyze-plot: do not show the legend for security when --user is specifiedYu Watanabe2018-08-061-8/+10
| | | | | | | | | | systemd of user instance always does not have valid value of TIMESTAMP_SECURITY_*.
| * analyze: use bus_map_all_properties()Yu Watanabe2018-08-061-109/+52
| |
| * analyze: use size_t for number of unitsYu Watanabe2018-08-061-4/+4
| |
* | tree-wide: add clickable man page link to all --help textsLennart Poettering2018-08-201-3/+11
| | | | | | | | | | | | | | | | | | | | This is a bit like the info link in most of GNU's --help texts, but we don't do info but man pages, and we make them properly clickable on terminal supporting that, because awesome. I think it's generally advisable to link up our (brief) --help texts and our (more comprehensive) man pages a bit, so this should be an easy and straight-forward way to do it.
* | tree-wide: shorten error logging a bitYu Watanabe2018-08-071-20/+10
|/ | | | Continuation of 4027f96aa08c73f109aa46b89842ca0e25c9c0e9.
* analyze: add a space in pretty boot time stringYu Watanabe2018-07-241-2/+2
|
* analyze: show information from hostnamed in plot even when user modeYu Watanabe2018-07-241-8/+20
|
* analyze: plot initrd related timestampsYu Watanabe2018-07-241-0/+43
|
* analyze: plot units in initrdYu Watanabe2018-07-241-22/+33
| | | | Closes #9662.
* analyze: fix width calculation in plot commandYu Watanabe2018-07-201-3/+4
|
* analyze: actually select longest activated-time of servicesYu Watanabe2018-06-271-4/+1
| | | | Discovered by LGTM.
* analyze: use _cleanup_ for freeing the manager objectLennart Poettering2018-06-201-14/+8
|
* analyze: use log_unit_error_errno()'s return value where we canLennart Poettering2018-06-201-4/+2
|
* tree-wide: pass NULL arguments to manager_startup() directly, avoid ↵Lennart Poettering2018-06-201-3/+1
| | | | declaring unneeded variables
* Drop my copyright headersZbigniew Jędrzejewski-Szmek2018-06-143-9/+0
| | | | | | | perl -i -0pe 's/\s*Copyright © .... Zbigniew Jędrzejewski.*?\n/\n/gms' man/*xml git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/(#\n)?# +Copyright © [0-9, -]+ Zbigniew Jędrzejewski.*?\n//gms' git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/\s*\/\*\*\*\s+Copyright © [0-9, -]+ Zbigniew Jędrzejewski[^\n]*?\s*\*\*\*\/\s*/\n\n/gms' git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/\s+Copyright © [0-9, -]+ Zbigniew Jędrzejewski[^\n]*//gms'
* tree-wide: beautify remaining copyright statementsLennart Poettering2018-06-144-4/+4
| | | | | | Let's unify an beautify our remaining copyright statements, with a unicode ©. This means our copyright statements are now always formatted the same way. Yay.
* tree-wide: remove Lennart's copyright linesLennart Poettering2018-06-141-1/+0
| | | | | | | | | | | These lines are generally out-of-date, incomplete and unnecessary. With SPDX and git repository much more accurate and fine grained information about licensing and authorship is available, hence let's drop the per-file copyright notice. Of course, removing copyright lines of others is problematic, hence this commit only removes my own lines and leaves all others untouched. It might be nicer if sooner or later those could go away too, making git the only and accurate source of authorship information.
* tree-wide: drop 'This file is part of systemd' blurbLennart Poettering2018-06-143-6/+0
| | | | | | | | | | | | | | | | This part of the copyright blurb stems from the GPL use recommendations: https://www.gnu.org/licenses/gpl-howto.en.html The concept appears to originate in times where version control was per file, instead of per tree, and was a way to glue the files together. Ultimately, we nowadays don't live in that world anymore, and this information is entirely useless anyway, as people are very welcome to copy these files into any projects they like, and they shouldn't have to change bits that are part of our copyright header for that. hence, let's just get rid of this old cruft, and shorten our codebase a bit.
* tree-wide: drop !! casts to booleansZbigniew Jędrzejewski-Szmek2018-06-131-2/+2
| | | | | | | | | | | They are not needed, because anything that is non-zero is converted to true. C11: > 6.3.1.2: When any scalar value is converted to _Bool, the result is 0 if the > value compares equal to 0; otherwise, the result is 1. https://stackoverflow.com/questions/31551888/casting-int-to-bool-in-c-c
* analyze: use _cleanup_ for struct unit_timesFilipe Brandenburger2018-06-081-50/+36
| | | | | | | | | | | | | | | | This introduces a has_data boolean field in struct unit_files which can be used to detect the end of the array. Use a _cleanup_ for struct unit_files in acquire_time_data and its callers. Code for acquire_time_data is also simplified by replacing goto's with straight returns. Tested: By running the commands below, also checking them under valgrind. - build/systemd-analyze blame - build/systemd-analyze critical-chain - build/systemd-analyze plot Fixes: Coverity finding CID 996464.
* core: undo the dependency inversion between unit.h and all unit typesFelipe Sateler2018-05-151-0/+1
|
* systemd-analyze: make dump work for large # of unitsDavid Tardon2018-05-111-7/+45
| | | | | | If there is a large number of units, the size of the generated dump string can overstep DBus message size limit. So let's pass that string via a fd.
* terminal-util: add a function that shows a pretty separator lineLennart Poettering2018-05-111-4/+1
| | | | Follow-up for #8824
* Merge pull request #8824 from keszybz/analyze-show-configLennart Poettering2018-05-101-0/+56
|\ | | | | systemd-analyze show-config
| * analyze: allow full paths for cat-configZbigniew Jędrzejewski-Szmek2018-05-071-4/+18
| | | | | | | | | | | | | | | | | | $ systemd-analyze cat-config systemd/logind.conf $ systemd-analyze cat-config /etc/systemd/logind.conf $ systemd-analyze cat-config /usr/lib/systemd/logind.conf are all equvalent, $ systemd-analyze cat-config /var/systemd/logind.conf is an error.
| * analyze: seperate config file groups by underlineZbigniew Jędrzejewski-Szmek2018-05-071-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When multiple configuration file groups are shown together (e.g. systemd-analyze cat-config systemd/system.conf systemd/user.conf), it's nice to separate them visually. I tried first to write a line of spaces and underline that. This does not look too good, because the line is too low. Then I tried a block of blue-background spaces. In this version, there are two lines, one is full of spaces and underlined, so visually we get an empty line in the middle. I then tried underlining the last line of the previous file. This does not look right, unless the line is full width, i.e. unless spaces are written out until the end of the line. But when those spaces are added, it's not clear if they were part of the original file or not. Here, the spaces are between groups, so it seems less likely that somebody will mistake those spaces for part of the configuration file.
| * analyze: add --root option for cat-configZbigniew Jędrzejewski-Szmek2018-04-271-1/+13
| |
| * analyze: add 'cat-config' verbZbigniew Jędrzejewski-Szmek2018-04-271-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is used as 'systemd-analyze show-config systemd/logind.conf', which will dump /etc/systemd/system/user@.service /etc/systemd/system/user@.service.d/*.conf /run/systemd/system/user@.service.d/*.conf /usr/local/lib/systemd/system/user@.service.d/*.conf /usr/lib/systemd/system/user@.service.d/*.conf The idea is to make it easy to dump the configuration using the same locations and order that systemd programs use themselves (including masking, in the right order, etc.). This is the generic variant that works with any configuration scheme that follows the same general rules: $ systemd-analyze cat-config systemd/system.conf $ systemd-analyze cat-config systemd/user.conf $ systemd-analyze cat-config systemd/logind.conf $ systemd-analyze cat-config systemd/sleep.conf $ systemd-analyze cat-config systemd/journald.conf $ systemd-analyze cat-config systemd/journal-remote.conf $ systemd-analyze cat-config systemd/journal-upload.conf $ systemd-analyze cat-config systemd/coredump.conf $ systemd-analyze cat-config systemd/resolved.conf $ systemd-analyze cat-config systemd/timesyncd.conf $ systemd-analyze cat-config udev/udev.conf
* | bus-util: print a friendly message when PID1 is not systemdYu Watanabe2018-05-091-2/+4
| | | | | | | | | | | | Follow-up for 861f16d2679eeda79e8185057cef24653913e300. Fixes #8913.
* | analyze: merge acquire_full_bus() and acquire_systemd_bus()Yu Watanabe2018-05-091-20/+14
|/ | | | Follow-up for 5c69b31c137ffa24bca5a4628f9b4879d0f4e84a.
* tree-wide: drop redundant _cleanup_ macros (#8810)Lennart Poettering2018-04-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This drops a good number of type-specific _cleanup_ macros, and patches all users to just use the generic ones. In most recent code we abstained from defining type-specific macros, and this basically removes all those added already, with the exception of the really low-level ones. Having explicit macros for this is not too useful, as the expression without the extra macro is generally just 2ch wider. We should generally emphesize generic code, unless there are really good reasons for specific code, hence let's follow this in this case too. Note that _cleanup_free_ and similar really low-level, libc'ish, Linux API'ish macros continue to be defined, only the really high-level OO ones are dropped. From now on this should really be the rule: for really low-level stuff, such as memory allocation, fd handling and so one, go ahead and define explicit per-type macros, but for high-level, specific program code, just use the generic _cleanup_() macro directly, in order to keep things simple and as readable as possible for the uninitiated. Note that before this patch some of the APIs (notable libudev ones) were already used with the high-level macros at some places and with the generic _cleanup_ macro at others. With this patch we hence unify on the latter.
* tree-wide: drop spurious newlines (#8764)Lennart Poettering2018-04-191-2/+0
| | | | | | | | Double newlines (i.e. one empty lines) are great to structure code. But let's avoid triple newlines (i.e. two empty lines), quadruple newlines, quintuple newlines, …, that's just spurious whitespace. It's an easy way to drop 121 lines of code, and keeps the coding style of our sources a bit tigther.
* Merge pull request #8575 from keszybz/non-absolute-pathsLennart Poettering2018-04-171-7/+4
|\ | | | | Do not require absolute paths in ExecStart and friends
| * verify: use manager_load_startable_unit_or_warn() to load units for verificationZbigniew Jędrzejewski-Szmek2018-04-161-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This doesn't change the outcome: (before) /home/zbyszek/src/systemd/test/test-execute/exec-basic.service:6: Executable path specifies a directory: /usr/bin/test/ exec-basic.service: Failed to create exec-basic.service/start: Unit exec-basic.service is not loaded properly: Exec format error. (after) /home/zbyszek/src/systemd/test/test-execute/exec-basic.service:6: Executable path specifies a directory: /usr/bin/test/ Failed to load file /home/zbyszek/src/systemd/test/test-execute/exec-basic.service: Exec format error (before) masked.service: Failed to create masked.service/start: Unit masked.service is masked. (after) File /home/zbyszek/src/systemd/test/test-execute/masked.service is masked. but the failure is immediate and the error messages are more direct.