[RFC][PATCH 4/8] perf: Use early_initcall() for tracepoint and breakpoint init

From: Peter Zijlstra
Date: Wed Nov 17 2010 - 17:24:54 EST


Just like other pmu implementations, use early_initcall().

Signed-off-by: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
---
kernel/hw_breakpoint.c | 2 +-
kernel/perf_event.c | 9 +++------
2 files changed, 4 insertions(+), 7 deletions(-)

Index: linux-2.6/kernel/hw_breakpoint.c
===================================================================
--- linux-2.6.orig/kernel/hw_breakpoint.c
+++ linux-2.6/kernel/hw_breakpoint.c
@@ -655,6 +655,6 @@ static int __init init_hw_breakpoint(voi

return -ENOMEM;
}
-core_initcall(init_hw_breakpoint);
+early_initcall(init_hw_breakpoint);


Index: linux-2.6/kernel/perf_event.c
===================================================================
--- linux-2.6.orig/kernel/perf_event.c
+++ linux-2.6/kernel/perf_event.c
@@ -4831,10 +4831,12 @@ static struct pmu perf_tracepoint = {
.read = perf_swevent_read,
};

-static inline void perf_tp_register(void)
+static __init int perf_tp_init(void)
{
perf_pmu_register(&perf_tracepoint);
+ return 0;
}
+early_initcall(perf_tp_init);

static int perf_event_set_filter(struct perf_event *event, void __user *arg)
{
@@ -4861,10 +4863,6 @@ static void perf_event_free_filter(struc

#else

-static inline void perf_tp_register(void)
-{
-}
-
static int perf_event_set_filter(struct perf_event *event, void __user *arg)
{
return -ENOENT;
@@ -6365,6 +6363,5 @@ void __init perf_event_init(void)
perf_pmu_register(&perf_swevent);
perf_pmu_register(&perf_cpu_clock);
perf_pmu_register(&perf_task_clock);
- perf_tp_register();
perf_cpu_notifier(perf_cpu_notify);
}


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/