Skip to content

oprofile, perf, x86: introduce new functions to reserve perfctrs

Robert Richter lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9perf, x86: reduce number of CONFIG_X86_LOCAL_APIC macrosarch/x86/kernel/cpu/perf_event.c+9 -60 replies
2/9oprofile, perf, x86: do not allocate evntsel counter msrarch/x86/kernel/cpu/perf_event.c arch/x86/kernel/cpu/perfctr-watchdog.c arch/x86/kernel/tsc.c +2 more+5 -400 replies
3/9oprofile, perf, x86: introduce new functions to reserve perfctrs by indexarch/x86/include/asm/nmi.h arch/x86/kernel/cpu/perfctr-watchdog.c arch/x86/oprofile/op_model_amd.c +1 more+26 -133 replies
4/9tsc, x86: use new perfctr reservation functions in tsc codearch/x86/kernel/tsc.c+2 -40 replies
5/9perf, x86: use new perfctr reservation functions in perf codearch/x86/kernel/cpu/perf_event.c+3 -30 replies
6/9oprofile/x86: rework error handler in nmi_setup()arch/x86/oprofile/nmi_int.c+19 -140 replies
7/9oprofile/x86: return -EBUSY if counters are already reservedarch/x86/oprofile/nmi_int.c arch/x86/oprofile/op_model_amd.c arch/x86/oprofile/op_model_p4.c +2 more+37 -50 replies
8/9oprofile/x86: group IBS codearch/x86/oprofile/op_model_amd.c+101 -1010 replies
9/9oprofile/x86: implement perfctr reservation for IBSarch/x86/include/asm/perf_event.h arch/x86/oprofile/op_model_amd.c+74 -330 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/9] oprofile, perf, x86: introduce new functions to reserve perfctrs

This patch set improves the perfctr reservation code. New functions are available to reserve a counter by its index only. It is no longer necessary to allocate both msrs of a counter which also improves the code and makes it easier.

For oprofile a handler is implemented that returns an error now if a counter is already reserved by a different subsystem such as perf or watchdog. Before, oprofile silently ignored that counter. Finally the new reservation functions can be used to allocate special parts of the pmu such as IBS, which is necessary to use IBS with perf too.

The patches are available in the oprofile tree:

git://git.kernel.org/pub/scm/linux/kernel/git/rric/oprofile.git core

If there are no objections, I suggest to merge it into the tip/perf/core too, maybe after pending patches went in. If there are already conflicts, I will do the merge for this.

See enclose changelog.

-Robert

The following changes since commit bb1165d6882f423f90fc7007a88c6c993b7c2ac4:
Robert Richter (1):
perf, x86: rename macro in ARCH_PERFMON_EVENTSEL_ENABLE

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/rric/oprofile.git core

Robert Richter (9):
perf, x86: reduce number of CONFIG_X86_LOCAL_APIC macros oprofile, perf, x86: do not allocate evntsel counter msr oprofile, perf, x86: introduce new functions to reserve perfctrs by index tsc, x86: use new perfctr reservation functions in tsc code perf, x86: use new perfctr reservation functions in perf code oprofile/x86: rework error handler in nmi_setup() oprofile/x86: return -EBUSY if counters are already reserved oprofile/x86: group IBS code
oprofile/x86: implement perfctr reservation for IBS

 arch/x86/include/asm/nmi.h             |    2 +
 arch/x86/include/asm/perf_event.h      |    3 +
 arch/x86/kernel/cpu/perf_event.c       |   36 ++---
 arch/x86/kernel/cpu/perfctr-watchdog.c |   35 +++--
 arch/x86/kernel/tsc.c                  |    8 +-
 arch/x86/oprofile/nmi_int.c            |   38 +++--
 arch/x86/oprofile/op_model_amd.c       |  277 ++++++++++++++++++--------------
 arch/x86/oprofile/op_model_p4.c        |   15 ++-
 arch/x86/oprofile/op_model_ppro.c      |   23 ++--
 arch/x86/oprofile/op_x86_model.h       |    2 +-
 10 files changed, 248 insertions(+), 191 deletions(-)