Skip to content

Commit

Permalink
perf intel-pt: Use itrace error flags to suppress some errors
Browse files Browse the repository at this point in the history
The itrace "e" option may be followed by flags which affect what errors
will or will not be reported.  Each flag must be preceded by either '+' or '-'.
The flags supported by Intel PT are:

		-o	Suppress overflow errors
		-l	Suppress trace data lost errors
For example, for errors but not overflow or data lost errors:

	--itrace=e-o-l

Suppressing those errors can be useful for testing and debugging because
they are not due to decoding.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lore.kernel.org/lkml/20200710151104.15137-7-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Adrian Hunter authored and Arnaldo Carvalho de Melo committed Aug 6, 2020
1 parent cb97143 commit 1d846ae
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tools/perf/Documentation/perf-intel-pt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,14 @@ Developer Manuals.

Error events show where the decoder lost the trace. Error events
are quite important. Users must know if what they are seeing is a complete
picture or not.
picture or not. The "e" option may be followed by flags which affect what errors
will or will not be reported. Each flag must be preceded by either '+' or '-'.
The flags supported by Intel PT are:
-o Suppress overflow errors
-l Suppress trace data lost errors
For example, for errors but not overflow or data lost errors:

--itrace=e-o-l

The "d" option will cause the creation of a file "intel_pt.log" containing all
decoded packets and instructions. Note that this option slows down the decoder
Expand Down
9 changes: 9 additions & 0 deletions tools/perf/util/intel-pt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1863,6 +1863,15 @@ static int intel_pt_synth_error(struct intel_pt *pt, int code, int cpu,
char msg[MAX_AUXTRACE_ERROR_MSG];
int err;

if (pt->synth_opts.error_minus_flags) {
if (code == INTEL_PT_ERR_OVR &&
pt->synth_opts.error_minus_flags & AUXTRACE_ERR_FLG_OVERFLOW)
return 0;
if (code == INTEL_PT_ERR_LOST &&
pt->synth_opts.error_minus_flags & AUXTRACE_ERR_FLG_DATA_LOST)
return 0;
}

intel_pt__strerror(code, msg, MAX_AUXTRACE_ERROR_MSG);

auxtrace_synth_error(&event.auxtrace_error, PERF_AUXTRACE_ERROR_ITRACE,
Expand Down

0 comments on commit 1d846ae

Please sign in to comment.