Re: [PATCH v3 3/6] perf: implement pmu perf_kprobe

From: Peter Zijlstra
Date: Mon Dec 04 2017 - 09:52:13 EST


On Thu, Nov 30, 2017 at 03:50:20PM -0800, Song Liu wrote:
> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index 494eca1..49bbf46 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c

> static inline void perf_tp_register(void)
> {
> perf_pmu_register(&perf_tracepoint, "tracepoint", PERF_TYPE_TRACEPOINT);
> + perf_pmu_register(&perf_kprobe, "kprobe", -1);

Should we maybe not register this PMU when !KPROBE_EVENTS ? That looks
to save a bunch of #ifdeffery later on.

> }