@@ -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+
14301443union perf_sample_weight {
14311444 __u64 full ;
14321445#if defined(__LITTLE_ENDIAN_BITFIELD )
0 commit comments