aboutsummaryrefslogtreecommitdiffstats
path: root/trace-read.c
diff options
context:
space:
mode:
Diffstat (limited to 'trace-read.c')
-rw-r--r--trace-read.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/trace-read.c b/trace-read.c
index 91054b8..7b3824c 100644
--- a/trace-read.c
+++ b/trace-read.c
@@ -162,8 +162,15 @@ static void read_header_files(void)
162 size = read8(); 162 size = read8();
163 header_page = malloc_or_die(size); 163 header_page = malloc_or_die(size);
164 read_or_die(header_page, size); 164 read_or_die(header_page, size);
165 parse_header_page(header_page, size);
165 free(header_page); 166 free(header_page);
166 167
168 /*
169 * The size field in the page is of type long,
170 * use that instead, since it represents the kernel.
171 */
172 long_size = header_page_size_size;
173
167 read_or_die(buf, 13); 174 read_or_die(buf, 13);
168 if (memcmp(buf, "header_event", 13) != 0) 175 if (memcmp(buf, "header_event", 13) != 0)
169 die("did not read header event"); 176 die("did not read header event");
@@ -377,9 +384,11 @@ struct record *peak_data(int cpu)
377 384
378 if (!index) { 385 if (!index) {
379 /* FIXME: handle header page */ 386 /* FIXME: handle header page */
387 if (header_page_ts_size != 8)
388 die("expected a long long type for timestamp");
380 cpu_data[cpu].timestamp = data2host8(ptr); 389 cpu_data[cpu].timestamp = data2host8(ptr);
381 ptr += 8; 390 ptr += 8;
382 switch (long_size) { 391 switch (header_page_size_size) {
383 case 4: 392 case 4:
384 cpu_data[cpu].page_size = data2host4(ptr); 393 cpu_data[cpu].page_size = data2host4(ptr);
385 ptr += 4; 394 ptr += 4;
@@ -391,6 +400,7 @@ struct record *peak_data(int cpu)
391 default: 400 default:
392 die("bad long size"); 401 die("bad long size");
393 } 402 }
403 ptr = cpu_data[cpu].page + header_page_data_offset;
394 } 404 }
395 405
396read_again: 406read_again: