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

13 Commits

Author SHA1 Message Date
WaLyong Cho
49e5b2a933 bootchart: add control group option 2014-04-24 19:21:51 -04: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
Stefan Beller
226b735a74 bootchart: Remove unneeded check for NULL
Directly before the changed line there is:

	while ((parent->next_ps && parent->pid != ps->ppid))
		parent = parent->next_ps;

which looks one element ahead of the list, hence we can rely on parent
being non null here.
If 'parent' were NULL at that while loop already, it would crash as we're
dereferencing 'parent' when checking for next_ps already.

Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
2013-12-30 19:10:22 +01:00
Igor Zhbanov
306e665022 Fix for SIGSEGV in systemd-bootchart on short-living processes
The function svg_ps_bars() dereferencess NULL pointer in the line
	endtime = ps->last->sampledata->sampletime;
because of partially initialized ps_struct (ps->last == NULL).

If some process terminates between scaning /proc directory in the log_sample()
function and reading additional information from /proc/PID/... files,
the files couldn't be read, the loop will be continued and partially
initialized structure returned.
2013-10-15 09:40:34 -04:00
Zbigniew Jędrzejewski-Szmek
087a30417d bootchart: remove +x permissions on .c file 2013-08-14 21:47:38 -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
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
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
c309a7137b bootchart: properly terminate string
systemd-199/src/bootchart/store.c:289: buffer_size_warning: Calling
strncpy with a maximum size argument of 256 bytes on destination array
"ps->name" of size 256 bytes might leave the destination string
unterminated.

...and indeed, the string was used as NULL-terminated later on.

pid_cmdline_strncpy is renamed to pid_cmdline_strscpy to commemorate
the fact that it *does* properly terminate the string.
2013-03-28 23:45:52 -04: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
Lennart Poettering
e75dcf5737 bootchart: rename log.c to store.c to aovid confusion with src/shared/log.c 2013-03-11 19:18:53 +01:00