4 * Copyright (C) 2009-2012 Intel Coproration
7 * Auke Kok <auke-jan.h.kok@intel.com>
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; version 2
19 #define MAXSAMPLES 8192
22 struct block_stat_struct {
23 /* /proc/vmstat pgpgin & pgpgout */
28 struct cpu_stat_sample_struct {
29 /* /proc/schedstat fields 10 & 11 (after name) */
34 struct cpu_stat_struct {
36 struct cpu_stat_sample_struct sample[MAXSAMPLES];
39 /* per process, per sample data we will log */
40 struct ps_sched_struct {
41 /* /proc/<n>/schedstat fields 1 & 2 */
49 struct ps_struct *next_ps; /* SLL pointer */
50 struct ps_struct *parent; /* ppid ref */
51 struct ps_struct *children; /* children */
52 struct ps_struct *next; /* siblings */
54 /* must match - otherwise it's a new process with same PID */
64 /* index to first/last seen timestamps */
68 /* records actual start time, may be way before bootchart runs */
71 /* record human readable total cpu time */
74 /* largest PSS size found */
77 /* for drawing connection lines later */
81 struct ps_sched_struct *sample;
84 extern int entropy_avail[];
86 extern double graph_start;
87 extern double log_start;
88 extern double sampletime[];
89 extern struct ps_struct *ps_first;
90 extern struct block_stat_struct blockstat[];
91 extern struct cpu_stat_struct cpustat[];
102 extern double scale_x;
103 extern double scale_y;
105 extern double interval;
107 extern char output_path[PATH_MAX];
108 extern char init_path[PATH_MAX];
113 extern double gettime_ns(void);
114 extern void log_uptime(void);
115 extern void log_sample(int sample);
117 extern void svg_do(void);