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

perf intel-pt: Add default config for pass-through branch enable

Branch tracing is enabled by default, so a fake config bit called 'pt'
(pass-through) was added to allow the 'branch enable' bit to have affect.
Add default config 'pt,branch' which will allow users to disable branch
tracing using 'branch=0' instead of having to specify 'pt,branch=0'.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Link: http://lkml.kernel.org/r/1495786658-18063-12-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Adrian Hunter and committed by
Arnaldo Carvalho de Melo
9fd629f9 83959817

+5
+5
tools/perf/arch/x86/util/intel-pt.c
··· 192 192 int psb_cyc, psb_periods, psb_period; 193 193 int pos = 0; 194 194 u64 config; 195 + char c; 195 196 196 197 pos += scnprintf(buf + pos, sizeof(buf) - pos, "tsc"); 197 198 ··· 225 224 ",psb_period=%d", psb_period); 226 225 } 227 226 } 227 + 228 + if (perf_pmu__scan_file(intel_pt_pmu, "format/pt", "%c", &c) == 1 && 229 + perf_pmu__scan_file(intel_pt_pmu, "format/branch", "%c", &c) == 1) 230 + pos += scnprintf(buf + pos, sizeof(buf) - pos, ",pt,branch"); 228 231 229 232 pr_debug2("%s default config: %s\n", intel_pt_pmu->name, buf); 230 233