Skip to content

Commit 71ef3c6

Browse files
Andi KleenIngo Molnar
authored andcommitted
perf: Add cycles to branch_info
Intel Skylake supports reporting the time in cycles a branch in the LBR took, to give a rough indication of the basic block performance. Export the cycle information in the branch_info structure. This can be done by just reusing some currently zero padding. This is just the generic header change. The architecture still needs to fill it in. There's no attempt to convert to real time, as we really want cycles here. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: eranian@google.com Link: http://lkml.kernel.org/r/1431285767-27027-5-git-send-email-andi@firstfloor.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent b83ff1c commit 71ef3c6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

include/uapi/linux/perf_event.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -951,6 +951,7 @@ union perf_mem_data_src {
951951
*
952952
* in_tx: running in a hardware transaction
953953
* abort: aborting a hardware transaction
954+
* cycles: cycles from last branch (or 0 if not supported)
954955
*/
955956
struct perf_branch_entry {
956957
__u64 from;
@@ -959,7 +960,8 @@ struct perf_branch_entry {
959960
predicted:1,/* target predicted */
960961
in_tx:1, /* in transaction */
961962
abort:1, /* transaction abort */
962-
reserved:60;
963+
cycles:16, /* cycle count to last branch */
964+
reserved:44;
963965
};
964966

965967
#endif /* _UAPI_LINUX_PERF_EVENT_H */

0 commit comments

Comments
 (0)