aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/mem-events.h
diff options
context:
space:
mode:
authorLeo Yan <leo.yan@linaro.org>2020-11-06 17:48:46 +0800
committerArnaldo Carvalho de Melo <acme@redhat.com>2020-11-11 10:29:12 -0300
commiteaf6aaeec5fa301c0eb8ae92962909b15d075e5f (patch)
tree7eaf70180284fc30b5b72ec594722c51c6face8c /tools/perf/util/mem-events.h
parentperf mem: Search event name with more flexible path (diff)
downloadlinux-dev-eaf6aaeec5fa301c0eb8ae92962909b15d075e5f.tar.xz
linux-dev-eaf6aaeec5fa301c0eb8ae92962909b15d075e5f.zip
perf mem: Introduce weak function perf_mem_events__ptr()
Different architectures might use different event or different event parameters for memory profiling, this patch introduces a weak perf_mem_events__ptr() function which allows to return back a architecture specific memory event. Since the variable 'perf_mem_events' can be only accessed by the perf_mem_events__ptr() function, mark the variable as 'static', this allows the architectures to define its own memory event array. Signed-off-by: Leo Yan <leo.yan@linaro.org> Acked-by: Jiri Olsa <jolsa@redhat.com> Link: https://lore.kernel.org/r/20201106094853.21082-3-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to '')
-rw-r--r--tools/perf/util/mem-events.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/mem-events.h b/tools/perf/util/mem-events.h
index 904dad34f7f7..726a9c8103e4 100644
--- a/tools/perf/util/mem-events.h
+++ b/tools/perf/util/mem-events.h
@@ -31,13 +31,13 @@ enum {
PERF_MEM_EVENTS__MAX,
};
-extern struct perf_mem_event perf_mem_events[PERF_MEM_EVENTS__MAX];
extern unsigned int perf_mem_events__loads_ldlat;
int perf_mem_events__parse(const char *str);
int perf_mem_events__init(void);
char *perf_mem_events__name(int i);
+struct perf_mem_event *perf_mem_events__ptr(int i);
void perf_mem_events__list(void);