[RFC][PATCH 8/9] perf: sparc, convert to new API pmu->init_event

From: Lin Ming
Date: Mon May 10 2010 - 05:29:32 EST


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

Signed-off-by: Lin Ming <ming.m.lin@xxxxxxxxx>
---
arch/sparc/kernel/perf_event.c | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/arch/sparc/kernel/perf_event.c b/arch/sparc/kernel/perf_event.c
index a163f55..ef7fafc 100644
--- a/arch/sparc/kernel/perf_event.c
+++ b/arch/sparc/kernel/perf_event.c
@@ -1128,22 +1128,21 @@ static int __hw_perf_event_init(struct perf_event *event)
return 0;
}

+static int sparc_pmu_init_event(struct perf_event *event)
+{
+ int err = __hw_perf_event_init(event);
+
+ return err;
+}
+
static struct pmu pmu = {
.enable = sparc_pmu_enable,
.disable = sparc_pmu_disable,
.read = sparc_pmu_read,
.unthrottle = sparc_pmu_unthrottle,
+ .init_event = sparc_pmu_init_event,
};

-struct pmu *hw_perf_event_init(struct perf_event *event)
-{
- int err = __hw_perf_event_init(event);
-
- if (err)
- return ERR_PTR(err);
- return &pmu;
-}
-
void perf_event_print_debug(void)
{
unsigned long flags;
@@ -1264,6 +1263,8 @@ void __init init_hw_perf_events(void)
perf_max_events = 2;

register_die_notifier(&perf_event_nmi_notifier);
+
+ perf_event_register_pmu(&pmu);
}

static inline void callchain_store(struct perf_callchain_entry *entry, u64 ip)


--
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/