diff options
Diffstat (limited to 'arch/powerpc/kernel/perf_event.c')
-rw-r--r-- | arch/powerpc/kernel/perf_event.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/perf_event.c b/arch/powerpc/kernel/perf_event.c index 5120bd44f69a..fbe101d7505d 100644 --- a/arch/powerpc/kernel/perf_event.c +++ b/arch/powerpc/kernel/perf_event.c | |||
@@ -1287,7 +1287,7 @@ static void perf_event_interrupt(struct pt_regs *regs) | |||
1287 | irq_exit(); | 1287 | irq_exit(); |
1288 | } | 1288 | } |
1289 | 1289 | ||
1290 | void hw_perf_event_setup(int cpu) | 1290 | static void power_pmu_setup(int cpu) |
1291 | { | 1291 | { |
1292 | struct cpu_hw_events *cpuhw = &per_cpu(cpu_hw_events, cpu); | 1292 | struct cpu_hw_events *cpuhw = &per_cpu(cpu_hw_events, cpu); |
1293 | 1293 | ||
@@ -1297,6 +1297,23 @@ void hw_perf_event_setup(int cpu) | |||
1297 | cpuhw->mmcr[0] = MMCR0_FC; | 1297 | cpuhw->mmcr[0] = MMCR0_FC; |
1298 | } | 1298 | } |
1299 | 1299 | ||
1300 | static int __cpuinit | ||
1301 | power_pmu_notify(struct notifier_block *self, unsigned long action, void *hcpu) | ||
1302 | { | ||
1303 | unsigned int cpu = (long)hcpu; | ||
1304 | |||
1305 | switch (action & ~CPU_TASKS_FROZEN) { | ||
1306 | case CPU_UP_PREPARE: | ||
1307 | power_pmu_setup(cpu); | ||
1308 | break; | ||
1309 | |||
1310 | default: | ||
1311 | break; | ||
1312 | } | ||
1313 | |||
1314 | return NOTIFY_OK; | ||
1315 | } | ||
1316 | |||
1300 | int register_power_pmu(struct power_pmu *pmu) | 1317 | int register_power_pmu(struct power_pmu *pmu) |
1301 | { | 1318 | { |
1302 | if (ppmu) | 1319 | if (ppmu) |
@@ -1314,5 +1331,7 @@ int register_power_pmu(struct power_pmu *pmu) | |||
1314 | freeze_events_kernel = MMCR0_FCHV; | 1331 | freeze_events_kernel = MMCR0_FCHV; |
1315 | #endif /* CONFIG_PPC64 */ | 1332 | #endif /* CONFIG_PPC64 */ |
1316 | 1333 | ||
1334 | perf_cpu_notifier(power_pmu_notifier); | ||
1335 | |||
1317 | return 0; | 1336 | return 0; |
1318 | } | 1337 | } |