Skip to content

perf intel-pt: Add perf event clocks to better support VM tracing

Adrian Hunter kvm lkml 3 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest10 patches 0 repliesNew
  2. v211 patches 26 repliesSuperseded
  3. v111 patches 5 repliesSuperseded

Changes in V2 from the cover letter

perf/x86: Fix native_perf_sched_clock_from_tsc() with __sched_clock_offset
Add __sched_clock_offset unconditionally

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10perf/x86: Fix native_perf_sched_clock_from_tsc() with __sched_clock_offsetarch/x86/kernel/tsc.c+1 -10 replies
2/10perf/x86: Add support for TSC as a perf event clockarch/x86/events/core.c arch/x86/include/asm/perf_event.h include/uapi/linux/time.h +1 more+35 -00 replies
3/10perf/x86: Add support for TSC in nanoseconds as a perf event clockarch/x86/events/core.c arch/x86/include/asm/perf_event.h include/uapi/linux/time.h +1 more+40 -130 replies
4/10perf tools: Add new perf clock IDstools/perf/Documentation/perf-record.txt tools/perf/builtin-record.c tools/perf/util/clockid.c +1 more+24 -20 replies
5/10perf tools: Add API probes for new clock IDstools/perf/util/perf_api_probe.c tools/perf/util/perf_api_probe.h+25 -00 replies
6/10perf tools: Add new clock IDs to "perf time to TSC" testtools/perf/tests/perf-time-to-tsc.c+33 -90 replies
7/10perf tools: Add perf_read_tsc_conv_for_clockid()tools/perf/util/tsc.c tools/perf/util/tsc.h+57 -00 replies
8/10perf intel-pt: Add support for new clock IDstools/perf/arch/x86/util/intel-pt.c tools/perf/util/intel-pt.c tools/perf/util/intel-pt.h+55 -80 replies
9/10perf intel-pt: Add config variables for timing parameterstools/perf/Documentation/perf-config.txt tools/perf/arch/x86/util/intel-pt.c tools/perf/util/intel-pt.c +1 more+79 -20 replies
10/10perf intel-pt: Add documentation for new clock IDstools/perf/Documentation/perf-intel-pt.txt+45 -00 replies

Reviews trailers per patch

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

Read the v3 thread

Cover letter [PATCH V3 00/10] perf intel-pt: Add perf event clocks to better support VM tracing

Hi

Here is V3.

These patches add 2 new perf event clocks based on TSC for use with VMs.

The first patch is a minor fix, the next 2 patches add each of the 2 new clocks. The remaining patches add minimal tools support and are based on top of the Intel PT Event Trace tools' patches.

The future work, to add the ability to use perf inject to inject perf events from a VM guest perf.data file into a VM host perf.data file, has yet to be implemented.

Changes in V3:

perf/x86: Add support for TSC as a perf event clock perf/x86: Add support for TSC in nanoseconds as a perf event clock
Drop magic flag for non-standard clock ids
Move new clockids into clock.h
Adjust comments to warn about new clocks

perf tools: Add new perf clock IDs
perf tools: Add API probes for new clock IDs perf tools: Add new clock IDs to "perf time to TSC" test perf tools: Add perf_read_tsc_conv_for_clockid() perf intel-pt: Add support for new clock IDs perf intel-pt: Add config variables for timing parameters perf intel-pt: Add documentation for new clock IDs
Drop magic flag for non-standard clock ids Adjust documentation to warn about new clocks

perf intel-pt: Use CLOCK_PERF_HW_CLOCK_NS by default
Dropped patch

Changes in V2:
perf/x86: Fix native_perf_sched_clock_from_tsc() with __sched_clock_offset
Add __sched_clock_offset unconditionally

perf/x86: Add support for TSC as a perf event clock
Use an attribute bit 'ns_clockid' to identify non-standard clockids

perf/x86: Add support for TSC in nanoseconds as a perf event clock
Do not affect use of __sched_clock_offset
Adjust to use 'ns_clockid'

perf tools: Add new perf clock IDs
perf tools: Add API probes for new clock IDs perf tools: Add new clock IDs to "perf time to TSC" test perf tools: Add perf_read_tsc_conv_for_clockid() perf intel-pt: Add support for new clock IDs perf intel-pt: Use CLOCK_PERF_HW_CLOCK_NS by default perf intel-pt: Add config variables for timing parameters perf intel-pt: Add documentation for new clock IDs
Adjust to use 'ns_clockid'

Adrian Hunter (10):
perf/x86: Fix native_perf_sched_clock_from_tsc() with __sched_clock_offset perf/x86: Add support for TSC as a perf event clock
perf/x86: Add support for TSC in nanoseconds as a perf event clock perf tools: Add new perf clock IDs
perf tools: Add API probes for new clock IDs
perf tools: Add new clock IDs to "perf time to TSC" test
perf tools: Add perf_read_tsc_conv_for_clockid()
perf intel-pt: Add support for new clock IDs
perf intel-pt: Add config variables for timing parameters perf intel-pt: Add documentation for new clock IDs

 arch/x86/events/core.c                     | 39 +++++++++++--
 arch/x86/include/asm/perf_event.h          |  5 ++
 arch/x86/kernel/tsc.c                      |  2 +-
 include/uapi/linux/time.h                  | 17 ++++++
 kernel/events/core.c                       | 13 +++++
 tools/perf/Documentation/perf-config.txt   | 18 ++++++
 tools/perf/Documentation/perf-intel-pt.txt | 45 +++++++++++++++
 tools/perf/Documentation/perf-record.txt   | 11 +++-
 tools/perf/arch/x86/util/intel-pt.c        | 89 ++++++++++++++++++++++++++++--
 tools/perf/builtin-record.c                |  2 +-
 tools/perf/tests/perf-time-to-tsc.c        | 42 +++++++++++---
 tools/perf/util/clockid.c                  |  5 ++
 tools/perf/util/clockid.h                  |  8 +++
 tools/perf/util/intel-pt.c                 | 30 ++++++++--
 tools/perf/util/intel-pt.h                 |  7 ++-
 tools/perf/util/perf_api_probe.c           | 23 ++++++++
 tools/perf/util/perf_api_probe.h           |  2 +
 tools/perf/util/tsc.c                      | 56 +++++++++++++++++++
 tools/perf/util/tsc.h                      |  1 +
 19 files changed, 387 insertions(+), 28 deletions(-)

Regards
Adrian