chiark / gitweb /
bootchart: more fixes for bootchart in the initramfs
[elogind.git] / src / bootchart / bootchart.h
index 0d8bed16b02951d07700b1ea6ba2eec33872e256..6b11fd8b8e00cf1574bc9592de4d219ec8ff8813 100644 (file)
@@ -1,16 +1,24 @@
-/*
- * bootchart.h
- *
- * Copyright (C) 2009-2012 Intel Coproration
- *
- * Authors:
- *   Auke Kok <auke-jan.h.kok@intel.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; version 2
- * of the License.
- */
+/***
+  bootchart.h - This file is part of systemd-bootchart
+
+  Copyright (C) 2009-2013 Intel Coproration
+
+  Authors:
+    Auke Kok <auke-jan.h.kok@intel.com>
+
+  systemd is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Lesser General Public License as published by
+  the Free Software Foundation; either version 2.1 of the License, or
+  (at your option) any later version.
+
+  systemd is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public License
+  along with systemd; If not, see <http://www.gnu.org/licenses/>.
+ ***/
 
 #include <dirent.h>
 
 
 
 struct block_stat_struct {
-       /* /proc/vmstat pgpgin & pgpgout */
-       int bi;
-       int bo;
+        /* /proc/vmstat pgpgin & pgpgout */
+        int bi;
+        int bo;
 };
 
 struct cpu_stat_sample_struct {
-       /* /proc/schedstat fields 10 & 11 (after name) */
-       double runtime;
-       double waittime;
+        /* /proc/schedstat fields 10 & 11 (after name) */
+        double runtime;
+        double waittime;
 };
 
 struct cpu_stat_struct {
-       /* per cpu array */
-       struct cpu_stat_sample_struct sample[MAXSAMPLES];
+        /* per cpu array */
+        struct cpu_stat_sample_struct sample[MAXSAMPLES];
 };
 
 /* per process, per sample data we will log */
 struct ps_sched_struct {
-       /* /proc/<n>/schedstat fields 1 & 2 */
-       double runtime;
-       double waittime;
-       int pss;
+        /* /proc/<n>/schedstat fields 1 & 2 */
+        double runtime;
+        double waittime;
+        int pss;
 };
 
 /* process info */
 struct ps_struct {
-       struct ps_struct *next_ps;    /* SLL pointer */
-       struct ps_struct *parent;     /* ppid ref */
-       struct ps_struct *children;   /* children */
-       struct ps_struct *next;       /* siblings */
+        struct ps_struct *next_ps;    /* SLL pointer */
+        struct ps_struct *parent;     /* ppid ref */
+        struct ps_struct *children;   /* children */
+        struct ps_struct *next;       /* siblings */
 
-       /* must match - otherwise it's a new process with same PID */
-       char name[16];
-       int pid;
-       int ppid;
+        /* must match - otherwise it's a new process with same PID */
+        char name[16];
+        int pid;
+        int ppid;
 
-       /* cache fd's */
-       int sched;
-       int schedstat;
-       FILE *smaps;
+        /* cache fd's */
+        int sched;
+        int schedstat;
+        FILE *smaps;
 
-       /* index to first/last seen timestamps */
-       int first;
-       int last;
+        /* index to first/last seen timestamps */
+        int first;
+        int last;
 
-       /* records actual start time, may be way before bootchart runs */
-       double starttime;
+        /* records actual start time, may be way before bootchart runs */
+        double starttime;
 
-       /* record human readable total cpu time */
-       double total;
+        /* record human readable total cpu time */
+        double total;
 
-       /* largest PSS size found */
-       int pss_max;
+        /* largest PSS size found */
+        int pss_max;
 
-       /* for drawing connection lines later */
-       double pos_x;
-       double pos_y;
+        /* for drawing connection lines later */
+        double pos_x;
+        double pos_y;
 
-       struct ps_sched_struct *sample;
+        struct ps_sched_struct *sample;
 };
 
 extern int entropy_avail[];
@@ -109,6 +117,8 @@ extern char 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);