]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
perf list: Support filtering in JSON output
authorNamhyung Kim <namhyung@kernel.org>
Thu, 20 Nov 2025 00:47:26 +0000 (16:47 -0800)
committerNamhyung Kim <namhyung@kernel.org>
Thu, 20 Nov 2025 19:11:48 +0000 (11:11 -0800)
commit3ce77655f026a316442f23d47da6c5cd89c1fdac
tree1dc1ee2927fffbebb9e13d343a233b929cf09ba9
parent58e0a81e76bf274afe7d24d80d7855a7642bb52a
perf list: Support filtering in JSON output

Like regular output mode, it should honor command line arguments to
limit to a certain type of PMUs or events.

  $ perf list -j hw
  [
  {
          "Unit": "cpu",
          "Topic": "legacy hardware",
          "EventName": "branch-instructions",
          "EventType": "Kernel PMU event",
          "BriefDescription": "Retired branch instructions [This event is an alias of branches]",
          "Encoding": "cpu/event=0xc4\n/"
  },
  {
          "Unit": "cpu",
          "Topic": "legacy hardware",
          "EventName": "branch-misses",
          "EventType": "Kernel PMU event",
          "BriefDescription": "Mispredicted branch instructions",
          "Encoding": "cpu/event=0xc5\n/"
  },
  ...

Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/builtin-list.c