perf intel-pt: Add support for emulated ptwrite
authorAdrian Hunter <adrian.hunter@intel.com>
Mon, 9 May 2022 15:23:58 +0000 (18:23 +0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 17 May 2022 14:55:49 +0000 (11:55 -0300)
commitd7015e50a9ed180dcc3947635bb2b5711c37f48b
treef16c317f303979c5b3b6c91f6026083d31e5c18d
parentdf36d2572e0515dc190459489c159b78bb3a21fc
perf intel-pt: Add support for emulated ptwrite

ptwrite is an Intel x86 instruction that writes arbitrary values into an
Intel PT trace. It is not supported on all hardware, so provide an
alternative that makes use of TNT packets to convey the payload data.
TNT packets encode Taken/Not-taken conditional branch information, so
taking branches based on the payload value will encode the value into
the TNT packet. Refer to the changes to the documentation file
perf-intel-pt.txt in this patch for an example.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/r/20220509152400.376613-2-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/Documentation/perf-intel-pt.txt
tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
tools/perf/util/intel-pt-decoder/intel-pt-decoder.h
tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c
tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.h
tools/perf/util/intel-pt.c