diff options
author | Ian Rogers <irogers@google.com> | 2024-10-01 20:20:05 -0700 |
---|---|---|
committer | Namhyung Kim <namhyung@kernel.org> | 2024-10-10 23:40:32 -0700 |
commit | c798f72c7a67a4c089142d4b16c8b9587e6db5e6 (patch) | |
tree | 13e3eef490ad4e6a70f45986f582b26e6b229382 /tools/perf/tests | |
parent | c051220d38463cfe8a248d204461beb3ed52b4ea (diff) | |
download | linux-stable-c798f72c7a67a4c089142d4b16c8b9587e6db5e6.tar.gz linux-stable-c798f72c7a67a4c089142d4b16c8b9587e6db5e6.tar.bz2 linux-stable-c798f72c7a67a4c089142d4b16c8b9587e6db5e6.zip |
perf pmu: Allow hardcoded terms to be applied to attributes
Hard coded terms like "config=10" are skipped by perf_pmu__config
assuming they were already applied to a perf_event_attr by parse
event's config_attr function. When doing a reverse number to name
lookup in perf_pmu__name_from_config, as the hardcoded terms aren't
applied the config value is incorrect leading to misses or false
matches. Fix this by adding a parameter to have perf_pmu__config apply
hardcoded terms too (not just in parse event's config_term_common).
Signed-off-by: Ian Rogers <irogers@google.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20241002032016.333748-3-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools/perf/tests')
-rw-r--r-- | tools/perf/tests/pmu.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/perf/tests/pmu.c b/tools/perf/tests/pmu.c index be18506f6a24..6a681e3fb552 100644 --- a/tools/perf/tests/pmu.c +++ b/tools/perf/tests/pmu.c @@ -176,7 +176,8 @@ static int test__pmu_format(struct test_suite *test __maybe_unused, int subtest } memset(&attr, 0, sizeof(attr)); - ret = perf_pmu__config_terms(pmu, &attr, &terms, /*zero=*/false, /*err=*/NULL); + ret = perf_pmu__config_terms(pmu, &attr, &terms, /*zero=*/false, + /*apply_hardcoded=*/false, /*err=*/NULL); if (ret) { pr_err("perf_pmu__config_terms failed"); goto err_out; |