]> Git Repo - linux.git/commitdiff
perf tools: Fix time sorting
authorJiri Olsa <[email protected]>
Mon, 4 Nov 2019 23:27:11 +0000 (00:27 +0100)
committerArnaldo Carvalho de Melo <[email protected]>
Tue, 5 Nov 2019 11:49:14 +0000 (08:49 -0300)
The final sort might get confused when the comparison is done over
bigger numbers than int like for -s time.

Check the following report for longer workloads:

  $ perf report -s time -F time,overhead --stdio

Fix hist_entry__sort() to properly return int64_t and not possible cut
int.

Fixes: 043ca389a318 ("perf tools: Use hpp formats to sort final output")
Signed-off-by: Jiri Olsa <[email protected]>
Reviewed-by: Andi Kleen <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Michael Petlan <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: [email protected] # v3.16+
Link: http://lore.kernel.org/lkml/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
tools/perf/util/hist.c

index 679a1d75090ce10a9652f93479a0f233037ffc92..7b6eaf5e0bda51d512c3ab216b0ef224bd45b26d 100644 (file)
@@ -1625,7 +1625,7 @@ int hists__collapse_resort(struct hists *hists, struct ui_progress *prog)
        return 0;
 }
 
-static int hist_entry__sort(struct hist_entry *a, struct hist_entry *b)
+static int64_t hist_entry__sort(struct hist_entry *a, struct hist_entry *b)
 {
        struct hists *hists = a->hists;
        struct perf_hpp_fmt *fmt;
This page took 0.060499 seconds and 4 git commands to generate.