Skip to content

perf intel-pt: Add limited support for tracing guest kernels

Adrian Hunter lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest11 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11perf script: Add branch types for VM-Entry and VM-Exittools/perf/builtin-script.c tools/perf/util/db-export.c tools/perf/util/event.h+9 -10 replies
2/11perf intel_pt: Add vmlaunch and vmresume as branchestools/perf/arch/x86/tests/insn-x86.c tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.h+17 -00 replies
3/11perf intel-pt: Retain the last PIP packet payload as istools/perf/arch/x86/tests/intel-pt-pkt-decoder-test.c tools/perf/util/intel-pt-decoder/intel-pt-decoder.c tools/perf/util/intel-pt-decoder/intel-pt-decoder.h +2 more+16 -180 replies
4/11perf intel-pt: Amend decoder to track the NR flagtools/perf/util/intel-pt-decoder/intel-pt-decoder.c tools/perf/util/intel-pt-decoder/intel-pt-decoder.h+53 -90 replies
5/11perf machine: Factor out machines__find_guest()tools/perf/util/machine.c tools/perf/util/machine.h tools/perf/util/session.c+11 -60 replies
6/11perf machine: Factor out machine__idle_thread()tools/perf/util/machine.c tools/perf/util/machine.h tools/perf/util/session.c+22 -220 replies
7/11perf intel-pt: Support decoding of guest kerneltools/perf/util/intel-pt.c+69 -120 replies
8/11perf intel-pt: Allow for a guest kernel address filtertools/perf/util/intel-pt.c+7 -10 replies
9/11perf intel-pt: Adjust sample flags for VM-Exittools/perf/util/intel-pt.c+7 -40 replies
10/11perf intel-pt: Split VM-Entry and VM-Exit branchestools/perf/util/intel-pt.c+21 -10 replies
11/11perf intel-pt: Add documentation for tracing virtual machinestools/perf/Documentation/perf-intel-pt.txt+82 -00 replies

Reviews trailers per patch

None of the 11 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchAndi Kleen
SeriesA-b
1/11
2/11
3/11
4/11
5/11
6/11
7/11
8/11
9/11
10/11
11/11

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [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