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

perf record: Create a new option save_type in --branch-filter

The option indicates the kernel to save branch type during sampling.

One example:

perf record -g --branch-filter any,save_type <command>

Signed-off-by: Yao Jin <yao.jin@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1500379995-6449-4-git-send-email-yao.jin@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Jin Yao and committed by
Arnaldo Carvalho de Melo
60f83fa6 d5c7f9dc

+2
+1
tools/perf/Documentation/perf-record.txt
··· 332 332 - no_tx: only when the target is not in a hardware transaction 333 333 - abort_tx: only when the target is a hardware transaction abort 334 334 - cond: conditional branches 335 + - save_type: save branch type during sampling in case binary is not available later 335 336 336 337 + 337 338 The option requires at least one branch type among any, any_call, any_ret, ind_call, cond.
+1
tools/perf/util/parse-branch-options.c
··· 28 28 BRANCH_OPT("cond", PERF_SAMPLE_BRANCH_COND), 29 29 BRANCH_OPT("ind_jmp", PERF_SAMPLE_BRANCH_IND_JUMP), 30 30 BRANCH_OPT("call", PERF_SAMPLE_BRANCH_CALL), 31 + BRANCH_OPT("save_type", PERF_SAMPLE_BRANCH_TYPE_SAVE), 31 32 BRANCH_END 32 33 }; 33 34