summaryrefslogtreecommitdiffstats
path: root/tools/perf/util
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2016-02-15 09:34:34 +0100
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-02-23 12:11:06 -0300
commitacbe613e0c03d59cab21aec3565cdb28c7df98c3 (patch)
treef1f03f8ece7f3964f633870202689dcbbabd9850 /tools/perf/util
parentd392711095f12942a61e2963f5ab0076ac651e73 (diff)
downloadblackbird-op-linux-acbe613e0c03d59cab21aec3565cdb28c7df98c3.tar.gz
blackbird-op-linux-acbe613e0c03d59cab21aec3565cdb28c7df98c3.zip
perf tools: Add monitored events array
It will ease up configuration of memory events and addition of other memory events in following patches. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: Andi Kleen <ak@linux.intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1455525293-8671-5-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util')
-rw-r--r--tools/perf/util/Build1
-rw-r--r--tools/perf/util/mem-events.c10
-rw-r--r--tools/perf/util/mem-events.h19
3 files changed, 30 insertions, 0 deletions
diff --git a/tools/perf/util/Build b/tools/perf/util/Build
index a34752d28488..df2b690970ac 100644
--- a/tools/perf/util/Build
+++ b/tools/perf/util/Build
@@ -82,6 +82,7 @@ libperf-y += parse-branch-options.o
libperf-y += parse-regs-options.o
libperf-y += term.o
libperf-y += help-unknown-cmd.o
+libperf-y += mem-events.o
libperf-$(CONFIG_LIBBPF) += bpf-loader.o
libperf-$(CONFIG_BPF_PROLOGUE) += bpf-prologue.o
diff --git a/tools/perf/util/mem-events.c b/tools/perf/util/mem-events.c
new file mode 100644
index 000000000000..c6ba0a19ec9a
--- /dev/null
+++ b/tools/perf/util/mem-events.c
@@ -0,0 +1,10 @@
+#include "mem-events.h"
+
+#define E(n) { .name = n }
+
+struct perf_mem_event perf_mem_events[PERF_MEM_EVENTS__MAX] = {
+ E("cpu/mem-loads,ldlat=30/P"),
+ E("cpu/mem-stores/P"),
+};
+
+#undef E
diff --git a/tools/perf/util/mem-events.h b/tools/perf/util/mem-events.h
new file mode 100644
index 000000000000..c97b21465fa9
--- /dev/null
+++ b/tools/perf/util/mem-events.h
@@ -0,0 +1,19 @@
+#ifndef __PERF_MEM_EVENTS_H
+#define __PERF_MEM_EVENTS_H
+
+#include <stdbool.h>
+
+struct perf_mem_event {
+ bool record;
+ const char *name;
+};
+
+enum {
+ PERF_MEM_EVENTS__LOAD,
+ PERF_MEM_EVENTS__STORE,
+ PERF_MEM_EVENTS__MAX,
+};
+
+extern struct perf_mem_event perf_mem_events[PERF_MEM_EVENTS__MAX];
+
+#endif /* __PERF_MEM_EVENTS_H */
OpenPOWER on IntegriCloud