diff options
author | Steven Rostedt <srostedt@redhat.com> | 2009-12-15 19:11:13 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2009-12-15 19:11:13 -0500 |
commit | aaa8b798203492e3ed80f06689c3f0c1f133d21b (patch) | |
tree | e8688850fd3bec7a2c9099c2c547e51f4bb0022d | |
parent | a2fc047f34a527af7cc313a1f094ffa86e9cbc16 (diff) |
trace-cmd: Reset page at ever read by tracecmd_read_at()
The timestamp was getting messed up by various reads of
tracecmd_read_at(). This resets the page everytime that
function is used.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | trace-input.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/trace-input.c b/trace-input.c index d6fc93e..80de3cf 100644 --- a/trace-input.c +++ b/trace-input.c | |||
@@ -723,14 +723,15 @@ read_event(struct tracecmd_input *handle, unsigned long long offset, | |||
723 | 723 | ||
724 | /* | 724 | /* |
725 | * Since the timestamp is calculated from the beginnnig | 725 | * Since the timestamp is calculated from the beginnnig |
726 | * of the page and through each event, we need to start | 726 | * of the page and through each event, we reset the |
727 | * with the timestamp. We can't go backwards. | 727 | * page to the beginning. This is just used by |
728 | * If the offset is behind the current offset then we | 728 | * tracecmd_read_at. |
729 | * need to calculate it again. | ||
730 | */ | 729 | */ |
731 | if (offset < handle->cpu_data[cpu].offset + | 730 | update_page_info(handle, cpu); |
732 | handle->cpu_data[cpu].index) | 731 | if (handle->cpu_data[cpu].next) { |
733 | handle->cpu_data[cpu].index = 0; | 732 | free_record(handle->cpu_data[cpu].next); |
733 | handle->cpu_data[cpu].next = NULL; | ||
734 | } | ||
734 | 735 | ||
735 | do { | 736 | do { |
736 | if (record) | 737 | if (record) |