summaryrefslogtreecommitdiff
path: root/tools/perf/arch/x86/util
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2023-10-12 20:56:44 +0300
committerNamhyung Kim <namhyung@kernel.org>2023-10-17 22:40:50 +0300
commitf20c15d13f017d4b46523990a0f3ba42025391a6 (patch)
tree08b1d94168bfd124fbb2d226042dee3ecd993fee /tools/perf/arch/x86/util
parent63883cb063846e9d0574038bb702a3a62a1ec046 (diff)
downloadlinux-f20c15d13f017d4b46523990a0f3ba42025391a6.tar.xz
perf pmu-events: Remember the perf_events_map for a PMU
strcmp_cpuid_str performs regular expression comparisons and so per CPUID linear searches over the perf_events_map are expensive. Add a helper function called map_for_pmu that does the search but also caches the map specific to a PMU. As the PMU may differ, also cache the CPUID string so that PMUs with the same CPUID string don't require the linear search and regular expression comparisons. This speeds loading PMUs as the search is done once per PMU to find the appropriate tables. Signed-off-by: Ian Rogers <irogers@google.com> Tested-by: Yang Jihong <yangjihong1@huawei.com> Cc: Ravi Bangoria <ravi.bangoria@amd.com> Cc: James Clark <james.clark@arm.com> Cc: Suzuki K Poulose <suzuki.poulose@arm.com> Cc: Will Deacon <will@kernel.org> Cc: Leo Yan <leo.yan@linaro.org> Cc: Mike Leach <mike.leach@linaro.org> Cc: Jing Zhang <renyu.zj@linux.alibaba.com> Cc: Kajol Jain <kjain@linux.ibm.com> Cc: Thomas Richter <tmricht@linux.ibm.com> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: John Garry <john.g.garry@oracle.com> Cc: linux-arm-kernel@lists.infradead.org Cc: coresight@lists.linaro.org Link: https://lore.kernel.org/r/20231012175645.1849503-7-irogers@google.com Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools/perf/arch/x86/util')
0 files changed, 0 insertions, 0 deletions