2021-02-18 11:47:08

by Adrian Hunter

[permalink] [raw]
Subject: [PATCH 00/11] perf intel-pt: Add limited support for tracing guest kernels

Hi

Currently, only kernel tracing is supported and only with "timeless" decoding
i.e. no TSC timestamps

Other limitations and caveats

VMX controls may suppress packets needed for decoding resulting in decoding errors
VMX controls may block the perf NMI to the host potentially resulting in lost trace data
Guest kernel self-modifying code (e.g. jump labels or JIT-compiled eBPF) will result in decoding errors
Guest thread information is unknown
Guest VCPU is unknown but may be able to be inferred from the host thread
Callchains are not supported

There is an example in the documentation of patch
"perf intel-pt: Add documentation for tracing virtual machines"

The patches are on top of the "Add PSB events" series.


Adrian Hunter (11):
perf script: Add branch types for VM-Entry and VM-Exit
perf intel_pt: Add vmlaunch and vmresume as branches
perf intel-pt: Retain the last PIP packet payload as is
perf intel-pt: Amend decoder to track the NR flag
perf machine: Factor out machines__find_guest()
perf machine: Factor out machine__idle_thread()
perf intel-pt: Support decoding of guest kernel
perf intel-pt: Allow for a guest kernel address filter
perf intel-pt: Adjust sample flags for VM-Exit
perf intel-pt: Split VM-Entry and VM-Exit branches
perf intel-pt: Add documentation for tracing virtual machines

tools/perf/Documentation/perf-intel-pt.txt | 82 ++++++++++++++
tools/perf/arch/x86/tests/insn-x86.c | 1 +
.../arch/x86/tests/intel-pt-pkt-decoder-test.c | 4 +-
tools/perf/builtin-script.c | 2 +
tools/perf/util/db-export.c | 2 +
tools/perf/util/event.h | 6 +-
.../perf/util/intel-pt-decoder/intel-pt-decoder.c | 61 +++++++++--
.../perf/util/intel-pt-decoder/intel-pt-decoder.h | 3 +-
.../util/intel-pt-decoder/intel-pt-insn-decoder.c | 15 +++
.../util/intel-pt-decoder/intel-pt-insn-decoder.h | 1 +
.../util/intel-pt-decoder/intel-pt-pkt-decoder.c | 12 +-
.../util/intel-pt-decoder/intel-pt-pkt-decoder.h | 2 +
tools/perf/util/intel-pt.c | 122 ++++++++++++++++++---
tools/perf/util/machine.c | 27 +++++
tools/perf/util/machine.h | 2 +
tools/perf/util/session.c | 32 +-----
16 files changed, 307 insertions(+), 67 deletions(-)


Regards
Adrian


2021-02-18 19:25:55

by Andi Kleen

[permalink] [raw]
Subject: Re: [PATCH 00/11] perf intel-pt: Add limited support for tracing guest kernels

On Thu, Feb 18, 2021 at 11:57:50AM +0200, Adrian Hunter wrote:
> Hi
>
> Currently, only kernel tracing is supported and only with "timeless" decoding
> i.e. no TSC timestamps

Patches look good to me. That will be quite useful.

Acked-by: Andi Kleen <[email protected]>

Thanks,
-Andi