diff options
author | Steven Rostedt <srostedt@redhat.com> | 2011-09-02 10:33:11 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2011-09-02 10:33:11 -0400 |
commit | 890c635e3be43f349bceb9489b073453021464f3 (patch) | |
tree | caf5d416e36091ac839dec191a106939c8e88c8a | |
parent | 5dfeb30713b36a50240b7097f4c259613325040f (diff) |
trace-cmd: Have timestamp offset set at cpu descriptor not record
The cpu descriptor is referenced by many functions, and needs to include
the ts_offset, otherwise those functions will be incorrect. The record->ts
is based on the cpu descriptor timestamp, so by modifying the cpu timestamp
the record->ts is also modified.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | trace-input.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/trace-input.c b/trace-input.c index 8c2b858..201f5dd 100644 --- a/trace-input.c +++ b/trace-input.c | |||
@@ -784,6 +784,7 @@ static int update_page_info(struct tracecmd_input *handle, int cpu) | |||
784 | } | 784 | } |
785 | 785 | ||
786 | handle->cpu_data[cpu].timestamp = data2host8(pevent, ptr); | 786 | handle->cpu_data[cpu].timestamp = data2host8(pevent, ptr); |
787 | handle->cpu_data[cpu].timestamp += handle->ts_offset; | ||
787 | flags = read_page_flags(pevent, &ptr); | 788 | flags = read_page_flags(pevent, &ptr); |
788 | if (flags == -1U) | 789 | if (flags == -1U) |
789 | return -1; | 790 | return -1; |
@@ -1726,7 +1727,7 @@ read_again: | |||
1726 | return NULL; | 1727 | return NULL; |
1727 | memset(record, 0, sizeof(*record)); | 1728 | memset(record, 0, sizeof(*record)); |
1728 | 1729 | ||
1729 | record->ts = handle->cpu_data[cpu].timestamp + handle->ts_offset; | 1730 | record->ts = handle->cpu_data[cpu].timestamp; |
1730 | record->size = length; | 1731 | record->size = length; |
1731 | record->cpu = cpu; | 1732 | record->cpu = cpu; |
1732 | record->data = ptr; | 1733 | record->data = ptr; |