]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
perf report: Add 'tgid' sort key
authorNamhyung Kim <namhyung@kernel.org>
Fri, 9 May 2025 21:04:21 +0000 (14:04 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 13 May 2025 20:51:32 +0000 (17:51 -0300)
commit39922dc53c26842939e5d4d6bfeff8da677a9b33
tree9b88a7c2ef318801696adb9f334891ddb74e5981
parentb9228817127430356c929847f111197776201225
perf report: Add 'tgid' sort key

Sometimes we need to analyze the data in process level but current sort
keys only work on thread level.  Let's add 'tgid' sort key for that as
'pid' is already taken for thread.

This will look mostly the same, but it only uses tgid instead of tid.
Here's an example of a process with two threads (thloop).

  $ perf record -- perf test -w thloop

  $ perf report --stdio -s tgid,pid -H
  ...
  #
  #    Overhead  Tgid:Command / Pid:Command
  # ...........  ..........................
  #
     100.00%     2018407:perf
         50.34%     2018407:perf
         49.66%     2018409:perf

Suggested-by: Stephane Eranian <eranian@google.com>
Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20250509210421.197245-1-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/Documentation/perf-report.txt
tools/perf/util/hist.h
tools/perf/util/sort.c
tools/perf/util/sort.h