summaryrefslogtreecommitdiff
path: root/src/analyze
AgeCommit message (Collapse)AuthorFilesLines
2015-04-11shared: add terminal-util.[ch]Ronny Chevalier1-0/+1
2015-02-23remove unused includesThomas Hindoe Paaboel Andersen2-5/+0
This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
2015-02-16Transpose args in strv_fnmatch() to be more ooZbigniew Jędrzejewski-Szmek1-4/+4
2015-02-16analyze: change behaviour of combined --to/from--patternZbigniew Jędrzejewski-Szmek1-5/+15
We would require a match against all three: patterns specified with --to, with --from, and as positional arguments to show an edge. This does not seem useful. Let instead the positional args behave like they were specified in both --to and --from, which is fairly intuitive and should be more useful.
2015-02-16Add helper for fnmatch over strvZbigniew Jędrzejewski-Szmek1-39/+7
2015-01-27notify,firstboot,analyze,run: trim --help output to 80 linesZbigniew Jędrzejewski-Szmek1-10/+7
2015-01-23#pragma once here and thereZbigniew Jędrzejewski-Szmek1-0/+2
2014-12-24sd-bus: rename sd_bus_open_system_container() to sd_bus_open_system_machine()Lennart Poettering1-1/+1
Pretty much everywhere else we use the generic term "machine" when referring to containers in API, so let's do though in sd-bus too. In particular, since the concept of a "container" exists in sd-bus too, but as part of the marshalling system.
2014-11-28treewide: more log_*_errno + return simplificationsMichal Schmidt1-8/+4
2014-11-28treewide: no need to negate errno for log_*_errno()Michal Schmidt2-5/+5
It corrrectly handles both positive and negative errno values.
2014-11-28treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt2-5/+5
As a followup to 086891e5c1 "log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers", use sed to convert the simple cases to use the new macros: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/' Multi-line log_*() invocations are not covered. And we also should add log_unit_*_errno().
2014-11-27log: rearrange log function namingLennart Poettering1-10/+10
- Rename log_meta() → log_internal(), to follow naming scheme of most other log functions that are usually invoked through macros, but never directly. - Rename log_info_object() to log_object_info(), simply because the object should be before any other parameters, to follow OO-style programming style.
2014-09-15hashmap: introduce hash_ops to make struct Hashmap smallerMichal Schmidt1-1/+1
It is redundant to store 'hash' and 'compare' function pointers in struct Hashmap separately. The functions always comprise a pair. Store a single pointer to struct hash_ops instead. systemd keeps hundreds of hashmaps, so this saves a little bit of memory.
2014-09-13analyze: fix mem leakThomas Hindoe Paaboel Andersen1-1/+2
Found with Coverity. Fixes: CID#1237756
2014-09-11analyze: avoid a null dereferenceThomas Hindoe Paaboel Andersen1-1/+2
If we have an error in the early sd_bus_* calls then unit_times will still be null. Found with coverity. Fixes: CID#996464
2014-08-20cmdline: for new tools avoid introduce new negative switches, and properly ↵Lennart Poettering1-5/+15
align --help texts Negative switches are a bad un-normalized thing. We alerady have some, but we should try harder to avoid intrdoucing new ones. Hence, instead of adding two switches: --foobar --no-foobar Let's instead use the syntax --foobar --foobar=yes --foobar=no Where the first two are equivalent. The boolean argument is parsed following the usual rules. Change all new negative switches this way. This patch also properly aligns the --help table, so that single char switches always get a column separate of the long switches.
2014-08-14analyze: some fixes to the --help textLennart Poettering1-3/+3
2014-08-04bus: always explicitly close bus from main programsLennart Poettering1-1/+1
Since b5eca3a2059f9399d1dc52cbcf9698674c4b1cf0 we don't attempt to GC busses anymore when unsent messages remain that keep their reference, when they otherwise are not referenced anymore. This means that if we explicitly want connections to go away, we need to close them. With this change we will no do so explicitly wherver we connect to the bus from a main program (and thus know when the bus connection should go away), or when we create a private bus connection, that really should go away after our use. This fixes connection leaks in the NSS and PAM modules.
2014-08-03Unify parse_argv styleZbigniew Jędrzejewski-Szmek1-10/+1
getopt is usually good at printing out a nice error message when commandline options are invalid. It distinguishes between an unknown option and a known option with a missing arg. It is better to let it do its job and not use opterr=0 unless we actually want to suppress messages. So remove opterr=0 in the few places where it wasn't really useful. When an error in options is encountered, we should not print a lengthy help() and overwhelm the user, when we know precisely what is wrong with the commandline. In addition, since help() prints to stdout, it should not be used except when requested with -h or --help. Also, simplify things here and there.
2014-07-31Constify option table and add missing optionZbigniew Jędrzejewski-Szmek1-0/+1
2014-07-26analyze: fix seg-fault with no cl-argumentDaniel Buch1-1/+1
We need to check if argv[1] is set before compare
2014-07-21Merge systemd-verify with systemd-analyzeZbigniew Jędrzejewski-Szmek3-36/+364
2014-05-26analyze/run: use bus_open_transport_systemd instead of bus_open_transportThomas Bächler1-1/+1
Both systemd-analyze and systemd-run only access org.freedesktop.systemd1 on the bus. This patch allows using systemd-run --user and systemd-analyze --user even if the user session's bus is not properly integrated with the systemd user unit. https://bugs.freedesktop.org/show_bug.cgi?id=79252 and other reports...
2014-05-19analyze: read host and system information from remoteDjalal Harouni1-24/+85
This makes "systemd-analyze plot" read host information from remote. While we are it show if this is a virtualized system. https://bugs.freedesktop.org/show_bug.cgi?id=76498 Reported-by: Zach <zachcook1991@gmail.com>
2014-04-23analyze: fix plot with bad y sizeJeffrey Clark1-1/+1
systemd-analyze plot > test.svg produces output with all y and height element attributes equal to zero. This of course causes the resulting svg to appear blank (zero height). Bug does not affect x86. Looks like a compiler optimization may be the culprit. https://github.com/archlinuxarm/PKGBUILDs/issues/815
2014-04-23delta: draw arrows with draw_special_char()Lennart Poettering1-1/+1
Let's unify generation of unicode chars at one place. Also, don't add an extra space into chars we print, except for the tree chars where this is really necessary.
2014-01-31analyze: fix plot issues when using gummibootThomas Hindoe Paaboel Andersen1-1/+4
It would crash and the legend in the bottom followed the time 0.0.
2013-12-03trivial coding style clean upsThomas Hindoe Paaboel Andersen1-1/+1
- Add space between if/for and the opening parentheses - Place the opening brace on same line as the function (not for udev) From the CODING_STYLE Try to use this: void foo() { } instead of this: void foo() { }
2013-11-10analyze: plot the time spent setting up security modulesThomas Hindoe Paaboel Andersen1-0/+17
2013-11-08clients: add missing command line argumentsLennart Poettering1-0/+2
2013-11-08systemctl: port to libsystemd-busMarc-Antoine Perennou1-54/+16
2013-11-07analyze: make use of new sd_bus_get_property_strv() callLennart Poettering1-70/+56
2013-11-07clients: try to follow roughly the same order in --help texts for common optionsLennart Poettering1-2/+2
2013-11-07bus: log message parsing errors everywhere with a generalized ↵Lennart Poettering1-13/+10
bus_log_parse_error()
2013-11-07build-sys: merge sd-event into sd-busLennart Poettering1-0/+1
The sd-event APIs should be available only as part of libsystemd-bus so that the utility calls are not linked into each independently and we can minimize the number of libraries we have.
2013-11-06clients: unify how we invoke getopt_long()Lennart Poettering1-11/+12
Among other things this makes sure we always expose a --version command and show it in the help texts.
2013-11-06analyze: port over to use bus_open_transport()Lennart Poettering1-34/+45
2013-11-06analyze: simplify thingsLennart Poettering1-4/+1
2013-11-06analyze: fix indentationLennart Poettering1-12/+11
2013-11-01analyze: rename variablesThomas Hindoe Paaboel Andersen1-50/+50
2013-11-01analyze: plot: place the text on the side with most spaceThomas Hindoe Paaboel Andersen1-12/+17
Set the width of the svg to always fit the longest string while taking its starting position into consideration. Place the text on the right while the starting point is in the first half of the screen. After that we put it on the left to save the svg from being wider that it has to.
2013-10-31analyze: share code to read a string array from sd-busThomas Hindoe Paaboel Andersen1-55/+39
2013-10-31analyze: use sd_bus_get_propery_trivial and indentationThomas Hindoe Paaboel Andersen1-55/+53
2013-10-30general: various cleanupsLennart Poettering1-3/+3
2013-10-25analyze: port to sd-busThomas Hindoe Paaboel Andersen1-370/+273
2013-10-22analyze: systemd-analyze.c -> analyze.cKay Sievers1-0/+0
2013-10-21analyze: set white backgoundThomas Hindoe Paaboel Andersen1-0/+2
In programs like eog and gimp the transparant background did not look very good. https://bugs.freedesktop.org/show_bug.cgi?id=70720
2013-10-13Fix write-only use of a few variablesZbigniew Jędrzejewski-Szmek1-6/+6
Since the invention of read-only memory, write-only memory has been considered deprecated. Where appropriate, either make use of the value, or avoid writing it, to make it clear that it is not used.
2013-10-13Never call qsort on potentially NULL arraysZbigniew Jędrzejewski-Szmek1-1/+1
This extends 62678ded 'efi: never call qsort on potentially NULL arrays' to all other places where qsort is used and it is not obvious that the count is non-zero.
2013-07-26systemctl: move set-log-level to systemd-analyzeLennart Poettering1-0/+56
"systemctl set-log-level" is a command for analysis and tracing hence "systemd-analyze" should be the better home for it, thus allowing us to make the overly large "systemctl" a bit smaller.