• Ian Rogers's avatar
    perf pmu-events: Remember the perf_events_map for a PMU · f20c15d1
    Ian Rogers authored
    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: default avatarIan Rogers <irogers@google.com>
    Tested-by: default avatarYang 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.comSigned-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
    f20c15d1
jevents.py 42.3 KB