Skip to content

Commit 76db7aa

Browse files
Kan Liangacmel
authored andcommitted
tools headers UAPI: Sync include/uapi/linux/perf_event.h header with the kernel
Sync the new sample type for the branch counters feature. Signed-off-by: Kan Liang <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Alexey Bayduraev <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stephane Eranian <[email protected]> Cc: Tinghao Zhang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 851bbcc commit 76db7aa

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tools/include/uapi/linux/perf_event.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ enum perf_branch_sample_type_shift {
204204

205205
PERF_SAMPLE_BRANCH_PRIV_SAVE_SHIFT = 18, /* save privilege mode */
206206

207+
PERF_SAMPLE_BRANCH_COUNTERS_SHIFT = 19, /* save occurrences of events on a branch */
208+
207209
PERF_SAMPLE_BRANCH_MAX_SHIFT /* non-ABI */
208210
};
209211

@@ -235,6 +237,8 @@ enum perf_branch_sample_type {
235237

236238
PERF_SAMPLE_BRANCH_PRIV_SAVE = 1U << PERF_SAMPLE_BRANCH_PRIV_SAVE_SHIFT,
237239

240+
PERF_SAMPLE_BRANCH_COUNTERS = 1U << PERF_SAMPLE_BRANCH_COUNTERS_SHIFT,
241+
238242
PERF_SAMPLE_BRANCH_MAX = 1U << PERF_SAMPLE_BRANCH_MAX_SHIFT,
239243
};
240244

@@ -982,6 +986,12 @@ enum perf_event_type {
982986
* { u64 nr;
983987
* { u64 hw_idx; } && PERF_SAMPLE_BRANCH_HW_INDEX
984988
* { u64 from, to, flags } lbr[nr];
989+
* #
990+
* # The format of the counters is decided by the
991+
* # "branch_counter_nr" and "branch_counter_width",
992+
* # which are defined in the ABI.
993+
* #
994+
* { u64 counters; } cntr[nr] && PERF_SAMPLE_BRANCH_COUNTERS
985995
* } && PERF_SAMPLE_BRANCH_STACK
986996
*
987997
* { u64 abi; # enum perf_sample_regs_abi
@@ -1427,6 +1437,9 @@ struct perf_branch_entry {
14271437
reserved:31;
14281438
};
14291439

1440+
/* Size of used info bits in struct perf_branch_entry */
1441+
#define PERF_BRANCH_ENTRY_INFO_BITS_MAX 33
1442+
14301443
union perf_sample_weight {
14311444
__u64 full;
14321445
#if defined(__LITTLE_ENDIAN_BITFIELD)

0 commit comments

Comments
 (0)