diff options
author | Steven Rostedt <srostedt@redhat.com> | 2010-01-04 21:18:20 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2010-01-04 21:18:20 -0500 |
commit | b568a38880bb7885aab7e16ca27634a2dd6b2c9e (patch) | |
tree | dadbb0159f0464f01582442d040d0765feb3adc4 | |
parent | 6a9ec2dddf07d9c11aef8c6565555c1ee742dde2 (diff) |
trace-view: Fix searching by timestamp for filtered lists
When a list is filtered, the search_for_record_by_timestamp() was returning
incorrect values because the rows_ts_cmp() was using the pointer the array
was pointing to go to the next record. But if that record was not visible
or the next record should have been on another CPU, it would break the
bsearch.
The correct approach is to look at the next record in the array, not the
per cpu list.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | trace-view-store.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/trace-view-store.c b/trace-view-store.c index 0de6102..df16561 100644 --- a/trace-view-store.c +++ b/trace-view-store.c | |||
@@ -989,12 +989,13 @@ static int rows_ts_cmp(const void *a, const void *b) | |||
989 | /* a is just a key, but b is a pointer to a record pointer */ | 989 | /* a is just a key, but b is a pointer to a record pointer */ |
990 | const TraceViewRecord *ta = a; | 990 | const TraceViewRecord *ta = a; |
991 | const TraceViewRecord *tb = *(TraceViewRecord **)b; | 991 | const TraceViewRecord *tb = *(TraceViewRecord **)b; |
992 | const TraceViewRecord *tb1 = *((TraceViewRecord **)b+1); | ||
992 | 993 | ||
993 | /* match inbetween too */ | 994 | /* match inbetween too */ |
994 | if ((ta->timestamp == tb->timestamp) || | 995 | if ((ta->timestamp == tb->timestamp) || |
995 | 996 | ||
996 | (ta->timestamp > tb->timestamp && | 997 | (ta->timestamp > tb->timestamp && |
997 | ta->timestamp < (tb+1)->timestamp)) | 998 | ta->timestamp < tb1->timestamp)) |
998 | return 0; | 999 | return 0; |
999 | 1000 | ||
1000 | if (ta->timestamp < tb->timestamp) | 1001 | if (ta->timestamp < tb->timestamp) |