aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-12-15 12:02:56 -0500
committerSteven Rostedt <rostedt@goodmis.org>2009-12-15 12:02:56 -0500
commitcec78d30632122d3da5418b8e4b47176e1681044 (patch)
tree089a9e8cb7839033b26870d7cfe682470e5ba8e9
parentee931dce6dc7bb24223051bbdf09ac02bdc59b31 (diff)
Update timestamp with offset
If the offset of the page is modified, reset the timestamp as well. The tracecmd_set_cpu_to_timestamp depends on the timestamp being in sync with the offset. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--trace-input.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/trace-input.c b/trace-input.c
index ac729b4..a3a0580 100644
--- a/trace-input.c
+++ b/trace-input.c
@@ -594,6 +594,7 @@ static int get_page(struct tracecmd_input *handle, int cpu,
594 } 594 }
595 595
596 handle->cpu_data[cpu].offset = offset; 596 handle->cpu_data[cpu].offset = offset;
597 handle->cpu_data[cpu].timestamp = 0;
597 handle->cpu_data[cpu].size = (handle->cpu_data[cpu].file_offset + 598 handle->cpu_data[cpu].size = (handle->cpu_data[cpu].file_offset +
598 handle->cpu_data[cpu].file_size) - 599 handle->cpu_data[cpu].file_size) -
599 offset; 600 offset;
@@ -625,6 +626,7 @@ static int get_next_page(struct tracecmd_input *handle, int cpu)
625 626
626 if (handle->cpu_data[cpu].size <= handle->page_size) { 627 if (handle->cpu_data[cpu].size <= handle->page_size) {
627 handle->cpu_data[cpu].offset = 0; 628 handle->cpu_data[cpu].offset = 0;
629 handle->cpu_data[cpu].timestamp = 0;
628 return 0; 630 return 0;
629 } 631 }
630 632
@@ -1112,6 +1114,7 @@ static int init_cpu(struct tracecmd_input *handle, int cpu)
1112{ 1114{
1113 handle->cpu_data[cpu].offset = handle->cpu_data[cpu].file_offset; 1115 handle->cpu_data[cpu].offset = handle->cpu_data[cpu].file_offset;
1114 handle->cpu_data[cpu].size = handle->cpu_data[cpu].file_size; 1116 handle->cpu_data[cpu].size = handle->cpu_data[cpu].file_size;
1117 handle->cpu_data[cpu].timestamp = 0;
1115 1118
1116 if (!handle->cpu_data[cpu].size) { 1119 if (!handle->cpu_data[cpu].size) {
1117 printf("CPU %d is empty\n", cpu); 1120 printf("CPU %d is empty\n", cpu);