diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2010-11-17 17:17:36 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-12-16 05:36:43 -0500 |
commit | 2e80a82a49c4c7eca4e35734380f28298ba5db19 (patch) | |
tree | c60fe1cc6696c893a2c6c5891981bf8e81d9ab90 /arch | |
parent | 9f58a205c62d0dad1df38d076324a89b1a0f1d65 (diff) |
perf: Dynamic pmu types
Extend the perf_pmu_register() interface to allow for named and
dynamic pmu types.
Because we need to support the existing static types we cannot use
dynamic types for everything, hence provide a type argument.
If we want to enumerate the PMUs they need a name, provide one.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20101117222056.259707703@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/alpha/kernel/perf_event.c | 2 | ||||
-rw-r--r-- | arch/arm/kernel/perf_event.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/perf_event.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/perf_event_fsl_emb.c | 2 | ||||
-rw-r--r-- | arch/sh/kernel/perf_event.c | 2 | ||||
-rw-r--r-- | arch/sparc/kernel/perf_event.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/perf_event.c | 2 |
7 files changed, 7 insertions, 7 deletions
diff --git a/arch/alpha/kernel/perf_event.c b/arch/alpha/kernel/perf_event.c index 3283059b6e85..90561c45e7d8 100644 --- a/arch/alpha/kernel/perf_event.c +++ b/arch/alpha/kernel/perf_event.c | |||
@@ -882,7 +882,7 @@ int __init init_hw_perf_events(void) | |||
882 | /* And set up PMU specification */ | 882 | /* And set up PMU specification */ |
883 | alpha_pmu = &ev67_pmu; | 883 | alpha_pmu = &ev67_pmu; |
884 | 884 | ||
885 | perf_pmu_register(&pmu); | 885 | perf_pmu_register(&pmu, "cpu", PERF_TYPE_RAW); |
886 | 886 | ||
887 | return 0; | 887 | return 0; |
888 | } | 888 | } |
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c index d45f70e5f2ee..fdfa4976b0bf 100644 --- a/arch/arm/kernel/perf_event.c +++ b/arch/arm/kernel/perf_event.c | |||
@@ -3034,7 +3034,7 @@ init_hw_perf_events(void) | |||
3034 | pr_info("no hardware support available\n"); | 3034 | pr_info("no hardware support available\n"); |
3035 | } | 3035 | } |
3036 | 3036 | ||
3037 | perf_pmu_register(&pmu); | 3037 | perf_pmu_register(&pmu, "cpu", PERF_TYPE_RAW); |
3038 | 3038 | ||
3039 | return 0; | 3039 | return 0; |
3040 | } | 3040 | } |
diff --git a/arch/powerpc/kernel/perf_event.c b/arch/powerpc/kernel/perf_event.c index 3129c855933c..567480705789 100644 --- a/arch/powerpc/kernel/perf_event.c +++ b/arch/powerpc/kernel/perf_event.c | |||
@@ -1379,7 +1379,7 @@ int register_power_pmu(struct power_pmu *pmu) | |||
1379 | freeze_events_kernel = MMCR0_FCHV; | 1379 | freeze_events_kernel = MMCR0_FCHV; |
1380 | #endif /* CONFIG_PPC64 */ | 1380 | #endif /* CONFIG_PPC64 */ |
1381 | 1381 | ||
1382 | perf_pmu_register(&power_pmu); | 1382 | perf_pmu_register(&power_pmu, "cpu", PERF_TYPE_RAW); |
1383 | perf_cpu_notifier(power_pmu_notifier); | 1383 | perf_cpu_notifier(power_pmu_notifier); |
1384 | 1384 | ||
1385 | return 0; | 1385 | return 0; |
diff --git a/arch/powerpc/kernel/perf_event_fsl_emb.c b/arch/powerpc/kernel/perf_event_fsl_emb.c index 7ecca59ddf77..4dcf5f831e9d 100644 --- a/arch/powerpc/kernel/perf_event_fsl_emb.c +++ b/arch/powerpc/kernel/perf_event_fsl_emb.c | |||
@@ -681,7 +681,7 @@ int register_fsl_emb_pmu(struct fsl_emb_pmu *pmu) | |||
681 | pr_info("%s performance monitor hardware support registered\n", | 681 | pr_info("%s performance monitor hardware support registered\n", |
682 | pmu->name); | 682 | pmu->name); |
683 | 683 | ||
684 | perf_pmu_register(&fsl_emb_pmu); | 684 | perf_pmu_register(&fsl_emb_pmu, "cpu", PERF_TYPE_RAW); |
685 | 685 | ||
686 | return 0; | 686 | return 0; |
687 | } | 687 | } |
diff --git a/arch/sh/kernel/perf_event.c b/arch/sh/kernel/perf_event.c index 5a4b33435650..2ee21a47b5af 100644 --- a/arch/sh/kernel/perf_event.c +++ b/arch/sh/kernel/perf_event.c | |||
@@ -389,7 +389,7 @@ int __cpuinit register_sh_pmu(struct sh_pmu *_pmu) | |||
389 | 389 | ||
390 | WARN_ON(_pmu->num_events > MAX_HWEVENTS); | 390 | WARN_ON(_pmu->num_events > MAX_HWEVENTS); |
391 | 391 | ||
392 | perf_pmu_register(&pmu); | 392 | perf_pmu_register(&pmu, "cpu", PERF_TYPE_RAW); |
393 | perf_cpu_notifier(sh_pmu_notifier); | 393 | perf_cpu_notifier(sh_pmu_notifier); |
394 | return 0; | 394 | return 0; |
395 | } | 395 | } |
diff --git a/arch/sparc/kernel/perf_event.c b/arch/sparc/kernel/perf_event.c index 39348b1cebd3..760578687e7c 100644 --- a/arch/sparc/kernel/perf_event.c +++ b/arch/sparc/kernel/perf_event.c | |||
@@ -1318,7 +1318,7 @@ int __init init_hw_perf_events(void) | |||
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, "cpu", PERF_TYPE_RAW); |
1322 | register_die_notifier(&perf_event_nmi_notifier); | 1322 | register_die_notifier(&perf_event_nmi_notifier); |
1323 | 1323 | ||
1324 | return 0; | 1324 | return 0; |
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index ce27c547fe78..0a360d146596 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c | |||
@@ -1465,7 +1465,7 @@ int __init init_hw_perf_events(void) | |||
1465 | pr_info("... fixed-purpose events: %d\n", x86_pmu.num_counters_fixed); | 1465 | pr_info("... fixed-purpose events: %d\n", x86_pmu.num_counters_fixed); |
1466 | pr_info("... event mask: %016Lx\n", x86_pmu.intel_ctrl); | 1466 | pr_info("... event mask: %016Lx\n", x86_pmu.intel_ctrl); |
1467 | 1467 | ||
1468 | perf_pmu_register(&pmu); | 1468 | perf_pmu_register(&pmu, "cpu", PERF_TYPE_RAW); |
1469 | perf_cpu_notifier(x86_pmu_notifier); | 1469 | perf_cpu_notifier(x86_pmu_notifier); |
1470 | 1470 | ||
1471 | return 0; | 1471 | return 0; |