]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
perf report: Add comm_nodigit sort key
authorStephen Brennan <stephen.s.brennan@oracle.com>
Fri, 20 Mar 2026 23:45:53 +0000 (16:45 -0700)
committerNamhyung Kim <namhyung@kernel.org>
Thu, 26 Mar 2026 22:22:18 +0000 (15:22 -0700)
commite397dd81bc45a991c43a97e010aa3fbe72ac833b
treef2d1ce5d029dec2fd700647193d4d7ad54843567
parent44311ae84ad9177fb311aee856027861c22f17b2
perf report: Add comm_nodigit sort key

The "comm" column allows grouping events by the process command. It is
intended to group like programs, despite having different PIDs. But some
workloads may adjust their own command, so that a unique identifier
(e.g. a PID or some other numeric value) is part of the command name.
This destroys the utility of "comm", forcing perf to place each unique
process name into its own bucket, which can contribute to a
combinatorial explosion of memory use in perf report.

Create a less strict version of this column, which ignores digits when
comparing command names. Commands whose names are the same (ignoring
digits) are sorted into the same histogram buckets, and displayed with
the placeholder value "<N>" in the place of digits. For example,
hypothetical command names "kworker/1" "kworker/2" "kworker/3" would
sort into the same bucket and be represented as "kworker/<N>".

Committer testing:

  $ perf report -s comm,comm_nodigit | grep -F "<N>"
       0.01%  CPU 6/TCG        CPU <N>/TCG
       0.01%  kworker/53:2-mm  kworker/<N>:<N>-mm
       0.01%  migration/24     migration/<N>
       0.01%  kworker/24:1-ev  kworker/<N>:<N>-ev
       0.01%  llvmpipe-8       llvmpipe-<N>

Signed-off-by: Stephen Brennan <stephen.s.brennan@oracle.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/Documentation/perf-report.txt
tools/perf/util/hist.c
tools/perf/util/hist.h
tools/perf/util/sort.c
tools/perf/util/sort.h