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 /include | |
| 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 'include')
| -rw-r--r-- | include/linux/perf_event.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 30e50e2c7f30..21206d27466b 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
| @@ -588,6 +588,9 @@ struct perf_event; | |||
| 588 | struct pmu { | 588 | struct pmu { |
| 589 | struct list_head entry; | 589 | struct list_head entry; |
| 590 | 590 | ||
| 591 | char *name; | ||
| 592 | int type; | ||
| 593 | |||
| 591 | int * __percpu pmu_disable_count; | 594 | int * __percpu pmu_disable_count; |
| 592 | struct perf_cpu_context * __percpu pmu_cpu_context; | 595 | struct perf_cpu_context * __percpu pmu_cpu_context; |
| 593 | int task_ctx_nr; | 596 | int task_ctx_nr; |
| @@ -916,7 +919,7 @@ struct perf_output_handle { | |||
| 916 | 919 | ||
| 917 | #ifdef CONFIG_PERF_EVENTS | 920 | #ifdef CONFIG_PERF_EVENTS |
| 918 | 921 | ||
| 919 | extern int perf_pmu_register(struct pmu *pmu); | 922 | extern int perf_pmu_register(struct pmu *pmu, char *name, int type); |
| 920 | extern void perf_pmu_unregister(struct pmu *pmu); | 923 | extern void perf_pmu_unregister(struct pmu *pmu); |
| 921 | 924 | ||
| 922 | extern int perf_num_counters(void); | 925 | extern int perf_num_counters(void); |
