1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-14 15:21:37 +03:00
Commit Graph

42 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
c7fc641ea3 bootchart: print to stdout and display default values in help 2014-04-24 19:21:51 -04:00
WaLyong Cho
7e6798df26 bootchart: rewrite usage message more generally 2014-04-24 19:21:51 -04:00
WaLyong Cho
49e5b2a933 bootchart: add control group option 2014-04-24 19:21:51 -04:00
Zbigniew Jędrzejewski-Szmek
bdd13f6be4 Remove dead lines in various places
As pointed-out by clang -Wunreachable-code.

No behaviour changes.
2014-02-24 19:24:14 -05:00
Lennart Poettering
c8a202b7d4 everywhere: always use O_CLOEXEC where it makes sense 2014-02-13 14:59:56 +01:00
Lennart Poettering
955d98c9c1 everywhere: make use of new0() and macro() macros, and stop using perror() 2014-02-13 14:45:51 +01:00
Lennart Poettering
9f6445e34a log: log_error() and friends add a newline after each line anyway, so avoid including it in the log strings 2013-12-24 16:39:37 +01:00
Thomas Hindoe Paaboel Andersen
f168c27313 trivial coding style clean ups
- 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-12-03 22:27:45 +01:00
Lennart Poettering
71fda00f32 list: make our list macros a bit easier to use by not requring type spec on each invocation
We can determine the list entry type via the typeof() gcc construct, and
so we should to make the macros much shorter to use.
2013-10-14 06:11:19 +02:00
Zbigniew Jędrzejewski-Szmek
872c8faaf2 Fix write-only use of a few variables
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-13 17:56:54 -04:00
Jason St. John
3c527fd195 bootchart: fix typos in copyright notices
"Corporation" was misspelled as "Coproration"
2013-06-12 01:40:02 -04:00
Nathaniel Chen
8dfb6e718d Dynamically allocate bootchart logs
Instead of storing bootchart sample data in arrays, this patch moves
storage to linked lists so that there is no more limit on samples.

This patch also fixes parsing of /proc/<pid>/smaps in kernels > 3.7.
2013-05-02 09:23:01 -07:00
Lennart Poettering
db5c012285 conf-parser: restrict .include usage
Disallow recursive .include, and make it unavailable in anything but
unit files.
2013-04-25 00:05:14 -03:00
Harald Hoyer
7fd1b19bc9 move _cleanup_ attribute in front of the type
http://lists.freedesktop.org/archives/systemd-devel/2013-April/010510.html
2013-04-18 09:11:22 +02:00
Auke Kok
9e6d4c613d bootchart: Fix errno usage. 2013-04-17 09:49:33 -07:00
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