diff options
| author | David S. Miller <davem@davemloft.net> | 2010-03-22 20:05:26 -0700 | 
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2010-03-22 20:05:26 -0700 | 
| commit | 91c030b4d6445ebe9fbddb86d584441f300df15c (patch) | |
| tree | e8a48e3ad9e0448c690268175e555fa651983546 /arch/sh/kernel/perf_event.c | |
| parent | 7c3456fdb503071787f7f972de1069b9cacd16f0 (diff) | |
| parent | ae6be51ed01d6c4aaf249a207b4434bc7785853b (diff) | |
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Diffstat (limited to 'arch/sh/kernel/perf_event.c')
| -rw-r--r-- | arch/sh/kernel/perf_event.c | 20 | 
1 files changed, 19 insertions, 1 deletions
| diff --git a/arch/sh/kernel/perf_event.c b/arch/sh/kernel/perf_event.c index 7ff0943e7a08..9f253e9cce01 100644 --- a/arch/sh/kernel/perf_event.c +++ b/arch/sh/kernel/perf_event.c @@ -275,13 +275,30 @@ const struct pmu *hw_perf_event_init(struct perf_event *event)  	return &pmu;  } -void hw_perf_event_setup(int cpu) +static void sh_pmu_setup(int cpu)  {  	struct cpu_hw_events *cpuhw = &per_cpu(cpu_hw_events, cpu);  	memset(cpuhw, 0, sizeof(struct cpu_hw_events));  } +static int __cpuinit +sh_pmu_notifier(struct notifier_block *self, unsigned long action, void *hcpu) +{ +	unsigned int cpu = (long)hcpu; + +	switch (action & ~CPU_TASKS_FROZEN) { +	case CPU_UP_PREPARE: +		sh_pmu_setup(cpu); +		break; + +	default: +		break; +	} + +	return NOTIFY_OK; +} +  void hw_perf_enable(void)  {  	if (!sh_pmu_initialized()) @@ -308,5 +325,6 @@ int register_sh_pmu(struct sh_pmu *pmu)  	WARN_ON(pmu->num_events > MAX_HWEVENTS); +	perf_cpu_notifier(sh_pmu_notifier);  	return 0;  } | 
