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/>.
27 #define MAXSAMPLES 8192
30 struct block_stat_struct {
31 /* /proc/vmstat pgpgin & pgpgout */
36 struct cpu_stat_sample_struct {
37 /* /proc/schedstat fields 10 & 11 (after name) */
42 struct cpu_stat_struct {
44 struct cpu_stat_sample_struct sample[MAXSAMPLES];
47 /* per process, per sample data we will log */
48 struct ps_sched_struct {
49 /* /proc/<n>/schedstat fields 1 & 2 */
57 struct ps_struct *next_ps; /* SLL pointer */
58 struct ps_struct *parent; /* ppid ref */
59 struct ps_struct *children; /* children */
60 struct ps_struct *next; /* siblings */
62 /* must match - otherwise it's a new process with same PID */
72 /* index to first/last seen timestamps */
76 /* records actual start time, may be way before bootchart runs */
79 /* record human readable total cpu time */
82 /* largest PSS size found */
85 /* for drawing connection lines later */
89 struct ps_sched_struct *sample;
92 extern int entropy_avail[];
94 extern double graph_start;
95 extern double log_start;
96 extern double sampletime[];
97 extern struct ps_struct *ps_first;
98 extern struct block_stat_struct blockstat[];
99 extern struct cpu_stat_struct cpustat[];
110 extern double scale_x;
111 extern double scale_y;
113 extern double interval;
115 extern char output_path[PATH_MAX];
116 extern char init_path[PATH_MAX];
121 extern double gettime_ns(void);
122 extern void log_uptime(void);
123 extern void log_sample(int sample);
125 extern void svg_do(void);