diff options
author | Vince Weaver <vincent.weaver@maine.edu> | 2013-08-23 15:51:03 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-09-02 02:42:48 -0400 |
commit | 274481de6cb69abdb49403ff32abb63c23743413 (patch) | |
tree | fe974241d382214e3d19a5a35ed97adb16158ba1 | |
parent | 13d7a2410fa637f450a29ecb515ac318ee40c741 (diff) |
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>
-rw-r--r-- | include/linux/perf_event.h | 24 | ||||
-rw-r--r-- | include/uapi/linux/perf_event.h | 24 |
2 files changed, 24 insertions, 24 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index c43f6eabad5b..4019d82c3d03 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -64,30 +64,6 @@ struct perf_raw_record { | |||
64 | }; | 64 | }; |
65 | 65 | ||
66 | /* | 66 | /* |
67 | * single taken branch record layout: | ||
68 | * | ||
69 | * from: source instruction (may not always be a branch insn) | ||
70 | * to: branch target | ||
71 | * mispred: branch target was mispredicted | ||
72 | * predicted: branch target was predicted | ||
73 | * | ||
74 | * support for mispred, predicted is optional. In case it | ||
75 | * is not supported mispred = predicted = 0. | ||
76 | * | ||
77 | * in_tx: running in a hardware transaction | ||
78 | * abort: aborting a hardware transaction | ||
79 | */ | ||
80 | struct perf_branch_entry { | ||
81 | __u64 from; | ||
82 | __u64 to; | ||
83 | __u64 mispred:1, /* target mispredicted */ | ||
84 | predicted:1,/* target predicted */ | ||
85 | in_tx:1, /* in transaction */ | ||
86 | abort:1, /* transaction abort */ | ||
87 | reserved:60; | ||
88 | }; | ||
89 | |||
90 | /* | ||
91 | * branch stack layout: | 67 | * branch stack layout: |
92 | * nr: number of taken branches stored in entries[] | 68 | * nr: number of taken branches stored in entries[] |
93 | * | 69 | * |
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 { | |||
757 | #define PERF_MEM_S(a, s) \ | 757 | #define PERF_MEM_S(a, s) \ |
758 | (((u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT) | 758 | (((u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT) |
759 | 759 | ||
760 | /* | ||
761 | * single taken branch record layout: | ||
762 | * | ||
763 | * from: source instruction (may not always be a branch insn) | ||
764 | * to: branch target | ||
765 | * mispred: branch target was mispredicted | ||
766 | * predicted: branch target was predicted | ||
767 | * | ||
768 | * support for mispred, predicted is optional. In case it | ||
769 | * is not supported mispred = predicted = 0. | ||
770 | * | ||
771 | * in_tx: running in a hardware transaction | ||
772 | * abort: aborting a hardware transaction | ||
773 | */ | ||
774 | struct perf_branch_entry { | ||
775 | __u64 from; | ||
776 | __u64 to; | ||
777 | __u64 mispred:1, /* target mispredicted */ | ||
778 | predicted:1,/* target predicted */ | ||
779 | in_tx:1, /* in transaction */ | ||
780 | abort:1, /* transaction abort */ | ||
781 | reserved:60; | ||
782 | }; | ||
783 | |||
760 | #endif /* _UAPI_LINUX_PERF_EVENT_H */ | 784 | #endif /* _UAPI_LINUX_PERF_EVENT_H */ |