perf tools: Add stat user level event
Adding a stat event to store a 'struct perf_counter_values' for a given
event/cpu/thread.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Kan Liang <kan.liang@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1445784728-21732-15-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h
index 4e87be2..f23f464 100644
--- a/tools/perf/util/event.h
+++ b/tools/perf/util/event.h
@@ -229,6 +229,7 @@
PERF_RECORD_THREAD_MAP = 73,
PERF_RECORD_CPU_MAP = 74,
PERF_RECORD_STAT_CONFIG = 75,
+ PERF_RECORD_STAT = 76,
PERF_RECORD_HEADER_MAX
};
@@ -414,6 +415,23 @@
struct stat_config_event_entry data[];
};
+struct stat_event {
+ struct perf_event_header header;
+
+ u64 id;
+ u32 cpu;
+ u32 thread;
+
+ union {
+ struct {
+ u64 val;
+ u64 ena;
+ u64 run;
+ };
+ u64 values[3];
+ };
+};
+
union perf_event {
struct perf_event_header header;
struct mmap_event mmap;
@@ -439,6 +457,7 @@
struct thread_map_event thread_map;
struct cpu_map_event cpu_map;
struct stat_config_event stat_config;
+ struct stat_event stat;
};
void perf_event__print_totals(void);