perf trace: Ignore thread hashing in summary
authorIan Rogers <irogers@google.com>
Fri, 1 Mar 2024 05:36:40 +0000 (21:36 -0800)
committerNamhyung Kim <namhyung@kernel.org>
Mon, 4 Mar 2024 06:51:18 +0000 (22:51 -0800)
commitf178ffdf7ee5bf809837161002719e19eebff895
treee4b0354890476358153cfea5225a9bc9f73622c9
parent2f1e20feb9944d0dd50906819227e99e1a26f78c
perf trace: Ignore thread hashing in summary

Commit 91e467bc568f ("perf machine: Use hashtable for machine
threads") made the iteration of thread tids unordered. The perf trace
--summary output sorts and prints each hash bucket, rather than all
threads globally. Change this behavior by turn all threads into a
list, sort the list by number of trace events then by tids, finally
print the list. This also allows the rbtree in threads to be not
accessed outside of machine.

Signed-off-by: Ian Rogers <irogers@google.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Yang Jihong <yangjihong1@huawei.com>
Cc: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20240301053646.1449657-3-irogers@google.com
tools/perf/builtin-trace.c
tools/perf/util/rb_resort.h