Skip to content

perf/x86: Add ability to sample TSC

Adrian Hunter lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 2 repliesIn review
  2. v12 patches 11 repliesSuperseded

Changes in v2 from the cover letter

perf: Sample additional clock value
Rename "Architecture specific clock" to "Processor trace clock"
Rename PERF_SAMPLE_CLOCK_ARCH -> PERF_SAMPLE_CLOCK_PT etc Expand commit message

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2perf: Sample additional clock valueinclude/linux/perf_event.h include/uapi/linux/perf_event.h kernel/events/core.c +1 more+53 -32 replies
2/2perf/x86: Provide TSC for PERF_SAMPLE_CLOCK_PTarch/x86/include/asm/perf_event.h arch/x86/kernel/cpu/perf_event.c+16 -00 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by.

PatchPawel Moll
1/2Based-on-patch-by
2/2

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

Read the v2 thread

Cover letter [PATCH V2 0/2] perf/x86: Add ability to sample TSC

Hi

TSC is needed to synchronize Intel Processor Trace (Intel PT) with perf event samples. Refer to patch 1 for more details.

There is a description of Intel PT in the Intel Architecture manuals:

http://www.intel.com/content/www/us/en/processors/architectures-software-developer-manuals.html

With the advent of switching perf_clock to CLOCK_MONOTONIC, it will not be possible to convert perf_clock directly to/from TSC. So add the ability to sample TSC instead.

Changes in V2:
perf: Sample additional clock value
Rename "Architecture specific clock" to "Processor trace clock"
Rename PERF_SAMPLE_CLOCK_ARCH -> PERF_SAMPLE_CLOCK_PT etc Expand commit message

perf/x86: Provide TSC for PERF_SAMPLE_CLOCK_PT
Rename PERF_SAMPLE_CLOCK_ARCH -> PERF_SAMPLE_CLOCK_PT etc Expand commit message

Adrian Hunter (2):
perf: Sample additional clock value perf/x86: Provide TSC for PERF_SAMPLE_CLOCK_PT

 arch/x86/include/asm/perf_event.h |  6 ++++++
 arch/x86/kernel/cpu/perf_event.c  | 10 ++++++++++
 include/linux/perf_event.h        |  3 ++-
 include/uapi/linux/perf_event.h   | 19 +++++++++++++++++--
 kernel/events/core.c              | 30 ++++++++++++++++++++++++++++++
 kernel/events/internal.h          |  4 ++++
 6 files changed, 69 insertions(+), 3 deletions(-)

Regards
Adrian