mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC][PATCH 7/9] perf: sh, convert to new API pmu->init_event
@ 2010-05-10  9:28 Lin Ming
  0 siblings, 0 replies; only message in thread
From: Lin Ming @ 2010-05-10  9:28 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar
  Cc: Frederic Weisbecker, eranian, Gary.Mohr@Bull.com, Corey Ashford,
	arjan, Zhang, Yanmin, Paul Mackerras, David S. Miller,
	Russell King, Paul Mundt, lkml

perf: sh, convert to new API pmu->init_event

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
---
 arch/sh/kernel/perf_event.c |   21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/arch/sh/kernel/perf_event.c b/arch/sh/kernel/perf_event.c
index 6e3a95f..1892f94 100644
--- a/arch/sh/kernel/perf_event.c
+++ b/arch/sh/kernel/perf_event.c
@@ -257,24 +257,24 @@ static void sh_pmu_read(struct perf_event *event)
 	sh_perf_event_update(event, &event->hw, event->hw.idx);
 }
 
-static struct pmu pmu = {
-	.enable		= sh_pmu_enable,
-	.disable	= sh_pmu_disable,
-	.read		= sh_pmu_read,
-};
-
-struct pmu *hw_perf_event_init(struct perf_event *event)
+static int *sh_pmu_init_event(struct perf_event *event)
 {
 	int err = __hw_perf_event_init(event);
 	if (unlikely(err)) {
 		if (event->destroy)
 			event->destroy(event);
-		return ERR_PTR(err);
 	}
 
-	return &pmu;
+	return err;
 }
 
+static struct pmu sh_pmu = {
+	.enable		= sh_pmu_enable,
+	.disable	= sh_pmu_disable,
+	.read		= sh_pmu_read,
+	.init_event	= sh_pmu_init_event,
+};
+
 static void sh_pmu_setup(int cpu)
 {
 	struct cpu_hw_events *cpuhw = &per_cpu(cpu_hw_events, cpu);
@@ -326,5 +326,8 @@ int __cpuinit register_sh_pmu(struct sh_pmu *pmu)
 	WARN_ON(pmu->num_events > MAX_HWEVENTS);
 
 	perf_cpu_notifier(sh_pmu_notifier);
+
+	perf_event_register_pmu(&sh_pmu);
+
 	return 0;
 }



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-05-10  9:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-10  9:28 [RFC][PATCH 7/9] perf: sh, convert to new API pmu->init_event Lin Ming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®