trace-cmd library: Fix chunk_cmp()
PATCH 1/1 trace-cmd library: Fix chunk_cmp()
From: "Steven Rostedt (Google)" <[email protected]>
The binary search looking for an address in the compressed chunks was failing when it should have found a chunk. The reason is that the order of the offsets is in ascending order, but the search was looking as if it was in descending order.
Fixes 6a724f21bbbe1 ("trace-cmd library: Add logic for in-memory decompression")
Signed-off-by Steven Rostedt (Google) <[email protected]>
--- lib/trace-cmd/trace-input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/trace-cmd/trace-input.c +1 -1
@@ -1285,7 +1285,7 @@ static int chunk_cmp(const void *A, const void *B)if (CHUNK_CHECK_OFFSET (b, a->offset))return 0 ; -if (b->offset < a->offset) +if (a->offset < b->offset)return -1 ;return 1 ;
Signature · 1 line
2.35.1