perf record: Create a new option save_type in --branch-filter
authorJin Yao <yao.jin@linux.intel.com>
Tue, 18 Jul 2017 12:13:11 +0000 (20:13 +0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 19 Jul 2017 02:14:39 +0000 (23:14 -0300)
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>
tools/perf/Documentation/perf-record.txt
tools/perf/util/parse-branch-options.c

index b0e9e921d534c46d79da49fe0641013a64caebb6..9bdea047c5db4f7a03215e974af771fe08e5ec5c 100644 (file)
@@ -332,6 +332,7 @@ following filters are defined:
        - no_tx: only when the target is not in a hardware transaction
        - abort_tx: only when the target is a hardware transaction abort
        - cond: conditional branches
+       - save_type: save branch type during sampling in case binary is not available later
 
 +
 The option requires at least one branch type among any, any_call, any_ret, ind_call, cond.
index 38fd11504015a0753cd738f3a243b0d5d854c5b2..e71fb5f31e84db54672dede30c058eb8fc87129c 100644 (file)
@@ -28,6 +28,7 @@ static const struct branch_mode branch_modes[] = {
        BRANCH_OPT("cond", PERF_SAMPLE_BRANCH_COND),
        BRANCH_OPT("ind_jmp", PERF_SAMPLE_BRANCH_IND_JUMP),
        BRANCH_OPT("call", PERF_SAMPLE_BRANCH_CALL),
+       BRANCH_OPT("save_type", PERF_SAMPLE_BRANCH_TYPE_SAVE),
        BRANCH_END
 };