summaryrefslogtreecommitdiffstats
path: root/tools/perf/tests
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2023-08-24 06:13:24 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2023-08-24 16:07:39 +0200
commit7c52f10c0d4d8db86ef94b40446efbe291d067dc (patch)
tree9fa99ecad03a16158fe02862b751455bfb6c5f25 /tools/perf/tests
parentperf pmu: Merge JSON events with sysfs at load time (diff)
downloadlinux-7c52f10c0d4d8db86ef94b40446efbe291d067dc.tar.xz
linux-7c52f10c0d4d8db86ef94b40446efbe291d067dc.zip
perf pmu: Cache JSON events table
Cache the JSON events table so that finding it isn't done per event/alias. Change the events table find so that when the PMU is given, if the PMU has no JSON events return null. Update usage to always use the PMU variable. Signed-off-by: Ian Rogers <irogers@google.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Gaosheng Cui <cuigaosheng1@huawei.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: James Clark <james.clark@arm.com> Cc: Jing Zhang <renyu.zj@linux.alibaba.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: John Garry <john.g.garry@oracle.com> Cc: Kajol Jain <kjain@linux.ibm.com> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ravi Bangoria <ravi.bangoria@amd.com> Cc: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20230824041330.266337-13-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/tests')
-rw-r--r--tools/perf/tests/pmu-events.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/tests/pmu-events.c b/tools/perf/tests/pmu-events.c
index 34f0de182fa9..4fcb84fd1f65 100644
--- a/tools/perf/tests/pmu-events.c
+++ b/tools/perf/tests/pmu-events.c
@@ -544,6 +544,7 @@ static int __test_core_pmu_event_aliases(char *pmu_name, int *count)
INIT_LIST_HEAD(&pmu->list);
pmu->name = strdup(pmu_name);
+ pmu->events_table = table;
pmu_add_cpu_aliases_table(pmu, table);
res = pmu_events_table__find_event(table, pmu, "bp_l1_btb_correct", NULL, NULL);
@@ -583,6 +584,7 @@ static int __test_uncore_pmu_event_aliases(struct perf_pmu_test_pmu *test_pmu)
events_table = find_core_events_table("testarch", "testcpu");
if (!events_table)
return -1;
+ pmu->events_table = events_table;
pmu_add_cpu_aliases_table(pmu, events_table);
pmu_add_sys_aliases(pmu);