perf: sh, convert to new API pmu->init_event
Subsystems (2)
RFC PATCH 7/9 perf: sh, convert to new API pmu->init_event
perf: sh, convert to new API pmu->init_event
Signed-off-by Lin Ming <[email protected]>
--- arch/sh/kernel/perf_event.c | 21 ++++++++++++--------- 1 files changed, 12 insertions(+), 9 deletions(-)
arch/sh/kernel/perf_event.c +12 -9
@@ -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 ; }