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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:39:33 +0000 (09:39 +0100)
commitbb0a6b5bcebfae85a4551142246c83f52aa6ef2e
tree59014d4a03996cfb3ed9dace60f96523cf1a9106
parent6d60fdc1e6a15204d6c89e5bb53ce0742d38abfe
perf intel-pt: Add support for emulated ptwrite

[ Upstream commit d7015e50a9ed180dcc3947635bb2b5711c37f48b ]

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>
Stable-dep-of: aeb802f872a7 ("perf intel-pt: Do not try to queue auxtrace data on pipe")
Signed-off-by: Sasha Levin <sashal@kernel.org>
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