Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf record: Add remaining branch filters: "no_cycles", "no_flags" & "hw_index"

This adds all remaining branch filters i.e "no_cycles", "no_flags" and
"hw_index". While here, also updates the documentation.

Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: James Clark <james.clark@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lore.kernel.org/lkml/20221205064443.533587-1-anshuman.khandual@arm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Anshuman Khandual and committed by
Arnaldo Carvalho de Melo
955f6def 3c97d25c

+8
+5
tools/perf/Documentation/perf-record.txt
··· 388 388 - any_call: any function call or system call 389 389 - any_ret: any function return or system call return 390 390 - ind_call: any indirect branch 391 + - ind_jmp: any indirect jump 391 392 - call: direct calls, including far (to/from kernel) calls 392 393 - u: only when the branch target is at the user level 393 394 - k: only when the branch target is in the kernel ··· 397 396 - no_tx: only when the target is not in a hardware transaction 398 397 - abort_tx: only when the target is a hardware transaction abort 399 398 - cond: conditional branches 399 + - call_stack: save call stack 400 + - no_flags: don't save branch flags e.g prediction, misprediction etc 401 + - no_cycles: don't save branch cycles 402 + - hw_index: save branch hardware index 400 403 - save_type: save branch type during sampling in case binary is not available later 401 404 For the platforms with Intel Arch LBR support (12th-Gen+ client or 402 405 4th-Gen Xeon+ server), the save branch type is unconditionally enabled
+3
tools/perf/util/parse-branch-options.c
··· 30 30 BRANCH_OPT("cond", PERF_SAMPLE_BRANCH_COND), 31 31 BRANCH_OPT("ind_jmp", PERF_SAMPLE_BRANCH_IND_JUMP), 32 32 BRANCH_OPT("call", PERF_SAMPLE_BRANCH_CALL), 33 + BRANCH_OPT("no_flags", PERF_SAMPLE_BRANCH_NO_FLAGS), 34 + BRANCH_OPT("no_cycles", PERF_SAMPLE_BRANCH_NO_CYCLES), 33 35 BRANCH_OPT("save_type", PERF_SAMPLE_BRANCH_TYPE_SAVE), 34 36 BRANCH_OPT("stack", PERF_SAMPLE_BRANCH_CALL_STACK), 37 + BRANCH_OPT("hw_index", PERF_SAMPLE_BRANCH_HW_INDEX), 35 38 BRANCH_OPT("priv", PERF_SAMPLE_BRANCH_PRIV_SAVE), 36 39 BRANCH_END 37 40 };