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

Configure Feed

Select the types of activity you want to include in your feed.

perf intel-pt: Force 'quick' mode when TNT (Taken/Not-Taken packet) is disabled

It is not possible to walk the executable code without TNT packets, so
force 'quick' mode when TNT is disabled, because 'quick' mode does not walk
the code.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: https://lore.kernel.org/r/20220124084201.2699795-18-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
e9240355 11f18e47

+18
+18
tools/perf/util/intel-pt.c
··· 50 50 #define INTEL_PT_CFG_PWR_EVT_EN BIT_ULL(4) 51 51 #define INTEL_PT_CFG_BRANCH_EN BIT_ULL(13) 52 52 #define INTEL_PT_CFG_EVT_EN BIT_ULL(31) 53 + #define INTEL_PT_CFG_TNT_DIS BIT_ULL(55) 53 54 54 55 struct range { 55 56 u64 start; ··· 973 972 return true; 974 973 } 975 974 975 + static bool intel_pt_disabled_tnt(struct intel_pt *pt) 976 + { 977 + struct evsel *evsel; 978 + u64 config; 979 + 980 + evlist__for_each_entry(pt->session->evlist, evsel) { 981 + if (intel_pt_get_config(pt, &evsel->core.attr, &config) && 982 + config & INTEL_PT_CFG_TNT_DIS) 983 + return true; 984 + } 985 + return false; 986 + } 987 + 976 988 static unsigned int intel_pt_mtc_period(struct intel_pt *pt) 977 989 { 978 990 struct evsel *evsel; ··· 1240 1226 params.vm_tm_corr_dry_run = pt->synth_opts.vm_tm_corr_dry_run; 1241 1227 params.first_timestamp = pt->first_timestamp; 1242 1228 params.max_loops = pt->max_loops; 1229 + 1230 + /* Cannot walk code without TNT, so force 'quick' mode */ 1231 + if (params.branch_enable && intel_pt_disabled_tnt(pt) && !params.quick) 1232 + params.quick = 1; 1243 1233 1244 1234 if (pt->filts.cnt > 0) 1245 1235 params.pgd_ip = intel_pt_pgd_ip;