summaryrefslogtreecommitdiff
path: root/arch/x86/oprofile/op_model_ppro.c
diff options
context:
space:
mode:
authorRobert Richter <robert.richter@amd.com>2008-10-12 15:12:34 -0400
committerRobert Richter <robert.richter@amd.com>2009-06-10 22:09:24 +0200
commite419294ed3c98cccc145202e4fe165bfd8099d63 (patch)
tree24eced48e81cc31765ac1a3a87eb75bed583e1fc /arch/x86/oprofile/op_model_ppro.c
parent849620fab413355eff48232eac5a8c53c57615c5 (diff)
x86/oprofile: moving arch_perfmon counter setup to op_x86_model_spec.init
The function arch_perfmon_init() in nmi_int.c is model specific. This patch moves it to op_model_ppro.c by using the init function pointer in struct op_x86_model_spec. Cc: Andi Kleen <ak@linux.intel.com> Signed-off-by: Robert Richter <robert.richter@amd.com>
Diffstat (limited to 'arch/x86/oprofile/op_model_ppro.c')
-rw-r--r--arch/x86/oprofile/op_model_ppro.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/x86/oprofile/op_model_ppro.c b/arch/x86/oprofile/op_model_ppro.c
index 2a123990a84c..ae5811966883 100644
--- a/arch/x86/oprofile/op_model_ppro.c
+++ b/arch/x86/oprofile/op_model_ppro.c
@@ -233,7 +233,7 @@ struct op_x86_model_spec const op_ppro_spec = {
* the specific CPU.
*/
-void arch_perfmon_setup_counters(void)
+static void arch_perfmon_setup_counters(void)
{
union cpuid10_eax eax;
@@ -253,7 +253,14 @@ void arch_perfmon_setup_counters(void)
op_arch_perfmon_spec.num_controls = num_counters;
}
+static int arch_perfmon_init(struct oprofile_operations *ignore)
+{
+ arch_perfmon_setup_counters();
+ return 0;
+}
+
struct op_x86_model_spec op_arch_perfmon_spec = {
+ .init = &arch_perfmon_init,
/* num_counters/num_controls filled in at runtime */
.fill_in_addresses = &ppro_fill_in_addresses,
/* user space does the cpuid check for available events */