summaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/perf_event.h
diff options
context:
space:
mode:
authorVince Weaver2013-08-23 21:51:03 +0200
committerIngo Molnar2013-09-02 08:42:48 +0200
commit274481de6cb69abdb49403ff32abb63c23743413 (patch)
treefe974241d382214e3d19a5a35ed97adb16158ba1 /include/uapi/linux/perf_event.h
parentperf: Add attr->mmap2 attribute to an event (diff)
downloadkernel-qcow2-linux-274481de6cb69abdb49403ff32abb63c23743413.tar.gz
kernel-qcow2-linux-274481de6cb69abdb49403ff32abb63c23743413.tar.xz
kernel-qcow2-linux-274481de6cb69abdb49403ff32abb63c23743413.zip
perf: Export struct perf_branch_entry to userspace
If PERF_SAMPLE_BRANCH_STACK is enabled then samples are returned with the format { u64 from, to, flags } but the flags layout is not specified. This field has the type struct perf_branch_entry; move this definition into include/uapi/linux/perf_event.h so users can access these fields. This is similar to the existing inclusion of perf_mem_data_src in the include/uapi/linux/perf_event.h file. Signed-off-by: Vince Weaver <vincent.weaver@maine.edu> Acked-by: Stephane Eranian <eranian@google.com> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/alpine.DEB.2.10.1308231544420.1889@vincent-weaver-1.um.maine.edu Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/uapi/linux/perf_event.h')
-rw-r--r--include/uapi/linux/perf_event.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
index a77f43af72b8..408b8c730731 100644
--- a/include/uapi/linux/perf_event.h
+++ b/include/uapi/linux/perf_event.h
@@ -757,4 +757,28 @@ union perf_mem_data_src {
#define PERF_MEM_S(a, s) \
(((u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT)
+/*
+ * single taken branch record layout:
+ *
+ * from: source instruction (may not always be a branch insn)
+ * to: branch target
+ * mispred: branch target was mispredicted
+ * predicted: branch target was predicted
+ *
+ * support for mispred, predicted is optional. In case it
+ * is not supported mispred = predicted = 0.
+ *
+ * in_tx: running in a hardware transaction
+ * abort: aborting a hardware transaction
+ */
+struct perf_branch_entry {
+ __u64 from;
+ __u64 to;
+ __u64 mispred:1, /* target mispredicted */
+ predicted:1,/* target predicted */
+ in_tx:1, /* in transaction */
+ abort:1, /* transaction abort */
+ reserved:60;
+};
+
#endif /* _UAPI_LINUX_PERF_EVENT_H */