diff options
author | Jacob Shin <jacob.shin@amd.com> | 2013-02-06 11:26:28 -0600 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-02-06 19:45:24 +0100 |
commit | 0fbdad078a70ed72248c3d30fe32e45e83be00d1 (patch) | |
tree | 07671320ea9e2c5e89d28508c0f8ff2a5ad1a29a /arch/x86/kernel/cpu/perf_event.h | |
parent | 4c1fd17a1cb32bc4f429c7a5ff9a91a3bffdb8fa (diff) | |
download | op-kernel-dev-0fbdad078a70ed72248c3d30fe32e45e83be00d1.zip op-kernel-dev-0fbdad078a70ed72248c3d30fe32e45e83be00d1.tar.gz |
perf/x86: Allow for architecture specific RDPMC indexes
Similar to config_base and event_base, allow architecture
specific RDPMC ECX values.
Signed-off-by: Jacob Shin <jacob.shin@amd.com>
Acked-by: Stephane Eranian <eranian@google.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1360171589-6381-6-git-send-email-jacob.shin@amd.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel/cpu/perf_event.h')
-rw-r--r-- | arch/x86/kernel/cpu/perf_event.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/perf_event.h b/arch/x86/kernel/cpu/perf_event.h index a7f06a9..7f5c75c 100644 --- a/arch/x86/kernel/cpu/perf_event.h +++ b/arch/x86/kernel/cpu/perf_event.h @@ -326,6 +326,7 @@ struct x86_pmu { unsigned eventsel; unsigned perfctr; int (*addr_offset)(int index, bool eventsel); + int (*rdpmc_index)(int index); u64 (*event_map)(int); int max_events; int num_counters; @@ -459,6 +460,11 @@ static inline unsigned int x86_pmu_event_addr(int index) x86_pmu.addr_offset(index, false) : index); } +static inline int x86_pmu_rdpmc_index(int index) +{ + return x86_pmu.rdpmc_index ? x86_pmu.rdpmc_index(index) : index; +} + int x86_setup_perfctr(struct perf_event *event); int x86_pmu_hw_config(struct perf_event *event); |