perf mem: Clean up is_mem_loads_aux_event()
The aux_event can be retrieved from the perf_pmu now. Implement a generic support. Reviewed-by: Ian Rogers <irogers@google.com> Tested-by: Ravi Bangoria <ravi.bangoria@amd.com> Tested-by: Leo Yan <leo.yan@linaro.org> Signed-off-by: Kan Liang <kan.liang@linux.intel.com> Cc: james.clark@arm.com Cc: will@kernel.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-6-kan.liang@linux.intel.com Signed-off-by: Namhyung Kim <namhyung@kernel.org>
This commit is contained in:
parent
db95c2ce9b
commit
8ea9dfb916
@ -1,11 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
#include "util/pmu.h"
|
||||
#include "util/pmus.h"
|
||||
#include "util/env.h"
|
||||
#include "map_symbol.h"
|
||||
#include "mem-events.h"
|
||||
#include "linux/string.h"
|
||||
#include "env.h"
|
||||
#include "util/map_symbol.h"
|
||||
#include "util/mem-events.h"
|
||||
#include "mem-events.h"
|
||||
|
||||
|
||||
#define MEM_LOADS_AUX 0x8203
|
||||
|
||||
@ -28,16 +26,3 @@ struct perf_mem_event perf_mem_events_amd[PERF_MEM_EVENTS__MAX] = {
|
||||
E(NULL, NULL, NULL, false, 0),
|
||||
E("mem-ldst", "%s//", NULL, false, 0),
|
||||
};
|
||||
|
||||
bool is_mem_loads_aux_event(struct evsel *leader)
|
||||
{
|
||||
struct perf_pmu *pmu = perf_pmus__find("cpu");
|
||||
|
||||
if (!pmu)
|
||||
pmu = perf_pmus__find("cpu_core");
|
||||
|
||||
if (pmu && !perf_pmu__have_event(pmu, "mem-loads-aux"))
|
||||
return false;
|
||||
|
||||
return leader->core.attr.config == MEM_LOADS_AUX;
|
||||
}
|
||||
|
@ -107,9 +107,19 @@ static const char *perf_pmu__mem_events_name(int i, struct perf_pmu *pmu)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
__weak bool is_mem_loads_aux_event(struct evsel *leader __maybe_unused)
|
||||
bool is_mem_loads_aux_event(struct evsel *leader)
|
||||
{
|
||||
return false;
|
||||
struct perf_pmu *pmu = leader->pmu;
|
||||
struct perf_mem_event *e;
|
||||
|
||||
if (!pmu || !pmu->mem_events)
|
||||
return false;
|
||||
|
||||
e = &pmu->mem_events[PERF_MEM_EVENTS__LOAD];
|
||||
if (!e->aux_event)
|
||||
return false;
|
||||
|
||||
return leader->core.attr.config == e->aux_event;
|
||||
}
|
||||
|
||||
int perf_pmu__mem_events_parse(struct perf_pmu *pmu, const char *str)
|
||||
|
Loading…
x
Reference in New Issue
Block a user