Commit graph

27 commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek e8e581bf25 Report about syntax errors with metadata
The information about the unit for which files are being parsed
is passed all the way down. This way messages land in the journal
with proper UNIT=... or USER_UNIT=... attribution.

'systemctl status' and 'journalctl -u' not displaying those messages
has been a source of confusion for users, since the journal entry for
a misspelt setting was often logged quite a bit earlier than the
failure to start a unit.

Based-on-a-patch-by: Oleksii Shevchuk <alxchk@gmail.com>
2013-04-17 00:09:16 -04:00
Auke Kok c4d58b0b6d bootchart: put the bootchart into the journal.
This bit of code is mostly stolen from coredump.c. We construct
a simple journal message and append the bootchart file in the
journal automatically.

You can extract the latest bootchart from the current boot with
something like:

$ journalctl -b MESSAGE_ID=9f26aa562cf440c2b16c773d0479b518 --field=BOOTCHART

which prints it to stdout.

None of the other logic is touched. The journal entry is created
even if bootchart was run manually, which is probably wrong.
2013-04-15 16:28:41 -07:00
Zbigniew Jędrzejewski-Szmek 1c6330456c Use initalization instead of explicit zeroing in more places 2013-04-10 18:59:42 -04:00
Zbigniew Jędrzejewski-Szmek 522cd7f18b bootchart: fix a potential buffer overrun
If the configured number of samples was close to MAXSAMPLES,
the samples buffer could be overrun:

- by 1, because of off-by-one in the condition (samples > arg_samples_len),
and
- by many in case of an overrun, because the number of samples to
  capture was increased, instead of being decreased.

Simplify things by converting to a normal for-loop.

In store.c: change buffer size from 4095 to 4096. 4095 is a strange
number.
2013-03-31 14:34:08 -04:00
Zbigniew Jędrzejewski-Szmek 4cd5f79d0b bootchart: split out option parsing from main() 2013-03-31 14:33:52 -04:00
Lennart Poettering 361514aca1 bootchart: bump RLIMIT_NOFILE only after we forked us off, so that the init system inherits the kernel default 2013-03-11 22:54:36 +01:00
Lennart Poettering 6d031c0b60 bootchart: various superficial cleanups
Let's update bootchar to share the coding style a bit more with the rest
of the package.

- Some tabs/spaces fixes

- add #pragma to header

- split up header so that we have a 1:1 relation between .c and .h files
  like everywhere else

- Prefix user command line arguments/configuration settings with "arg_".

- other coding style fixes
2013-03-11 22:47:58 +01:00
Zbigniew Jędrzejewski-Szmek 1f3523baf7 Revert "bootchart: use _cleanup_close_"
This reverts commit 0ea9530d40.

attribute(cleanup) can only be used inside functions (*of, sysfd
are leaked).

Cleanup functions are only called once when exiting scope (*f
is leaked twice).
2013-03-07 15:35:50 -05:00
Nathaniel Chen 0ea9530d40 bootchart: use _cleanup_close_
use _cleanup_{close_,fclose_} to close streams and file descriptors
2013-03-07 20:53:14 +01:00
Harald Hoyer 78da2cd926 bootchart: document -C, --cmdline parameter 2013-03-07 16:19:38 +01:00
Harald Hoyer b9a496c166 bootchart: rename global len to samples_len 2013-03-07 16:09:25 +01:00
Harald Hoyer e90f9fa4d1 bootchart: add parameter "-C" to expand process names to the full cmdline 2013-03-07 16:09:22 +01:00
Zbigniew Jędrzejewski-Szmek 6d26799179 bootchart: rename --filter to --no-filter
Turning off filtering with --filter is just too confusing.
Config option "Filter" doesn't have to be changed, here
"Filter=yes" already meant to filter.
2013-02-16 15:16:24 -05:00
Zbigniew Jędrzejewski-Szmek 547ba5a9e8 bootchart: provide better error messages 2013-02-16 15:10:58 -05:00
Zbigniew Jędrzejewski-Szmek f1c24fea94 man: move bootchart README to manpage, docbooksify 2013-02-16 15:10:40 -05:00
Thomas Hindoe Paaboel Andersen 0e4ffbff01 bootchart: stricter checks of cli input 2013-02-14 22:04:17 +01:00
Thomas Hindoe Paaboel Andersen f7900e258d bootchart: use conf-parser & CamelCase names in .conf 2013-02-14 21:36:45 +01:00
Harald Hoyer e93450c6c0 bootchart: parse /etc/os-release rather than system-release
Also parse it early, so that we can get it in the initramfs.
2013-02-14 11:59:16 -08:00
Harald Hoyer b823b5e272 bootchart: more fixes for bootchart in the initramfs 2013-02-14 11:55:23 -08:00
Harald Hoyer a5c32cff1f honor SELinux labels, when creating and writing config files
Also split out some fileio functions to fileio.c and provide a SELinux
aware pendant in fileio-label.c

see https://bugzilla.redhat.com/show_bug.cgi?id=881577
2013-02-14 16:19:38 +01:00
Harald Hoyer f2f85884ca bootchart: make bootchart work from within the initrd
With this patch, bootchart can be started from within the initramfs via
the kernel command line "rdinit=/usr/lib/systemd/systemd-bootchart"

see:
    http://harald.fedorapeople.org/downloads/bootchart-20130207-1652.svg
2013-02-12 16:06:06 -08:00
Auke Kok cd3bccaaf7 systemd-bootchart: relicense to LGPLv2.1+
When we merged systemd-bootchart we omitted relicensing this
to LGPL. Now that code is being used for other purposes we
need to make sure the code is shareable within systemd
without further problems.

The original committers and contributors of bootchart before it
was merged all have agreed with the relicensing.
2013-02-12 15:14:15 -08:00
Lennart Poettering 043c432b77 bootchart: no need for memset here 2013-01-14 21:24:57 +01:00
Auke Kok a2e9b33808 bootchart: Convert malloc/memset to calloc 2013-01-10 15:21:48 -05:00
Auke Kok 53f5329f7a bootchart: Convert !strcmp usage to streq 2013-01-10 15:21:42 -05:00
Thomas Hindoe Paaboel Andersen 28989b63f5 bootchart: tabs to spaces 2013-01-10 00:24:48 +01:00
Auke Kok 83fdc450aa bootchart: merge bootchart
Bootchart is renamed to 'systemd-bootchart' and installed as
/usr/lib/systemd/systemd-bootchart. The configuration file
will reside in /etc/systemd/bootchart.conf.
2013-01-07 23:48:43 +01:00