2 bootchart.h - This file is part of systemd-bootchart
4 Copyright (C) 2009-2013 Intel Coproration
7 Auke Kok <auke-jan.h.kok@intel.com>
9 systemd is free software; you can redistribute it and/or modify it
10 under the terms of the GNU Lesser General Public License as published by
11 the Free Software Foundation; either version 2.1 of the License, or
12 (at your option) any later version.
14 systemd is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
19 You should have received a copy of the GNU Lesser General Public License
20 along with systemd; If not, see <http://www.gnu.org/licenses/>.
28 #define MAXSAMPLES 8192
31 struct block_stat_struct {
32 /* /proc/vmstat pgpgin & pgpgout */
37 struct cpu_stat_sample_struct {
38 /* /proc/schedstat fields 10 & 11 (after name) */
43 struct cpu_stat_struct {
45 struct cpu_stat_sample_struct sample[MAXSAMPLES];
48 /* per process, per sample data we will log */
49 struct ps_sched_struct {
50 /* /proc/<n>/schedstat fields 1 & 2 */
58 struct ps_struct *next_ps; /* SLL pointer */
59 struct ps_struct *parent; /* ppid ref */
60 struct ps_struct *children; /* children */
61 struct ps_struct *next; /* siblings */
63 /* must match - otherwise it's a new process with same PID */
73 /* index to first/last seen timestamps */
77 /* records actual start time, may be way before bootchart runs */
80 /* record human readable total cpu time */
83 /* largest PSS size found */
86 /* for drawing connection lines later */
90 struct ps_sched_struct *sample;
93 extern int entropy_avail[];
95 extern double graph_start;
96 extern double log_start;
97 extern double sampletime[];
98 extern struct ps_struct *ps_first;
99 extern struct block_stat_struct blockstat[];
100 extern struct cpu_stat_struct cpustat[];
102 extern bool relative;
104 extern bool show_cmdline;
107 extern bool initcall;
110 extern int samples_len;
112 extern double scale_x;
113 extern double scale_y;
115 extern double interval;
117 extern char output_path[PATH_MAX];
118 extern char init_path[PATH_MAX];
125 extern double gettime_ns(void);
126 extern void log_uptime(void);
127 extern void log_sample(int sample);
129 extern void svg_do(const char *build);