Commit f2be829e authored by Adrian Hunter's avatar Adrian Hunter Committed by Arnaldo Carvalho de Melo

perf intel-pt: Record Event Trace capability flag

The change to the MODE.Exec packet means processing must distinguish
between the old and new cases. Record the Event Trace capability flag to
make that possible.
Signed-off-by: default avatarAdrian 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-14-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 8ee9a9ab
...@@ -306,6 +306,7 @@ intel_pt_info_priv_size(struct auxtrace_record *itr, struct evlist *evlist) ...@@ -306,6 +306,7 @@ intel_pt_info_priv_size(struct auxtrace_record *itr, struct evlist *evlist)
ptr->priv_size = (INTEL_PT_AUXTRACE_PRIV_MAX * sizeof(u64)) + ptr->priv_size = (INTEL_PT_AUXTRACE_PRIV_MAX * sizeof(u64)) +
intel_pt_filter_bytes(filter); intel_pt_filter_bytes(filter);
ptr->priv_size += sizeof(u64); /* Cap Event Trace */
return ptr->priv_size; return ptr->priv_size;
} }
...@@ -335,6 +336,7 @@ static int intel_pt_info_fill(struct auxtrace_record *itr, ...@@ -335,6 +336,7 @@ static int intel_pt_info_fill(struct auxtrace_record *itr,
unsigned long max_non_turbo_ratio; unsigned long max_non_turbo_ratio;
size_t filter_str_len; size_t filter_str_len;
const char *filter; const char *filter;
int event_trace;
__u64 *info; __u64 *info;
int err; int err;
...@@ -357,6 +359,9 @@ static int intel_pt_info_fill(struct auxtrace_record *itr, ...@@ -357,6 +359,9 @@ static int intel_pt_info_fill(struct auxtrace_record *itr,
if (perf_pmu__scan_file(intel_pt_pmu, "max_nonturbo_ratio", if (perf_pmu__scan_file(intel_pt_pmu, "max_nonturbo_ratio",
"%lu", &max_non_turbo_ratio) != 1) "%lu", &max_non_turbo_ratio) != 1)
max_non_turbo_ratio = 0; max_non_turbo_ratio = 0;
if (perf_pmu__scan_file(intel_pt_pmu, "caps/event_trace",
"%d", &event_trace) != 1)
event_trace = 0;
filter = intel_pt_find_filter(session->evlist, ptr->intel_pt_pmu); filter = intel_pt_find_filter(session->evlist, ptr->intel_pt_pmu);
filter_str_len = filter ? strlen(filter) : 0; filter_str_len = filter ? strlen(filter) : 0;
...@@ -407,6 +412,8 @@ static int intel_pt_info_fill(struct auxtrace_record *itr, ...@@ -407,6 +412,8 @@ static int intel_pt_info_fill(struct auxtrace_record *itr,
info += len >> 3; info += len >> 3;
} }
*info++ = event_trace;
return 0; return 0;
} }
......
...@@ -75,6 +75,7 @@ struct intel_pt { ...@@ -75,6 +75,7 @@ struct intel_pt {
bool mispred_all; bool mispred_all;
bool use_thread_stack; bool use_thread_stack;
bool callstack; bool callstack;
bool cap_event_trace;
unsigned int br_stack_sz; unsigned int br_stack_sz;
unsigned int br_stack_sz_plus; unsigned int br_stack_sz_plus;
int have_sched_switch; int have_sched_switch;
...@@ -3795,7 +3796,7 @@ int intel_pt_process_auxtrace_info(union perf_event *event, ...@@ -3795,7 +3796,7 @@ int intel_pt_process_auxtrace_info(union perf_event *event,
} }
info = &auxtrace_info->priv[INTEL_PT_FILTER_STR_LEN] + 1; info = &auxtrace_info->priv[INTEL_PT_FILTER_STR_LEN] + 1;
info_end = (void *)info + auxtrace_info->header.size; info_end = (void *)auxtrace_info + auxtrace_info->header.size;
if (intel_pt_has(auxtrace_info, INTEL_PT_FILTER_STR_LEN)) { if (intel_pt_has(auxtrace_info, INTEL_PT_FILTER_STR_LEN)) {
size_t len; size_t len;
...@@ -3834,6 +3835,13 @@ int intel_pt_process_auxtrace_info(union perf_event *event, ...@@ -3834,6 +3835,13 @@ int intel_pt_process_auxtrace_info(union perf_event *event,
intel_pt_print_info_str("Filter string", pt->filter); intel_pt_print_info_str("Filter string", pt->filter);
} }
if ((void *)info < info_end) {
pt->cap_event_trace = *info++;
if (dump_trace)
fprintf(stdout, " Cap Event Trace %d\n",
pt->cap_event_trace);
}
pt->timeless_decoding = intel_pt_timeless_decoding(pt); pt->timeless_decoding = intel_pt_timeless_decoding(pt);
if (pt->timeless_decoding && !pt->tc.time_mult) if (pt->timeless_decoding && !pt->tc.time_mult)
pt->tc.time_mult = 1; pt->tc.time_mult = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment