summaryrefslogtreecommitdiff
path: root/src/bootchart/svg.c
AgeCommit message (Collapse)Author
2015-07-01bootchart: do not report warning when disk is missing model.Dimitri John Ledkov
In VMs / virtio drives there is no model. Also don't print "Disk: (null)" in output if no model is available.
2015-06-28bootchart: reset list_sample_data head before generating SVGGianpaolo Macario
Until commit 1f2ecb0 ("bootchart: kill a bunch of global variables") variable "head" was declared global and this action was performed by svg_header. Now that "head" is local and passed to each function called by svg_do(...) move the code at the beginning of svg_do(...) to restore the correct behaviour.
2015-06-23bootchart: fix per-cpu scales.Dimitri John Ledkov
Closes systemd/systemd#330
2015-04-24bootchart: kill newline characters from log_error_errno() callsDaniel Mack
2015-04-03bootchart: assorted coding style fixesDaniel Mack
* kill unnecessary {} * add newlines where appropriate * remove dead code * reorder variable declarations * fix more return code logic * pass O_CLOEXEC to all open*() calles * use safe_close() where possible
2015-04-03bootchart: kill a bunch of global variablesDaniel Mack
This code is in a confusingly bad shape. Kill a bunch of global variables and pass needed variables around in function calls.
2015-04-03bootchart: clean up sysfd and proc handlingDaniel Mack
Retrieve the handle to procfs in main(), and pass it functions that need it. Kill the global variables. Also, refactor lots of code in svg_title(). There's no need to access any global variables from there either, and we really should return proper errors from there as well.
2015-04-03bootchart: switch to log_* helpersDaniel Mack
Let the helper functions take care of the string message output.
2015-03-30systemd-bootchart: Prevent leaking file descriptors in open-fdopen combinationAlexander Sverdlin
Correctly handle the potential failure of fdopen() (because of OOM, for instance) after potentially successful open(). Prevent leaking open fd in such case.
2015-02-24bootchart: svg: fix checking of list endAaro Koskinen
If we have less samples than expected, systemd-bootchart will crash.
2015-02-23remove unused includesThomas Hindoe Paaboel Andersen
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-14bootchart: display each CPU utilization/waitWaLyong Cho
2014-12-04bootchart: escape non printable process nameWaLyong Cho
2014-09-28bootchart: check return of strftimeThomas Hindoe Paaboel Andersen
Found by coverity. Fixes: CID#996314 and #996312
2014-08-11bootchart: use the bool type where appropriateLennart Poettering
2014-06-19bootchart: add assertThomas Hindoe Paaboel Andersen
since 376cd3b89c62f580a6f576cecfbbb28d3944118f LIST_FIND_TAIL accepts an empty list. That removed an assert in LIST_FIND_TAIL and we now theoretically risk a null pointer deref. This adds the assert directly to protect against that.
2014-06-17bootchart: set white backgroundFrederic Crozat
In programs like eog and gimp the transparant background did not look very good. Similar fix from the one done in systemd-analyze (418e3750)
2014-04-24bootchart: add control group optionWaLyong Cho
2014-01-31use memzero(foo, length); for all memset(foo, 0, length); callsGreg KH
In trying to track down a stupid linker bug, I noticed a bunch of memset() calls that should be using memzero() to make it more "obvious" that the options are correct (i.e. 0 is not the length, but the data to set). So fix up all current calls to memset(foo, 0, length) to memzero(foo, length).
2013-12-10Bring bootchart code in line with CODING_STYLEDan McGee
Use double and not float, as there is little to no benefit.
2013-12-08bootchart: remove dead assignmentThomas Hindoe Paaboel Andersen
2013-12-03trivial coding style clean upsThomas Hindoe Paaboel Andersen
- 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-10-14list: make our list macros a bit easier to use by not requring type spec on ↵Lennart Poettering
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-13Fix write-only use of a few variablesZbigniew Jędrzejewski-Szmek
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-06-12bootchart: fix typos in copyright noticesJason St. John
"Corporation" was misspelled as "Coproration"
2013-05-02Dynamically allocate bootchart logsNathaniel Chen
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-04-18move _cleanup_ attribute in front of the typeHarald Hoyer
http://lists.freedesktop.org/archives/systemd-devel/2013-April/010510.html
2013-04-10Use initalization instead of explicit zeroing in more placesZbigniew Jędrzejewski-Szmek
2013-04-01Always use our own MAX/MIN definitionsCristian Rodríguez
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.]
2013-03-31Remove some dead codeZbigniew Jędrzejewski-Szmek
Based on coverity report.
2013-03-21bootchart: fix two unitialized memory freesZbigniew Jędrzejewski-Szmek
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; ^
2013-03-11bootchart: various superficial cleanupsLennart Poettering
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-07Revert "bootchart: use _cleanup_close_"Zbigniew Jędrzejewski-Szmek
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).
2013-03-07bootchart: use _cleanup_close_Nathaniel Chen
use _cleanup_{close_,fclose_} to close streams and file descriptors
2013-03-07bootchart: rename global len to samples_lenHarald Hoyer
2013-03-07bootchart: add parameter "-C" to expand process names to the full cmdlineHarald Hoyer
2013-02-14bootchart: if "root=/dev" is not matched, don't try to read /sysHarald Hoyer
2013-02-14bootchart: parse /etc/os-release rather than system-releaseHarald Hoyer
Also parse it early, so that we can get it in the initramfs.
2013-02-14bootchart: more fixes for bootchart in the initramfsHarald Hoyer
2013-02-13man: bootchart: change /var/log to /run/logWilliam Giokas
As of [1], bootchart stores files in /run/log, not /var/log, by default. [1] f2f85884caac671da84256acb44148df9a4dca70
2013-02-13bootchart: Fix typos and some EnglishWilliam Giokas
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
2013-02-12systemd-bootchart: relicense to LGPLv2.1+Auke Kok
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-01-25Add _cleanup_pclose_ and fix mismatching pipe close opened by popen()Zbigniew Jędrzejewski-Szmek
Based-on-patch-by: Thomas Jarosch <thomas.jarosch@intra2net.com> cppcheck reported: [src/bootchart/svg.c:791]: (error) Mismatching allocation and deallocation: f
2013-01-10bootchart: tabs to spacesThomas Hindoe Paaboel Andersen
2013-01-07bootchart: merge bootchartAuke Kok
Bootchart is renamed to 'systemd-bootchart' and installed as /usr/lib/systemd/systemd-bootchart. The configuration file will reside in /etc/systemd/bootchart.conf.