1 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
6 This file is part of systemd.
8 Copyright (C) 2009-2013 Intel Corporation
11 Auke Kok <auke-jan.h.kok@intel.com>
13 systemd is free software; you can redistribute it and/or modify it
14 under the terms of the GNU Lesser General Public License as published by
15 the Free Software Foundation; either version 2.1 of the License, or
16 (at your option) any later version.
18 systemd is distributed in the hope that it will be useful, but
19 WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 Lesser General Public License for more details.
23 You should have received a copy of the GNU Lesser General Public License
24 along with systemd; If not, see <http://www.gnu.org/licenses/>.
34 struct block_stat_struct {
35 /* /proc/vmstat pgpgin & pgpgout */
40 struct cpu_stat_sample_struct {
41 /* /proc/schedstat fields 10 & 11 (after name) */
46 /* per process, per sample data we will log */
47 struct ps_sched_struct {
48 /* /proc/<n>/schedstat fields 1 & 2 */
52 struct list_sample_data *sampledata;
53 struct ps_sched_struct *next;
54 struct ps_sched_struct *prev;
55 struct ps_sched_struct *cross; /* cross pointer */
56 struct ps_struct *ps_new;
59 struct list_sample_data {
60 double runtime[MAXCPUS];
61 double waittime[MAXCPUS];
64 struct block_stat_struct blockstat;
65 LIST_FIELDS(struct list_sample_data, link); /* DLL */
71 struct ps_struct *next_ps; /* SLL pointer */
72 struct ps_struct *parent; /* ppid ref */
73 struct ps_struct *children; /* children */
74 struct ps_struct *next; /* siblings */
76 /* must match - otherwise it's a new process with same PID */
87 /* pointers to first/last seen timestamps */
88 struct ps_sched_struct *first;
89 struct ps_sched_struct *last;
91 /* records actual start time, may be way before bootchart runs */
94 /* record human readable total cpu time */
97 /* largest PSS size found */
100 /* for drawing connection lines later */
104 struct ps_sched_struct *sample;
107 extern int entropy_avail[];
109 extern double graph_start;
110 extern double log_start;
111 extern double sampletime[];
112 extern struct ps_struct *ps_first;
113 extern struct block_stat_struct blockstat[];
115 extern bool arg_relative;
116 extern bool arg_filter;
117 extern bool arg_show_cmdline;
118 extern bool arg_show_cgroup;
120 extern bool arg_entropy;
121 extern bool initcall;
124 extern int arg_samples_len;
125 extern double arg_hz;
126 extern double arg_scale_x;
127 extern double arg_scale_y;
129 extern double interval;
131 extern char arg_output_path[PATH_MAX];
132 extern char arg_init_path[PATH_MAX];