diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/alpha/include/asm/perf_event.h | 6 | ||||
-rw-r--r-- | arch/alpha/kernel/irq_alpha.c | 2 | ||||
-rw-r--r-- | arch/alpha/kernel/perf_event.c | 9 | ||||
-rw-r--r-- | arch/arm/kernel/perf_event.c | 2 | ||||
-rw-r--r-- | arch/mips/kernel/perf_event_mipsxx.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/e500-pmu.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/mpc7450-pmu.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/power4-pmu.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/power5+-pmu.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/power5-pmu.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/power6-pmu.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/power7-pmu.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/ppc970-pmu.c | 2 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh4/perf_event.c | 2 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh4a/perf_event.c | 2 | ||||
-rw-r--r-- | arch/sparc/include/asm/perf_event.h | 4 | ||||
-rw-r--r-- | arch/sparc/kernel/nmi.c | 2 | ||||
-rw-r--r-- | arch/sparc/kernel/perf_event.c | 7 | ||||
-rw-r--r-- | arch/x86/include/asm/perf_event.h | 2 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/common.c | 1 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/perf_event.c | 11 |
21 files changed, 30 insertions, 38 deletions
diff --git a/arch/alpha/include/asm/perf_event.h b/arch/alpha/include/asm/perf_event.h index fe792ca818f6..5996e7a6757e 100644 --- a/arch/alpha/include/asm/perf_event.h +++ b/arch/alpha/include/asm/perf_event.h | |||
@@ -1,10 +1,4 @@ | |||
1 | #ifndef __ASM_ALPHA_PERF_EVENT_H | 1 | #ifndef __ASM_ALPHA_PERF_EVENT_H |
2 | #define __ASM_ALPHA_PERF_EVENT_H | 2 | #define __ASM_ALPHA_PERF_EVENT_H |
3 | 3 | ||
4 | #ifdef CONFIG_PERF_EVENTS | ||
5 | extern void init_hw_perf_events(void); | ||
6 | #else | ||
7 | static inline void init_hw_perf_events(void) { } | ||
8 | #endif | ||
9 | |||
10 | #endif /* __ASM_ALPHA_PERF_EVENT_H */ | 4 | #endif /* __ASM_ALPHA_PERF_EVENT_H */ |
diff --git a/arch/alpha/kernel/irq_alpha.c b/arch/alpha/kernel/irq_alpha.c index 5f77afb88e89..4c8bb374eb0a 100644 --- a/arch/alpha/kernel/irq_alpha.c +++ b/arch/alpha/kernel/irq_alpha.c | |||
@@ -112,8 +112,6 @@ init_IRQ(void) | |||
112 | wrent(entInt, 0); | 112 | wrent(entInt, 0); |
113 | 113 | ||
114 | alpha_mv.init_irq(); | 114 | alpha_mv.init_irq(); |
115 | |||
116 | init_hw_perf_events(); | ||
117 | } | 115 | } |
118 | 116 | ||
119 | /* | 117 | /* |
diff --git a/arch/alpha/kernel/perf_event.c b/arch/alpha/kernel/perf_event.c index 1cc49683fb69..3283059b6e85 100644 --- a/arch/alpha/kernel/perf_event.c +++ b/arch/alpha/kernel/perf_event.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
15 | #include <linux/kdebug.h> | 15 | #include <linux/kdebug.h> |
16 | #include <linux/mutex.h> | 16 | #include <linux/mutex.h> |
17 | #include <linux/init.h> | ||
17 | 18 | ||
18 | #include <asm/hwrpb.h> | 19 | #include <asm/hwrpb.h> |
19 | #include <asm/atomic.h> | 20 | #include <asm/atomic.h> |
@@ -863,13 +864,13 @@ static void alpha_perf_event_irq_handler(unsigned long la_ptr, | |||
863 | /* | 864 | /* |
864 | * Init call to initialise performance events at kernel startup. | 865 | * Init call to initialise performance events at kernel startup. |
865 | */ | 866 | */ |
866 | void __init init_hw_perf_events(void) | 867 | int __init init_hw_perf_events(void) |
867 | { | 868 | { |
868 | pr_info("Performance events: "); | 869 | pr_info("Performance events: "); |
869 | 870 | ||
870 | if (!supported_cpu()) { | 871 | if (!supported_cpu()) { |
871 | pr_cont("No support for your CPU.\n"); | 872 | pr_cont("No support for your CPU.\n"); |
872 | return; | 873 | return 0; |
873 | } | 874 | } |
874 | 875 | ||
875 | pr_cont("Supported CPU type!\n"); | 876 | pr_cont("Supported CPU type!\n"); |
@@ -882,5 +883,7 @@ void __init init_hw_perf_events(void) | |||
882 | alpha_pmu = &ev67_pmu; | 883 | alpha_pmu = &ev67_pmu; |
883 | 884 | ||
884 | perf_pmu_register(&pmu); | 885 | perf_pmu_register(&pmu); |
885 | } | ||
886 | 886 | ||
887 | return 0; | ||
888 | } | ||
889 | early_initcall(init_hw_perf_events); | ||
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c index 07a50357492a..d45f70e5f2ee 100644 --- a/arch/arm/kernel/perf_event.c +++ b/arch/arm/kernel/perf_event.c | |||
@@ -3038,7 +3038,7 @@ init_hw_perf_events(void) | |||
3038 | 3038 | ||
3039 | return 0; | 3039 | return 0; |
3040 | } | 3040 | } |
3041 | arch_initcall(init_hw_perf_events); | 3041 | early_initcall(init_hw_perf_events); |
3042 | 3042 | ||
3043 | /* | 3043 | /* |
3044 | * Callchain handling code. | 3044 | * Callchain handling code. |
diff --git a/arch/mips/kernel/perf_event_mipsxx.c b/arch/mips/kernel/perf_event_mipsxx.c index 5c7c6fc07565..183e0d226669 100644 --- a/arch/mips/kernel/perf_event_mipsxx.c +++ b/arch/mips/kernel/perf_event_mipsxx.c | |||
@@ -1047,6 +1047,6 @@ init_hw_perf_events(void) | |||
1047 | 1047 | ||
1048 | return 0; | 1048 | return 0; |
1049 | } | 1049 | } |
1050 | arch_initcall(init_hw_perf_events); | 1050 | early_initcall(init_hw_perf_events); |
1051 | 1051 | ||
1052 | #endif /* defined(CONFIG_CPU_MIPS32)... */ | 1052 | #endif /* defined(CONFIG_CPU_MIPS32)... */ |
diff --git a/arch/powerpc/kernel/e500-pmu.c b/arch/powerpc/kernel/e500-pmu.c index 7c07de0d8943..b150b510510f 100644 --- a/arch/powerpc/kernel/e500-pmu.c +++ b/arch/powerpc/kernel/e500-pmu.c | |||
@@ -126,4 +126,4 @@ static int init_e500_pmu(void) | |||
126 | return register_fsl_emb_pmu(&e500_pmu); | 126 | return register_fsl_emb_pmu(&e500_pmu); |
127 | } | 127 | } |
128 | 128 | ||
129 | arch_initcall(init_e500_pmu); | 129 | early_initcall(init_e500_pmu); |
diff --git a/arch/powerpc/kernel/mpc7450-pmu.c b/arch/powerpc/kernel/mpc7450-pmu.c index 09d72028f317..2cc5e0301d0b 100644 --- a/arch/powerpc/kernel/mpc7450-pmu.c +++ b/arch/powerpc/kernel/mpc7450-pmu.c | |||
@@ -414,4 +414,4 @@ static int init_mpc7450_pmu(void) | |||
414 | return register_power_pmu(&mpc7450_pmu); | 414 | return register_power_pmu(&mpc7450_pmu); |
415 | } | 415 | } |
416 | 416 | ||
417 | arch_initcall(init_mpc7450_pmu); | 417 | early_initcall(init_mpc7450_pmu); |
diff --git a/arch/powerpc/kernel/power4-pmu.c b/arch/powerpc/kernel/power4-pmu.c index 2a361cdda635..ead8b3c2649e 100644 --- a/arch/powerpc/kernel/power4-pmu.c +++ b/arch/powerpc/kernel/power4-pmu.c | |||
@@ -613,4 +613,4 @@ static int init_power4_pmu(void) | |||
613 | return register_power_pmu(&power4_pmu); | 613 | return register_power_pmu(&power4_pmu); |
614 | } | 614 | } |
615 | 615 | ||
616 | arch_initcall(init_power4_pmu); | 616 | early_initcall(init_power4_pmu); |
diff --git a/arch/powerpc/kernel/power5+-pmu.c b/arch/powerpc/kernel/power5+-pmu.c index 199de527d411..eca0ac595cb6 100644 --- a/arch/powerpc/kernel/power5+-pmu.c +++ b/arch/powerpc/kernel/power5+-pmu.c | |||
@@ -682,4 +682,4 @@ static int init_power5p_pmu(void) | |||
682 | return register_power_pmu(&power5p_pmu); | 682 | return register_power_pmu(&power5p_pmu); |
683 | } | 683 | } |
684 | 684 | ||
685 | arch_initcall(init_power5p_pmu); | 685 | early_initcall(init_power5p_pmu); |
diff --git a/arch/powerpc/kernel/power5-pmu.c b/arch/powerpc/kernel/power5-pmu.c index 98b6a729a9dd..d5ff0f64a5e6 100644 --- a/arch/powerpc/kernel/power5-pmu.c +++ b/arch/powerpc/kernel/power5-pmu.c | |||
@@ -621,4 +621,4 @@ static int init_power5_pmu(void) | |||
621 | return register_power_pmu(&power5_pmu); | 621 | return register_power_pmu(&power5_pmu); |
622 | } | 622 | } |
623 | 623 | ||
624 | arch_initcall(init_power5_pmu); | 624 | early_initcall(init_power5_pmu); |
diff --git a/arch/powerpc/kernel/power6-pmu.c b/arch/powerpc/kernel/power6-pmu.c index 84a607bda8fb..31603927e376 100644 --- a/arch/powerpc/kernel/power6-pmu.c +++ b/arch/powerpc/kernel/power6-pmu.c | |||
@@ -544,4 +544,4 @@ static int init_power6_pmu(void) | |||
544 | return register_power_pmu(&power6_pmu); | 544 | return register_power_pmu(&power6_pmu); |
545 | } | 545 | } |
546 | 546 | ||
547 | arch_initcall(init_power6_pmu); | 547 | early_initcall(init_power6_pmu); |
diff --git a/arch/powerpc/kernel/power7-pmu.c b/arch/powerpc/kernel/power7-pmu.c index 852f7b7f6b40..593740fcb799 100644 --- a/arch/powerpc/kernel/power7-pmu.c +++ b/arch/powerpc/kernel/power7-pmu.c | |||
@@ -369,4 +369,4 @@ static int init_power7_pmu(void) | |||
369 | return register_power_pmu(&power7_pmu); | 369 | return register_power_pmu(&power7_pmu); |
370 | } | 370 | } |
371 | 371 | ||
372 | arch_initcall(init_power7_pmu); | 372 | early_initcall(init_power7_pmu); |
diff --git a/arch/powerpc/kernel/ppc970-pmu.c b/arch/powerpc/kernel/ppc970-pmu.c index 3fee685de4df..9a6e093858fe 100644 --- a/arch/powerpc/kernel/ppc970-pmu.c +++ b/arch/powerpc/kernel/ppc970-pmu.c | |||
@@ -494,4 +494,4 @@ static int init_ppc970_pmu(void) | |||
494 | return register_power_pmu(&ppc970_pmu); | 494 | return register_power_pmu(&ppc970_pmu); |
495 | } | 495 | } |
496 | 496 | ||
497 | arch_initcall(init_ppc970_pmu); | 497 | early_initcall(init_ppc970_pmu); |
diff --git a/arch/sh/kernel/cpu/sh4/perf_event.c b/arch/sh/kernel/cpu/sh4/perf_event.c index dbf3b4bb71fe..748955df018d 100644 --- a/arch/sh/kernel/cpu/sh4/perf_event.c +++ b/arch/sh/kernel/cpu/sh4/perf_event.c | |||
@@ -250,4 +250,4 @@ static int __init sh7750_pmu_init(void) | |||
250 | 250 | ||
251 | return register_sh_pmu(&sh7750_pmu); | 251 | return register_sh_pmu(&sh7750_pmu); |
252 | } | 252 | } |
253 | arch_initcall(sh7750_pmu_init); | 253 | early_initcall(sh7750_pmu_init); |
diff --git a/arch/sh/kernel/cpu/sh4a/perf_event.c b/arch/sh/kernel/cpu/sh4a/perf_event.c index 580276525731..17e6bebfede0 100644 --- a/arch/sh/kernel/cpu/sh4a/perf_event.c +++ b/arch/sh/kernel/cpu/sh4a/perf_event.c | |||
@@ -284,4 +284,4 @@ static int __init sh4a_pmu_init(void) | |||
284 | 284 | ||
285 | return register_sh_pmu(&sh4a_pmu); | 285 | return register_sh_pmu(&sh4a_pmu); |
286 | } | 286 | } |
287 | arch_initcall(sh4a_pmu_init); | 287 | early_initcall(sh4a_pmu_init); |
diff --git a/arch/sparc/include/asm/perf_event.h b/arch/sparc/include/asm/perf_event.h index 6e8bfa1786da..4d3dbe3703e9 100644 --- a/arch/sparc/include/asm/perf_event.h +++ b/arch/sparc/include/asm/perf_event.h | |||
@@ -4,8 +4,6 @@ | |||
4 | #ifdef CONFIG_PERF_EVENTS | 4 | #ifdef CONFIG_PERF_EVENTS |
5 | #include <asm/ptrace.h> | 5 | #include <asm/ptrace.h> |
6 | 6 | ||
7 | extern void init_hw_perf_events(void); | ||
8 | |||
9 | #define perf_arch_fetch_caller_regs(regs, ip) \ | 7 | #define perf_arch_fetch_caller_regs(regs, ip) \ |
10 | do { \ | 8 | do { \ |
11 | unsigned long _pstate, _asi, _pil, _i7, _fp; \ | 9 | unsigned long _pstate, _asi, _pil, _i7, _fp; \ |
@@ -26,8 +24,6 @@ do { \ | |||
26 | (regs)->u_regs[UREG_I6] = _fp; \ | 24 | (regs)->u_regs[UREG_I6] = _fp; \ |
27 | (regs)->u_regs[UREG_I7] = _i7; \ | 25 | (regs)->u_regs[UREG_I7] = _i7; \ |
28 | } while (0) | 26 | } while (0) |
29 | #else | ||
30 | static inline void init_hw_perf_events(void) { } | ||
31 | #endif | 27 | #endif |
32 | 28 | ||
33 | #endif | 29 | #endif |
diff --git a/arch/sparc/kernel/nmi.c b/arch/sparc/kernel/nmi.c index a4bd7ba74c89..300f810142f5 100644 --- a/arch/sparc/kernel/nmi.c +++ b/arch/sparc/kernel/nmi.c | |||
@@ -270,8 +270,6 @@ int __init nmi_init(void) | |||
270 | atomic_set(&nmi_active, -1); | 270 | atomic_set(&nmi_active, -1); |
271 | } | 271 | } |
272 | } | 272 | } |
273 | if (!err) | ||
274 | init_hw_perf_events(); | ||
275 | 273 | ||
276 | return err; | 274 | return err; |
277 | } | 275 | } |
diff --git a/arch/sparc/kernel/perf_event.c b/arch/sparc/kernel/perf_event.c index 0d6deb55a2ae..75c5b1263970 100644 --- a/arch/sparc/kernel/perf_event.c +++ b/arch/sparc/kernel/perf_event.c | |||
@@ -1307,20 +1307,23 @@ static bool __init supported_pmu(void) | |||
1307 | return false; | 1307 | return false; |
1308 | } | 1308 | } |
1309 | 1309 | ||
1310 | void __init init_hw_perf_events(void) | 1310 | int __init init_hw_perf_events(void) |
1311 | { | 1311 | { |
1312 | pr_info("Performance events: "); | 1312 | pr_info("Performance events: "); |
1313 | 1313 | ||
1314 | if (!supported_pmu()) { | 1314 | if (!supported_pmu()) { |
1315 | pr_cont("No support for PMU type '%s'\n", sparc_pmu_type); | 1315 | pr_cont("No support for PMU type '%s'\n", sparc_pmu_type); |
1316 | return; | 1316 | return 0; |
1317 | } | 1317 | } |
1318 | 1318 | ||
1319 | pr_cont("Supported PMU type is '%s'\n", sparc_pmu_type); | 1319 | pr_cont("Supported PMU type is '%s'\n", sparc_pmu_type); |
1320 | 1320 | ||
1321 | perf_pmu_register(&pmu); | 1321 | perf_pmu_register(&pmu); |
1322 | register_die_notifier(&perf_event_nmi_notifier); | 1322 | register_die_notifier(&perf_event_nmi_notifier); |
1323 | |||
1324 | return 0; | ||
1323 | } | 1325 | } |
1326 | early_initcall(init_hw_perf_event); | ||
1324 | 1327 | ||
1325 | void perf_callchain_kernel(struct perf_callchain_entry *entry, | 1328 | void perf_callchain_kernel(struct perf_callchain_entry *entry, |
1326 | struct pt_regs *regs) | 1329 | struct pt_regs *regs) |
diff --git a/arch/x86/include/asm/perf_event.h b/arch/x86/include/asm/perf_event.h index 550e26b1dbb3..d9d4dae305f6 100644 --- a/arch/x86/include/asm/perf_event.h +++ b/arch/x86/include/asm/perf_event.h | |||
@@ -125,7 +125,6 @@ union cpuid10_edx { | |||
125 | #define IBS_OP_MAX_CNT_EXT 0x007FFFFFULL /* not a register bit mask */ | 125 | #define IBS_OP_MAX_CNT_EXT 0x007FFFFFULL /* not a register bit mask */ |
126 | 126 | ||
127 | #ifdef CONFIG_PERF_EVENTS | 127 | #ifdef CONFIG_PERF_EVENTS |
128 | extern void init_hw_perf_events(void); | ||
129 | extern void perf_events_lapic_init(void); | 128 | extern void perf_events_lapic_init(void); |
130 | 129 | ||
131 | #define PERF_EVENT_INDEX_OFFSET 0 | 130 | #define PERF_EVENT_INDEX_OFFSET 0 |
@@ -156,7 +155,6 @@ extern unsigned long perf_misc_flags(struct pt_regs *regs); | |||
156 | } | 155 | } |
157 | 156 | ||
158 | #else | 157 | #else |
159 | static inline void init_hw_perf_events(void) { } | ||
160 | static inline void perf_events_lapic_init(void) { } | 158 | static inline void perf_events_lapic_init(void) { } |
161 | #endif | 159 | #endif |
162 | 160 | ||
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 4b68bda30938..1d59834396bd 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
@@ -894,7 +894,6 @@ void __init identify_boot_cpu(void) | |||
894 | #else | 894 | #else |
895 | vgetcpu_set_mode(); | 895 | vgetcpu_set_mode(); |
896 | #endif | 896 | #endif |
897 | init_hw_perf_events(); | ||
898 | } | 897 | } |
899 | 898 | ||
900 | void __cpuinit identify_secondary_cpu(struct cpuinfo_x86 *c) | 899 | void __cpuinit identify_secondary_cpu(struct cpuinfo_x86 *c) |
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index c01dfec635db..817d2b195e8e 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c | |||
@@ -1353,7 +1353,7 @@ static void __init pmu_check_apic(void) | |||
1353 | pr_info("no hardware sampling interrupt available.\n"); | 1353 | pr_info("no hardware sampling interrupt available.\n"); |
1354 | } | 1354 | } |
1355 | 1355 | ||
1356 | void __init init_hw_perf_events(void) | 1356 | int __init init_hw_perf_events(void) |
1357 | { | 1357 | { |
1358 | struct event_constraint *c; | 1358 | struct event_constraint *c; |
1359 | int err; | 1359 | int err; |
@@ -1368,11 +1368,11 @@ void __init init_hw_perf_events(void) | |||
1368 | err = amd_pmu_init(); | 1368 | err = amd_pmu_init(); |
1369 | break; | 1369 | break; |
1370 | default: | 1370 | default: |
1371 | return; | 1371 | return 0; |
1372 | } | 1372 | } |
1373 | if (err != 0) { | 1373 | if (err != 0) { |
1374 | pr_cont("no PMU driver, software events only.\n"); | 1374 | pr_cont("no PMU driver, software events only.\n"); |
1375 | return; | 1375 | return 0; |
1376 | } | 1376 | } |
1377 | 1377 | ||
1378 | pmu_check_apic(); | 1378 | pmu_check_apic(); |
@@ -1380,7 +1380,7 @@ void __init init_hw_perf_events(void) | |||
1380 | /* sanity check that the hardware exists or is emulated */ | 1380 | /* sanity check that the hardware exists or is emulated */ |
1381 | if (!check_hw_exists()) { | 1381 | if (!check_hw_exists()) { |
1382 | pr_cont("Broken PMU hardware detected, software events only.\n"); | 1382 | pr_cont("Broken PMU hardware detected, software events only.\n"); |
1383 | return; | 1383 | return 0; |
1384 | } | 1384 | } |
1385 | 1385 | ||
1386 | pr_cont("%s PMU driver.\n", x86_pmu.name); | 1386 | pr_cont("%s PMU driver.\n", x86_pmu.name); |
@@ -1431,7 +1431,10 @@ void __init init_hw_perf_events(void) | |||
1431 | 1431 | ||
1432 | perf_pmu_register(&pmu); | 1432 | perf_pmu_register(&pmu); |
1433 | perf_cpu_notifier(x86_pmu_notifier); | 1433 | perf_cpu_notifier(x86_pmu_notifier); |
1434 | |||
1435 | return 0; | ||
1434 | } | 1436 | } |
1437 | early_initcall(init_hw_perf_events); | ||
1435 | 1438 | ||
1436 | static inline void x86_pmu_read(struct perf_event *event) | 1439 | static inline void x86_pmu_read(struct perf_event *event) |
1437 | { | 1440 | { |