summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/pmu.c
diff options
context:
space:
mode:
authorJames Clark <james.clark@arm.com>2024-06-26 16:54:45 +0200
committerNamhyung Kim <namhyung@kernel.org>2024-06-28 05:28:01 +0200
commit3e0bf9fde29844694ad9912aa290fbdb2c3fa767 (patch)
treea71fb41bbfcf0b5a5166a92e32702bebc030b90f /tools/perf/util/pmu.c
parentperf report: Display pregress bar on redirected pipe data (diff)
downloadlinux-3e0bf9fde29844694ad9912aa290fbdb2c3fa767.tar.xz
linux-3e0bf9fde29844694ad9912aa290fbdb2c3fa767.zip
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 <james.clark@arm.com> Reviewed-by: Ian Rogers <irogers@google.com> Cc: robin.murphy@arm.com Signed-off-by: Namhyung Kim <namhyung@kernel.org> Link: https://lore.kernel.org/r/20240626145448.896746-2-james.clark@arm.com
Diffstat (limited to 'tools/perf/util/pmu.c')
-rw-r--r--tools/perf/util/pmu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index c94a91645b21..97d74fe6d816 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -2150,7 +2150,7 @@ void perf_pmu__warn_invalid_config(struct perf_pmu *pmu, __u64 config,
bool perf_pmu__match(const struct perf_pmu *pmu, const char *tok)
{
const char *name = pmu->name;
- bool need_fnmatch = strchr(tok, '*') != NULL;
+ bool need_fnmatch = strisglob(tok);
if (!strncmp(tok, "uncore_", 7))
tok += 7;