]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
perf tool_pmu: Make core_wide and target_cpu json events
authorIan Rogers <irogers@google.com>
Tue, 11 Nov 2025 21:22:06 +0000 (13:22 -0800)
committerNamhyung Kim <namhyung@kernel.org>
Wed, 12 Nov 2025 00:48:36 +0000 (16:48 -0800)
commit68cc6ec3ac2960f0871421c16e49cba826fdff52
treefb0fbf0f0ba2cacca8f613a877b0b51fc2462553
parent02432d920e3b174ff44a9fabb82fc8316f236a65
perf tool_pmu: Make core_wide and target_cpu json events

For the sake of better documentation, add core_wide and target_cpu to
the tool.json. When the values of system_wide and
user_requested_cpu_list are unknown, use the values from the global
stat_config.

Example output showing how '-a' modifies the values in `perf stat`:
```
$ perf stat -e core_wide,target_cpu true

 Performance counter stats for 'true':

                 0      core_wide
                 0      target_cpu

       0.000993787 seconds time elapsed

       0.001128000 seconds user
       0.000000000 seconds sys

$ perf stat -e core_wide,target_cpu -a true

 Performance counter stats for 'system wide':

                 1      core_wide
                 1      target_cpu

       0.002271723 seconds time elapsed

$ perf list
...
tool:
  core_wide
       [1 if not SMT,if SMT are events being gathered on all SMT threads 1 otherwise 0. Unit: tool]
...
  target_cpu
       [1 if CPUs being analyzed,0 if threads/processes. Unit: tool]
...
```

Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/pmu-events/arch/common/common/tool.json
tools/perf/pmu-events/empty-pmu-events.c
tools/perf/util/expr.c
tools/perf/util/stat-shadow.c
tools/perf/util/tool_pmu.c
tools/perf/util/tool_pmu.h