aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <rostedt@goodmis.org>2009-07-17 19:26:55 -0400
committerSteven Rostedt <srostedt@redhat.com>2009-07-17 19:26:55 -0400
commit4de0b9baa56cb9e7164b5cfc6ead489c0d1c8e53 (patch)
tree6c87dba1142f808e6d8b326892d5944993c71376
parent8f1e3f87c141f081d8fb961f97d00b4100459eb5 (diff)
read target long size for page size
The ring buffer page uses local_t to keep track of the size of data held on an individual page. local_t is a long which means that it is either 4 bytes on a 32bit box, or 8bytes on a 64bit box. The code must be able to cope with this difference. Signed-off-by: Steven Rostedt <srostedt@redhat.com>
-rw-r--r--trace-read.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/trace-read.c b/trace-read.c
index fd8e206..ffb1374 100644
--- a/trace-read.c
+++ b/trace-read.c
@@ -388,8 +388,18 @@ struct record *peak_data(int cpu)
388 /* FIXME: handle header page */ 388 /* FIXME: handle header page */
389 cpu_data[cpu].timestamp = data2host8(ptr); 389 cpu_data[cpu].timestamp = data2host8(ptr);
390 ptr += 8; 390 ptr += 8;
391 cpu_data[cpu].page_size = data2host8(ptr); 391 switch (long_size) {
392 ptr += 8; 392 case 4:
393 cpu_data[cpu].page_size = data2host4(ptr);
394 ptr += 4;
395 break;
396 case 8:
397 cpu_data[cpu].page_size = data2host8(ptr);
398 ptr += 8;
399 break;
400 default:
401 die("bad long size");
402 }
393 } 403 }
394 404
395read_again: 405read_again: