summaryrefslogtreecommitdiff
path: root/src/bootchart/bootchart.h
diff options
context:
space:
mode:
authorNathaniel Chen <nathaniel.chen@intel.com>2013-04-24 14:56:15 -0700
committerAuke Kok <auke-jan.h.kok@intel.com>2013-05-02 09:23:01 -0700
commit8dfb6e718d621a5115bd3b8e7e826195dc6bfe14 (patch)
treee64c6e39a8a0578fee928795be62778ffa893e20 /src/bootchart/bootchart.h
parent8368868452fc24536bf3322bfab536c66bf56a13 (diff)
downloadsystemd-8dfb6e718d621a5115bd3b8e7e826195dc6bfe14.tar.gz
Dynamically allocate bootchart logs
Instead of storing bootchart sample data in arrays, this patch moves storage to linked lists so that there is no more limit on samples. This patch also fixes parsing of /proc/<pid>/smaps in kernels > 3.7.
Diffstat (limited to 'src/bootchart/bootchart.h')
-rw-r--r--src/bootchart/bootchart.h23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/bootchart/bootchart.h b/src/bootchart/bootchart.h
index a9541caf4a..ee1e67604d 100644
--- a/src/bootchart/bootchart.h
+++ b/src/bootchart/bootchart.h
@@ -26,6 +26,7 @@
#include <dirent.h>
#include <stdbool.h>
+#include "list.h"
#define MAXCPUS 16
#define MAXPIDS 65535
@@ -54,6 +55,22 @@ struct ps_sched_struct {
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;
+ struct cpu_stat_struct cpustat;
+ LIST_FIELDS(struct list_sample_data, link); /* DLL */
+ int counter;
};
/* process info */
@@ -73,9 +90,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;