• Kan Liang's avatar
    perf mem: Clean up perf_mem_events__ptr() · a30450e6
    Kan Liang authored
    The mem_events can be retrieved from the struct perf_pmu now. An ARCH
    specific perf_mem_events__ptr() is not required anymore. Remove all of
    them.
    
    The Intel hybrid has multiple mem-events-supported PMUs. But they share
    the same mem_events. Other ARCHs only support one mem-events-supported
    PMU. In the configuration, it's good enough to only configure the
    mem_events for one PMU. Add perf_mem_events_find_pmu() which returns the
    first mem-events-supported PMU.
    
    In the perf_mem_events__init(), the perf_pmus__scan() is not required
    anymore. It avoids checking the sysfs for every PMU on the system.
    
    Make the perf_mem_events__record_args() more generic. Remove the
    perf_mem_events__print_unsupport_hybrid().
    
    Since pmu is added as a new parameter, rename perf_mem_events__ptr() to
    perf_pmu__mem_events_ptr(). Several other functions also do a similar
    rename.
    Reviewed-by: default avatarIan Rogers <irogers@google.com>
    Reviewed-by: default avatarKajol Jain <kjain@linux.ibm.com>
    Tested-by: default avatarRavi Bangoria <ravi.bangoria@amd.com>
    Tested-by: default avatarKajol jain <kjain@linux.ibm.com>
    Signed-off-by: default avatarKan Liang <kan.liang@linux.intel.com>
    Cc: james.clark@arm.com
    Cc: will@kernel.org
    Cc: leo.yan@linaro.org
    Cc: mike.leach@linaro.org
    Cc: renyu.zj@linux.alibaba.com
    Cc: yuhaixin.yhx@linux.alibaba.com
    Cc: tmricht@linux.ibm.com
    Cc: atrajeev@linux.vnet.ibm.com
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: john.g.garry@oracle.com
    Link: https://lore.kernel.org/r/20240123185036.3461837-3-kan.liang@linux.intel.comSigned-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
    a30450e6
mem-events.h 3.94 KB