Skip to content

perf: introduce model specific events and AMD IBS

Robert Richter lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest12 patches 34 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12perf, x86: move perfctr init code to x86_setup_perfctr()arch/x86/kernel/cpu/perf_event.c+14 -61 reply
2/12perf, x86: moving x86_setup_perfctr()arch/x86/kernel/cpu/perf_event.c+59 -611 reply
3/12perf, x86: call x86_setup_perfctr() from .hw_config()arch/x86/kernel/cpu/perf_event.c arch/x86/kernel/cpu/perf_event_p4.c+3 -81 reply
4/12perf: introduce flag for model specific eventsarch/powerpc/kernel/perf_event.c arch/sh/kernel/perf_event.c arch/sparc/kernel/perf_event.c +2 more+14 -10 replies
5/12perf, x86: pass enable bit mask to __x86_pmu_enable_event()arch/x86/kernel/cpu/perf_event.c arch/x86/kernel/cpu/perf_event_intel.c+8 -61 reply
6/12perf, x86: use weight instead of cmask in for_each_event_constraint()arch/x86/kernel/cpu/perf_event.c+1 -11 reply
7/12perf, x86: introduce bit range for special pmu eventsarch/x86/include/asm/perf_event.h arch/x86/kernel/cpu/perf_event.c arch/x86/kernel/cpu/perf_event_intel.c +1 more+12 -110 replies
8/12perf, x86: modify some code to allow the introduction of ibs eventsarch/x86/kernel/cpu/perf_event.c+9 -90 replies
9/12perf, x86: implement IBS feature detectionarch/x86/kernel/cpu/perf_event.c arch/x86/kernel/cpu/perf_event_amd.c+7 -00 replies
10/12perf, x86: setup NMI handler for IBSarch/x86/kernel/cpu/perf_event.c arch/x86/kernel/cpu/perf_event_amd.c+97 -03 replies
11/12perf, x86: implement AMD IBS event configurationarch/x86/include/asm/perf_event.h arch/x86/kernel/cpu/perf_event.c arch/x86/kernel/cpu/perf_event_amd.c+179 -611 replies
12/12perf, x86: implement the ibs interrupt handlerarch/x86/include/asm/msr-index.h arch/x86/kernel/cpu/perf_event_amd.c+67 -111 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 00/12] perf: introduce model specific events and AMD IBS

This patch series introduces model specific events and impments AMD IBS (Instruction Based Sampling) for perf_events.

IBS is documented here:

BIOS and Kernel Developer’s Guide (BKDG) For AMD Family 10h Processors
http://support.amd.com/us/Processor_TechDocs/31116.pdf

AMD64 Architecture Programmer’s Manual Volume 2: System Programming
http://support.amd.com/us/Processor_TechDocs/24593.pdf

The general approach is to introduce a flag to mark an event as model specific. With that flag set a model specific ibs (raw) config value can be passed to the pmu for setup. When there are ibs samples available, it is sent back as a raw data sample to the userland. So we have a raw config value and raw sampling data. This requires the userland to setup ibs and further extract and process sampling data.

Patches 1-8 rework and refactor the code to prepare the ibs implementation. This is done in patches 9-12.

I will add ibs example code to libpfm4.

-Robert