]> git.ipfire.org Git - thirdparty/linux.git/commit
perf jevents: Fix build when there are other json files in the tree
authorJames Clark <james.clark@linaro.org>
Mon, 20 Oct 2025 16:08:26 +0000 (17:08 +0100)
committerNamhyung Kim <namhyung@kernel.org>
Tue, 21 Oct 2025 04:11:49 +0000 (21:11 -0700)
commit40efc872c6ac4029d2eda01af0b4528868ff1be3
tree14896e275dd3e62dbf9c5b33344a72418798ba5d
parent800201997a509c298e74696da3586d82b1a2b6f4
perf jevents: Fix build when there are other json files in the tree

The unquoted glob *.json will expand to a real file if, for example,
there is any file in the Perf source ending in .json. This can happen
when using tools like Bear and clangd which generate a
compile_commands.json file. With the glob already expanded by the shell,
the find command will fail to wildcard any real json events files.

Fix it by wrapping the star in quotes so it's passed to find rather than
the shell.

This fixes the following build error (most of the diff output omitted):

  $ make V=1 -C tools/perf O=/tmp/perf_build_with_json

  TEST    /tmp/perf_build_with_json/pmu-events/empty-pmu-events.log
  ...
   /* offset=121053 */ "node-access\000legacy cache\000Local memory read accesses\000legacy-cache-config=6\000\00010\000\000\000\000\000"
   /* offset=121135 */ "node-misses\000legacy cache\000Local memory read misses\000legacy-cache-config=0x10006\000\00010\000\000\000\000\000"
   /* offset=121221 */ "node-miss\000legacy cache\000Local memory read misses\000legacy-cache-config=0x10006\000\00010\000\000\000\000\000"
  ...
  -       {
                  .event_table = { 0, 0 },
                  .metric_table = { 0, 0 },
          },
  make[3]: *** [pmu-events/Build:54: /tmp/perf_build_with_json/pmu-events/empty-pmu-events.log] Error 1

Fixes: 4bb55de4ff03 ("perf jevents: Support copying the source json files to OUTPUT")
Signed-off-by: James Clark <james.clark@linaro.org>
Reviewed-by: Leo Yan <leo.yan@arm.com>
Tested-by: Leo Yan <leo.yan@arm.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/pmu-events/Build