X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fbootchart%2Fbootchart.h;h=d0273421de2b47c8faf040a2264c27a22c1716e6;hb=184d2ed770ccddbb9b6f6a452fdff42c16cb709f;hp=84e94209987d950a1659e31e97bc5a8f1da3a2d9;hpb=e93450c6c053d7499971a2b1310e893978f67f74;p=elogind.git
diff --git a/src/bootchart/bootchart.h b/src/bootchart/bootchart.h
index 84e942099..d0273421d 100644
--- a/src/bootchart/bootchart.h
+++ b/src/bootchart/bootchart.h
@@ -1,5 +1,9 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+
+#pragma once
+
/***
- bootchart.h - This file is part of systemd-bootchart
+ This file is part of systemd.
Copyright (C) 2009-2013 Intel Coproration
@@ -18,14 +22,14 @@
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see .
- ***/
+***/
#include
+#include
+#include "list.h"
#define MAXCPUS 16
#define MAXPIDS 65535
-#define MAXSAMPLES 8192
-
struct block_stat_struct {
/* /proc/vmstat pgpgin & pgpgout */
@@ -39,17 +43,27 @@ struct cpu_stat_sample_struct {
double waittime;
};
-struct cpu_stat_struct {
- /* per cpu array */
- struct cpu_stat_sample_struct sample[MAXSAMPLES];
-};
-
/* per process, per sample data we will log */
struct ps_sched_struct {
/* /proc//schedstat fields 1 & 2 */
double runtime;
double waittime;
int pss;
+ struct list_sample_data *sampledata;
+ struct ps_sched_struct *next;
+ struct ps_sched_struct *prev;
+ struct ps_sched_struct *cross; /* cross pointer */
+ struct ps_struct *ps_new;
+};
+
+struct list_sample_data {
+ double runtime[MAXCPUS];
+ double waittime[MAXCPUS];
+ double sampletime;
+ int entropy_avail;
+ struct block_stat_struct blockstat;
+ LIST_FIELDS(struct list_sample_data, link); /* DLL */
+ int counter;
};
/* process info */
@@ -60,7 +74,7 @@ struct ps_struct {
struct ps_struct *next; /* siblings */
/* must match - otherwise it's a new process with same PID */
- char name[16];
+ char name[256];
int pid;
int ppid;
@@ -69,9 +83,9 @@ struct ps_struct {
int schedstat;
FILE *smaps;
- /* index to first/last seen timestamps */
- int first;
- int last;
+ /* pointers to first/last seen timestamps */
+ struct ps_sched_struct *first;
+ struct ps_sched_struct *last;
/* records actual start time, may be way before bootchart runs */
double starttime;
@@ -96,32 +110,24 @@ extern double log_start;
extern double sampletime[];
extern struct ps_struct *ps_first;
extern struct block_stat_struct blockstat[];
-extern struct cpu_stat_struct cpustat[];
extern int pscount;
-extern int relative;
-extern int filter;
-extern int pss;
-extern int entropy;
-extern int initcall;
+extern bool arg_relative;
+extern bool arg_filter;
+extern bool arg_show_cmdline;
+extern bool arg_pss;
+extern bool arg_entropy;
+extern bool initcall;
extern int samples;
extern int cpus;
-extern int len;
-extern double hz;
-extern double scale_x;
-extern double scale_y;
+extern int arg_samples_len;
+extern double arg_hz;
+extern double arg_scale_x;
+extern double arg_scale_y;
extern int overrun;
extern double interval;
-extern char output_path[PATH_MAX];
-extern char init_path[PATH_MAX];
+extern char arg_output_path[PATH_MAX];
+extern char arg_init_path[PATH_MAX];
extern FILE *of;
-extern DIR *proc;
-extern int procfd;
extern int sysfd;
-
-extern double gettime_ns(void);
-extern void log_uptime(void);
-extern void log_sample(int sample);
-
-extern void svg_do(const char *build);