aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2010-01-13 18:55:08 -0500
committerSteven Rostedt <rostedt@goodmis.org>2010-01-13 18:58:08 -0500
commit3389e7ed0f1d86dd73c388ffdd198761b5e4895b (patch)
treecc42176d09e1f0d152a02a58906fc91b0f89cbc9
parent88a8133659f6f3619f6f6ab1425ef2a8aec14733 (diff)
trace-cmd: Fix cursor on page with timestamp value
If the timestamp of the current page matches the parameter, we still need to check if the cached record exists and it too matches the timestamp. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--trace-input.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/trace-input.c b/trace-input.c
index af15634..0c7f9ad 100644
--- a/trace-input.c
+++ b/trace-input.c
@@ -1053,8 +1053,17 @@ tracecmd_set_cpu_to_timestamp(struct tracecmd_input *handle, int cpu,
1053 return -1; 1053 return -1;
1054 } 1054 }
1055 1055
1056 if (cpu_data->timestamp == ts) 1056 if (cpu_data->timestamp == ts) {
1057 /*
1058 * If a record is cached, then that record is most
1059 * likely the matching timestamp. Otherwise we need
1060 * to start from the beginning of the index;
1061 */
1062 if (!cpu_data->next ||
1063 cpu_data->next->ts != ts)
1064 update_page_info(handle, cpu);
1057 return 0; 1065 return 0;
1066 }
1058 1067
1059 /* Set to the first record on current page */ 1068 /* Set to the first record on current page */
1060 update_page_info(handle, cpu); 1069 update_page_info(handle, cpu);