linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf tools: Fix time sorting
@ 2019-11-04 23:27 Jiri Olsa
  2019-11-05  0:48 ` Andi Kleen
  2019-11-06 18:14 ` [tip: perf/urgent] " tip-bot2 for Jiri Olsa
  0 siblings, 2 replies; 6+ messages in thread
From: Jiri Olsa @ 2019-11-04 23:27 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Andi Kleen, lkml, Ingo Molnar, Namhyung Kim, Alexander Shishkin,
	Peter Zijlstra, Michael Petlan

The final sort might get confused when the comparison
is done over bigger numbers than int like for -s time.

Check following report for longer workloads:
  $ perf report -s time -F time,overhead --stdio

Fixing hist_entry__sort to properly return int64_t and
not possible cut int.

Cc: Andi Kleen <ak@linux.intel.com>
Link: http://lkml.kernel.org/n/tip-uetl5z1eszpubzqykvdftaq6@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/util/hist.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 679a1d75090c..7b6eaf5e0bda 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -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;
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-11-06 18:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-04 23:27 [PATCH] perf tools: Fix time sorting Jiri Olsa
2019-11-05  0:48 ` Andi Kleen
2019-11-05 11:49   ` Arnaldo Carvalho de Melo
2019-11-05 12:41     ` Jiri Olsa
2019-11-05 13:22       ` Arnaldo Carvalho de Melo
2019-11-06 18:14 ` [tip: perf/urgent] " tip-bot2 for Jiri Olsa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).