提交 e9240355 编写于 作者: A Adrian Hunter 提交者: Arnaldo Carvalho de Melo

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: NAdrian 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.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 11f18e47
......@@ -50,6 +50,7 @@
#define INTEL_PT_CFG_PWR_EVT_EN BIT_ULL(4)
#define INTEL_PT_CFG_BRANCH_EN BIT_ULL(13)
#define INTEL_PT_CFG_EVT_EN BIT_ULL(31)
#define INTEL_PT_CFG_TNT_DIS BIT_ULL(55)
struct range {
u64 start;
......@@ -972,6 +973,19 @@ static bool intel_pt_branch_enable(struct intel_pt *pt)
return true;
}
static bool intel_pt_disabled_tnt(struct intel_pt *pt)
{
struct evsel *evsel;
u64 config;
evlist__for_each_entry(pt->session->evlist, evsel) {
if (intel_pt_get_config(pt, &evsel->core.attr, &config) &&
config & INTEL_PT_CFG_TNT_DIS)
return true;
}
return false;
}
static unsigned int intel_pt_mtc_period(struct intel_pt *pt)
{
struct evsel *evsel;
......@@ -1227,6 +1241,10 @@ static struct intel_pt_queue *intel_pt_alloc_queue(struct intel_pt *pt,
params.first_timestamp = pt->first_timestamp;
params.max_loops = pt->max_loops;
/* Cannot walk code without TNT, so force 'quick' mode */
if (params.branch_enable && intel_pt_disabled_tnt(pt) && !params.quick)
params.quick = 1;
if (pt->filts.cnt > 0)
params.pgd_ip = intel_pt_pgd_ip;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册