Skip to content

RFC perf: remove __weak function hw_perf_event_init

Lin Ming lkml 2 versions – In review

Get series with b4
b4 am 1274233438.3036.78.camel@localhost

Versions newest first · linked by author and title

  1. v2 RFC Latest11 patches 62 repliesIn review
  2. v1 RFC9 patches 71 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11perf: un-const struct pmu *arch/x86/kernel/cpu/perf_event.c include/linux/perf_event.h kernel/perf_event.c+24 -240 replies
2/11perf: core, add pmu register and lookup functionsinclude/linux/perf_event.h kernel/perf_event.c+84 -02 replies
3/11perf: x86, implement pmu::init_eventarch/x86/kernel/cpu/perf_event.c+50 -150 replies
4/11perf: core, use new api to lookup pmu and init eventinclude/linux/perf_event.h kernel/perf_event.c+4 -100 replies
5/11perf: x86, remove hw_perf_event_initarch/x86/kernel/cpu/perf_event.c+0 -310 replies
6/11perf: core, export pmus via sysfsdrivers/base/node.c include/linux/node.h include/linux/perf_event.h +1 more+183 -145 replies
7/11perf: x86, implements pmu::register_eventsarch/x86/kernel/cpu/perf_event.c+70 -01 reply
8/11sysfs: introduce new interface sysfs_get_kobjectfs/sysfs/file.c include/linux/sysfs.h+17 -04 replies
9/11perf: multiplex perf_event_attr::type fieldarch/x86/kernel/cpu/perf_event.c arch/x86/kernel/cpu/perf_event_amd.c arch/x86/kernel/cpu/perf_event_intel.c +6 more+29 -180 replies
10/11perf: core, lookup pmu via sysfskernel/perf_event.c+32 -11 reply
11/11perf top: demo of how to use the sysfs interfacetools/perf/builtin-top.c+13 -09 replies

Reviews trailers per patch

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

Read the v2 thread

Cover letter [RFC][PATCH v2 0/11] perf: remove __weak function hw_perf_event_init

Hi, all

Quoted 4 lines · Peter Zijlstra

Right, I've got some definite ideas on how to go here, just need some time to implement them.

Quoted 8 lines

The first thing that needs to be done is get rid of all the __weak functions (with exception of perf_callchain*, since that really is arch specific).

For hw_perf_event_init() we need to create a pmu registration facility and lookup a pmu_id, either passed as an actual id found in sysfs or an open file handle from sysfs (the cpu pmu would be pmu_id 0 for backwards compat).

Here is v2 of the patch series.
v2 only touches the x86 code, let me first gather comments if this is the right direction to go...
And then touch other arches.

[PATCH 01/11] perf: un-const struct pmu *
[PATCH 02/11] perf: core, add pmu register and lookup functions [PATCH 03/11] perf: x86, implement pmu->init_event [PATCH 04/11] perf: core, use new api to lookup pmu and init event [PATCH 05/11] perf: x86, remove hw_perf_event_init [PATCH 06/11] perf: core, export pmus via sysfs
[PATCH 07/11] perf: x86, implements pmu::register_events [PATCH 08/11] sysfs: introduce new interface sysfs_get_kobject [PATCH 09/11] perf: multiplex perf_event_attr::type field [PATCH 10/11] perf: core, lookup pmu via sysfs
[PATCH 11/11] perf top: demo of how to use the sysfs interface

Thanks for any comments.

Lin Ming