History

perf branch: Extend branch type classification

This updates the perf tool with generic branch type classification with new ABI extender place holder i.e PERF_BR_EXTEND_ABI, the new 4 bit branch type field i.e perf_branch_entry.new_type, new generic page fault related branch types and some arch specific branch types as added earlier in the kernel. Committer note: Add an extra entry to the branch_type_name array to cope with PERF_BR_EXTEND_ABI, to address build warnings on some compiler/systems, like: 75 8.89 ubuntu:20.04-x-powerpc64el : FAIL gcc version 10.3.0 (Ubuntu 10.3.0-1ubuntu1~20.04) inlined from 'branch_type_stat_display' at util/branch.c:152:4: /usr/powerpc64le-linux-gnu/include/bits/stdio2.h:100:10: error: '%8s' directive argument is null [-Werror=format-overflow=] 100 | return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 101 | __va_arg_pack ()); | ~~~~~~~~~~~~~~~~~

Anshuman Khandual committed 4 years ago

Commit 0ddea8e1 parent 1c96b6e5 files · +75 −6Browse files

Showing the changes to tools/include/uapi/linux (1 of 5 files). Show all

Unified · Split

tools/include/uapi/linux/perf_event.h+15−1
@@ -255,9 +255,22 @@ enum { · 254 unmodified lines
255255 PERF_BR_IRQ = 12, /* irq */
256256 PERF_BR_SERROR = 13, /* system error */
257257 PERF_BR_NO_TX = 14, /* not in transaction */
258+ PERF_BR_EXTEND_ABI = 15, /* extend ABI */
258259 PERF_BR_MAX,
259260 };
260261
262+enum {
263+ PERF_BR_NEW_FAULT_ALGN = 0, /* Alignment fault */
264+ PERF_BR_NEW_FAULT_DATA = 1, /* Data fault */
265+ PERF_BR_NEW_FAULT_INST = 2, /* Inst fault */
266+ PERF_BR_NEW_ARCH_1 = 3, /* Architecture specific */
267+ PERF_BR_NEW_ARCH_2 = 4, /* Architecture specific */
268+ PERF_BR_NEW_ARCH_3 = 5, /* Architecture specific */
269+ PERF_BR_NEW_ARCH_4 = 6, /* Architecture specific */
270+ PERF_BR_NEW_ARCH_5 = 7, /* Architecture specific */
271+ PERF_BR_NEW_MAX,
272+};
273+
261274 #define PERF_SAMPLE_BRANCH_PLM_ALL \
262275 (PERF_SAMPLE_BRANCH_USER|\
263276 PERF_SAMPLE_BRANCH_KERNEL|\
@@ -1375,7 +1388,8 @@ struct perf_branch_entry { · 1111 unmodified lines
13751388 abort:1, /* transaction abort */
13761389 cycles:16, /* cycle count to last branch */
13771390 type:4, /* branch type */
1378− reserved:40;
1391+ new_type:4, /* additional branch type */
1392+ reserved:36;
13791393 };
13801394
13811395 union perf_sample_weight {