]> Git Repo - linux.git/commit
perf pmu: Restore full PMU name wildcard support
authorJames Clark <[email protected]>
Wed, 26 Jun 2024 14:54:45 +0000 (15:54 +0100)
committerNamhyung Kim <[email protected]>
Fri, 28 Jun 2024 03:28:01 +0000 (20:28 -0700)
commit3e0bf9fde29844694ad9912aa290fbdb2c3fa767
treea71fb41bbfcf0b5a5166a92e32702bebc030b90f
parent4553c431e7dd259dafc1c7ed31797b8b3d7fe034
perf pmu: Restore full PMU name wildcard support

Commit b2b9d3a3f021 ("perf pmu: Support wildcards on pmu name in dynamic
pmu events") gives the following example for wildcarding a subset of
PMUs:

  E.g., in a system with the following dynamic pmus:

        mypmu_0
        mypmu_1
        mypmu_2
        mypmu_4

  perf stat -e mypmu_[01]/<config>/

Since commit f91fa2ae6360 ("perf pmu: Refactor perf_pmu__match()"), only
"*" has been supported, removing the ability to subset PMUs, even though
parse-events.l still supports ? and [] characters.

Fix it by using fnmatch() when any glob character is detected and add a
test which covers that and other scenarios of
perf_pmu__match_ignoring_suffix().

Fixes: f91fa2ae6360 ("perf pmu: Refactor perf_pmu__match()")
Signed-off-by: James Clark <[email protected]>
Reviewed-by: Ian Rogers <[email protected]>
Cc: [email protected]
Signed-off-by: Namhyung Kim <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
tools/perf/tests/pmu.c
tools/perf/util/pmu.c
This page took 0.06112 seconds and 4 git commands to generate.