Prev: [RFC][PATCH v2 05/11] perf: x86, remove hw_perf_event_init
Next: [RFC][PATCH v2 11/11] perf top: demo of how to use the sysfs interface
From: Lin Ming on 18 May 2010 13:50 Remove the weak function hw_perf_event_init Signed-off-by: Lin Ming <ming.m.lin(a)intel.com> --- include/linux/perf_event.h | 2 -- kernel/perf_event.c | 12 ++++-------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 40809f5..ad2aea3 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h @@ -825,8 +825,6 @@ struct perf_output_handle { */ extern int perf_max_events; -extern struct pmu *hw_perf_event_init(struct perf_event *event); - extern void perf_event_task_sched_in(struct task_struct *task); extern void perf_event_task_sched_out(struct task_struct *task, struct task_struct *next); extern void perf_event_task_tick(struct task_struct *task); diff --git a/kernel/perf_event.c b/kernel/perf_event.c index 31b032b..17eff7b 100644 --- a/kernel/perf_event.c +++ b/kernel/perf_event.c @@ -81,11 +81,6 @@ static DEFINE_SPINLOCK(perf_resource_lock); /* * Architecture provided APIs - weak aliases: */ -extern __weak struct pmu *hw_perf_event_init(struct perf_event *event) -{ - return NULL; -} - void __weak hw_perf_disable(void) { barrier(); } void __weak hw_perf_enable(void) { barrier(); } @@ -4727,7 +4722,7 @@ perf_event_alloc(struct perf_event_attr *attr, struct pmu *pmu; struct perf_event *event; struct hw_perf_event *hwc; - long err; + long err = 0; event = kzalloc(sizeof(*event), gfpflags); if (!event) @@ -4792,7 +4787,9 @@ perf_event_alloc(struct perf_event_attr *attr, case PERF_TYPE_RAW: case PERF_TYPE_HARDWARE: case PERF_TYPE_HW_CACHE: - pmu = hw_perf_event_init(event); + pmu = perf_event_lookup_pmu(event); + if (pmu && pmu->init_event) + err = pmu->init_event(event); break; case PERF_TYPE_SOFTWARE: @@ -4812,7 +4809,6 @@ perf_event_alloc(struct perf_event_attr *attr, break; } done: - err = 0; if (!pmu) err = -EINVAL; else if (IS_ERR(pmu)) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |