bootchart.c revision 955d98c9c1104d469c2989dbfb58f58ee6fe9bdc
124baf9a815afca02e01743867baf8319557e921kenneth_suter/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
124baf9a815afca02e01743867baf8319557e921kenneth_suter This file is part of systemd.
124baf9a815afca02e01743867baf8319557e921kenneth_suter Copyright (C) 2009-2013 Intel Corporation
124baf9a815afca02e01743867baf8319557e921kenneth_suter Auke Kok <auke-jan.h.kok@intel.com>
124baf9a815afca02e01743867baf8319557e921kenneth_suter systemd is free software; you can redistribute it and/or modify it
124baf9a815afca02e01743867baf8319557e921kenneth_suter under the terms of the GNU Lesser General Public License as published by
124baf9a815afca02e01743867baf8319557e921kenneth_suter the Free Software Foundation; either version 2.1 of the License, or
124baf9a815afca02e01743867baf8319557e921kenneth_suter (at your option) any later version.
124baf9a815afca02e01743867baf8319557e921kenneth_suter systemd is distributed in the hope that it will be useful, but
124baf9a815afca02e01743867baf8319557e921kenneth_suter WITHOUT ANY WARRANTY; without even the implied warranty of
124baf9a815afca02e01743867baf8319557e921kenneth_suter MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
124baf9a815afca02e01743867baf8319557e921kenneth_suter Lesser General Public License for more details.
124baf9a815afca02e01743867baf8319557e921kenneth_suter You should have received a copy of the GNU Lesser General Public License
124baf9a815afca02e01743867baf8319557e921kenneth_suter along with systemd; If not, see <http://www.gnu.org/licenses/>.
124baf9a815afca02e01743867baf8319557e921kenneth_suter Many thanks to those who contributed ideas and code:
124baf9a815afca02e01743867baf8319557e921kenneth_suter - Ziga Mahkovec - Original bootchart author
124baf9a815afca02e01743867baf8319557e921kenneth_suter - Anders Norgaard - PyBootchartgui
124baf9a815afca02e01743867baf8319557e921kenneth_suter - Michael Meeks - bootchart2
124baf9a815afca02e01743867baf8319557e921kenneth_suter - Scott James Remnant - Ubuntu C-based logger
124baf9a815afca02e01743867baf8319557e921kenneth_suter - Arjan van der Ven - for the idea to merge bootgraph.pl functionality
#include "svg.h"
#include "bootchart.h"
#include "list.h"
double graph_start;
double log_start;
int pscount;
int cpus;
double interval;
int overrun = 0;
static int exiting = 0;
bool arg_entropy = false;
bool initcall = true;
bool arg_relative = false;
bool arg_filter = true;
bool arg_show_cmdline = false;
bool arg_pss = false;
int samples;
if (sig++)
sig--;
static void parse_conf(void) {
arg_relative = true;
arg_filter = false;
arg_show_cmdline = true;
arg_pss = true;
arg_entropy = true;
return -EINVAL;
ssize_t n;
*p = NULL;
if (bootchart_file)
if (bootchart_message)
log_oom();
close(f);
close(f);
time_t t = 0;
parse_conf();
return EXIT_FAILURE;
* If the kernel executed us through init=/usr/lib/systemd/systemd-bootchart, then
if (fork()) {
if (!ps_first) {
log_oom();
return EXIT_FAILURE;
log_uptime();
int res;
double sample_stop;
long newint_ns;
double elapsed;
double timeleft;
if (sysfd < 0)
if (!build)
NULL);
log_uptime();
if (res) {
overrun++;
if (!of) {
if (!of) {
if (of)
if (sysfd >= 0)