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
255 PERF_BR_IRQ = 12, /* irq */255 PERF_BR_IRQ = 12, /* irq */
256 PERF_BR_SERROR = 13, /* system error */256 PERF_BR_SERROR = 13, /* system error */
257 PERF_BR_NO_TX = 14, /* not in transaction */257 PERF_BR_NO_TX = 14, /* not in transaction */
258 PERF_BR_EXTEND_ABI = 15, /* extend ABI */
258 PERF_BR_MAX,259 PERF_BR_MAX,
259};260};
260 261
262enum {
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
261#define PERF_SAMPLE_BRANCH_PLM_ALL \274#define PERF_SAMPLE_BRANCH_PLM_ALL \
262 (PERF_SAMPLE_BRANCH_USER|\275 (PERF_SAMPLE_BRANCH_USER|\
263 PERF_SAMPLE_BRANCH_KERNEL|\276 PERF_SAMPLE_BRANCH_KERNEL|\
@@ -1375,7 +1388,8 @@ struct perf_branch_entry { · 1111 unmodified lines
1375 abort:1, /* transaction abort */1388 abort:1, /* transaction abort */
1376 cycles:16, /* cycle count to last branch */1389 cycles:16, /* cycle count to last branch */
1377 type:4, /* branch type */1390 type:4, /* branch type */
1378 reserved:40;1391 new_type:4, /* additional branch type */
1392 reserved:36;
1379};1393};
1380 1394
1381union perf_sample_weight {1395union perf_sample_weight {