Skip to content

perf tools: Add Intel PT support for jitdump

Adrian Hunter lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8perf inject: Hit all DSOs for AUX data in JIT and other casestools/perf/builtin-inject.c+8 -40 replies
2/8perf session: Simplify tool stubstools/perf/util/session.c+7 -331 reply
3/8perf tools: Add time conversion eventtools/perf/arch/x86/util/tsc.c tools/perf/builtin-inject.c tools/perf/builtin-record.c +6 more+75 -03 replies
4/8perf jit: Let jit_process() return errorstools/perf/builtin-inject.c tools/perf/util/jitdump.c+16 -60 replies
5/8perf jit: Move clockid validationtools/perf/builtin-inject.c tools/perf/util/jitdump.c+23 -241 reply
6/8perf jit: Add support for using TSC as a timestamptools/perf/jvmti/jvmti_agent.c tools/perf/util/jitdump.c tools/perf/util/jitdump.h+76 -71 reply
7/8perf intel-pt/bts: Define JITDUMP_USE_ARCH_TIMESTAMPtools/perf/arch/x86/util/intel-bts.c tools/perf/arch/x86/util/intel-pt.c+10 -01 reply
8/8perf tools: Use 64-bit shifts with (TSC) time conversiontools/perf/arch/x86/tests/rdpmc.c tools/perf/util/tsc.c+2 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/8] perf tools: Add Intel PT support for jitdump

Hi

In order to use Intel PT with jitdump, changes are needed because Intel PT uses TSC as a timestamp not the monotonic clock.

These patches enable TSC to be used which allows the following using a simple HelloWorld java app:

perf record -e intel_pt//u -o java.perf.data java -agentpath:/home/ahunter/git/linux-perf/tools/perf/jvmti/libjvmti.so HelloWorldApp

perf inject -i java.perf.data --jit -o java.perf.data.jitted

perf report -i java.perf.data.jitted

perf script -i java.perf.data.jitted | less

Note, there will be some decoder errors because not all the generated code is reported to the agent.

Lazily, there is also an unrelated patch:

perf tools: Use 64-bit shifts with (TSC) time conversion"

Adrian Hunter (8):
perf inject: Hit all DSOs for AUX data in JIT and other cases perf session: Simplify tool stubs
perf tools: Add time conversion event
perf jit: Let jit_process() return errors
perf jit: Move clockid validation
perf jit: Add support for using TSC as a timestamp perf intel-pt/bts: Define JITDUMP_USE_ARCH_TIMESTAMP perf tools: Use 64-bit shifts with (TSC) time conversion

 tools/perf/arch/x86/tests/rdpmc.c    |  2 +-
 tools/perf/arch/x86/util/intel-bts.c |  5 +++
 tools/perf/arch/x86/util/intel-pt.c  |  5 +++
 tools/perf/arch/x86/util/tsc.c       | 31 +++++++++++++++++
 tools/perf/builtin-inject.c          | 53 ++++++++++++-----------------
 tools/perf/builtin-record.c          | 15 +++++++++
 tools/perf/jvmti/jvmti_agent.c       | 43 ++++++++++++++++++++++--
 tools/perf/util/event.c              |  1 +
 tools/perf/util/event.h              |  9 +++++
 tools/perf/util/jitdump.c            | 64 ++++++++++++++++++++++++++++++++----
 tools/perf/util/jitdump.h            |  3 ++
 tools/perf/util/session.c            | 46 ++++++++------------------
 tools/perf/util/session.h            |  1 +
 tools/perf/util/tool.h               |  1 +
 tools/perf/util/tsc.c                |  2 +-
 tools/perf/util/tsc.h                | 10 ++++++
 16 files changed, 216 insertions(+), 75 deletions(-)

Regards
Adrian