Age | Commit message (Collapse) | Author |
|
|
|
- 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()
{
}
|
|
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.
|
|
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.
|
|
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.
|
|
|
|
"Corporation" was misspelled as "Coproration"
|
|
|
|
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.
|
|
Disallow recursive .include, and make it unavailable in anything but
unit files.
|
|
http://lists.freedesktop.org/archives/systemd-devel/2013-April/010510.html
|
|
|
|
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>
|
|
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.
|
|
|
|
code in src/shared/macro.h only defined MAX/MIN in case
they were not defined previously. however the MAX/MIN
macros implemented in glibc are not of the "safe" kind but defined
as:
define MIN(a,b) (((a)<(b))?(a):(b))
define MAX(a,b) (((a)>(b))?(a):(b))
Avoid nasty side effects by using our own versions instead.
Also fix the warnings derived from this change.
[zj: - modify MAX3 macro to fix warning about _a shadowing _a,
- do bootchart/svg.c too,
- remove unused MIN3.]
|
|
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.
|
|
|
|
Based on coverity report.
|
|
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.
|
|
The new gcc isn't bad!
In file included from src/bootchart/svg.c:36:0:
src/bootchart/svg.c: In function 'svg_ps_bars':
./src/shared/util.h:524:13: warning: 'enc_name' may be used uninitialized in this function [-Wmaybe-uninitialized]
free(*(void**) p);
^
src/bootchart/svg.c:821:37: note: 'enc_name' was declared here
char _cleanup_free_*enc_name;
^
CC src/udev/mtd_probe/mtd_probe-probe_smartmedia.o
XSLT man/systemd.unit.5
In file included from src/bootchart/svg.c:36:0:
src/bootchart/svg.c: In function 'svg_pss_graph':
./src/shared/util.h:524:13: warning: 'enc_name' may be used uninitialized in this function [-Wmaybe-uninitialized]
free(*(void**) p);
^
src/bootchart/svg.c:395:37: note: 'enc_name' was declared here
char _cleanup_free_*enc_name;
^
|
|
system inherits the kernel default
|
|
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
|
|
|
|
This reverts commit 0ea9530d401827e299c6e04a433e69a7a2a89d80.
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).
|
|
use _cleanup_{close_,fclose_} to close streams and file descriptors
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
Also parse it early, so that we can get it in the initramfs.
|
|
|
|
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
|
|
As of [1], bootchart stores files in /run/log, not /var/log, by default.
[1] f2f85884caac671da84256acb44148df9a4dca70
|
|
bootchart.conf: direct users to `bootchart.conf(5)`, not a nonexistent
man page.
svg.c: Fix some English in the svg comment header.
* Chrome/Chromium => Chrome, Chromium
* firefox => Firefox
* much more slow => more slowly
|
|
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
|
|
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.
|
|
Based-on-patch-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
cppcheck reported:
[src/bootchart/svg.c:791]: (error) Mismatching allocation and deallocation: f
|
|
|
|
|
|
|
|
|
|
|
|
|