perf, tools: Fix sorting for 64bit entries Some of the node comparisons in hist.c dropped the upper 32bit by using an int variable to store the compare result. This broke various 64bit fields, causing incorrect collapsing (found for the TSX transaction field) Just use int64_t always. Acked-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Andi Kleen <ak@linux.intel.com>
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 4714a72..4832b59 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c
@@ -350,7 +350,7 @@ struct rb_node **p; struct rb_node *parent = NULL; struct hist_entry *he; - int cmp; + int64_t cmp; p = &hists->entries_in->rb_node; @@ -887,7 +887,7 @@ struct rb_node **p; struct rb_node *parent = NULL; struct hist_entry *he; - int cmp; + int64_t cmp; if (sort__need_collapse) root = &hists->entries_collapsed;