Skip to content

Commit 722ddfd

Browse files
olsajiriacmel
authored andcommitted
perf tools: Fix time sorting
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: 043ca38 ("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]>
1 parent 6047e1a commit 722ddfd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/perf/util/hist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1625,7 +1625,7 @@ int hists__collapse_resort(struct hists *hists, struct ui_progress *prog)
16251625
return 0;
16261626
}
16271627

1628-
static int hist_entry__sort(struct hist_entry *a, struct hist_entry *b)
1628+
static int64_t hist_entry__sort(struct hist_entry *a, struct hist_entry *b)
16291629
{
16301630
struct hists *hists = a->hists;
16311631
struct perf_hpp_fmt *fmt;

0 commit comments

Comments
 (0)