Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf report: Fix condition in sort__sym_cmp()

It's expected that both hist entries are in the same hists when
comparing two. But the current code in the function checks one without
dso sort key and other with the key. This would make the condition true
in any case.

I guess the intention of the original commit was to add '!' for the
right side too. But as it should be the same, let's just remove it.

Fixes: 69849fc5d2119 ("perf hists: Move sort__has_dso into struct perf_hpp_list")
Reviewed-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20240621170528.608772-2-namhyung@kernel.org

+1 -1
+1 -1
tools/perf/util/sort.c
··· 334 334 * comparing symbol address alone is not enough since it's a 335 335 * relative address within a dso. 336 336 */ 337 - if (!hists__has(left->hists, dso) || hists__has(right->hists, dso)) { 337 + if (!hists__has(left->hists, dso)) { 338 338 ret = sort__dso_cmp(left, right); 339 339 if (ret != 0) 340 340 return ret;