[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1274233556.3036.82.camel@localhost>
Date: Wed, 19 May 2010 01:45:56 +0000
From: Lin Ming <ming.m.lin@...el.com>
To: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...e.hu>,
Corey Ashford <cjashfor@...ux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@...il.com>,
Paul Mundt <lethal@...ux-sh.org>,
"eranian@...il.com" <eranian@...il.com>,
"Gary.Mohr@...l.com" <Gary.Mohr@...l.com>,
"arjan@...ux.intel.com" <arjan@...ux.intel.com>,
"Zhang, Yanmin" <yanmin_zhang@...ux.intel.com>,
Paul Mackerras <paulus@...ba.org>,
"David S. Miller" <davem@...emloft.net>,
Russell King <rmk+kernel@....linux.org.uk>,
Arnaldo Carvalho de Melo <acme@...hat.com>,
Will Deacon <will.deacon@....com>,
Maynard Johnson <mpjohn@...ibm.com>,
Carl Love <carll@...ibm.com>,
"greg@...ah.com" <greg@...ah.com>,
Kay Sievers <kay.sievers@...y.org>,
lkml <linux-kernel@...r.kernel.org>
Subject: [RFC][PATCH v2 04/11] perf: core, use new api to lookup pmu and
init event
Remove the weak function hw_perf_event_init
Signed-off-by: Lin Ming <ming.m.lin@...el.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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists