aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/oprofile
diff options
context:
space:
mode:
authorRobert Richter <robert.richter@amd.com>2009-07-06 08:43:55 -0400
committerRobert Richter <robert.richter@amd.com>2009-07-20 10:43:21 -0400
commit52471c67ee2fa5ed6f700ef57bf27833c63b2192 (patch)
treea08002075dc251f6ebea7fad45b765ef780a387a /arch/x86/oprofile
parent2904a527575344a804fdd82b1f8d09a8731d8d49 (diff)
x86/oprofile: Modify initialization of num_virt_counters
Models that do not yet support counter multiplexing have to setup num_virt_counters. This patch implements the setup from num_counters if num_virt_counters is not set. Thus, num_virt_counters must be setup only for multiplexing support. Signed-off-by: Robert Richter <robert.richter@amd.com>
Diffstat (limited to 'arch/x86/oprofile')
-rw-r--r--arch/x86/oprofile/nmi_int.c3
-rw-r--r--arch/x86/oprofile/op_model_p4.c2
-rw-r--r--arch/x86/oprofile/op_model_ppro.c1
3 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c
index 826f391b4229..82ee29517f16 100644
--- a/arch/x86/oprofile/nmi_int.c
+++ b/arch/x86/oprofile/nmi_int.c
@@ -674,6 +674,9 @@ int __init op_nmi_init(struct oprofile_operations *ops)
674 if (ret) 674 if (ret)
675 return ret; 675 return ret;
676 676
677 if (!model->num_virt_counters)
678 model->num_virt_counters = model->num_counters;
679
677 init_sysfs(); 680 init_sysfs();
678 using_nmi = 1; 681 using_nmi = 1;
679 printk(KERN_INFO "oprofile: using NMI interrupt.\n"); 682 printk(KERN_INFO "oprofile: using NMI interrupt.\n");
diff --git a/arch/x86/oprofile/op_model_p4.c b/arch/x86/oprofile/op_model_p4.c
index 0a4f2deb9e8f..ac6b354becdf 100644
--- a/arch/x86/oprofile/op_model_p4.c
+++ b/arch/x86/oprofile/op_model_p4.c
@@ -698,7 +698,6 @@ static void p4_shutdown(struct op_msrs const * const msrs)
698struct op_x86_model_spec op_p4_ht2_spec = { 698struct op_x86_model_spec op_p4_ht2_spec = {
699 .num_counters = NUM_COUNTERS_HT2, 699 .num_counters = NUM_COUNTERS_HT2,
700 .num_controls = NUM_CONTROLS_HT2, 700 .num_controls = NUM_CONTROLS_HT2,
701 .num_virt_counters = NUM_COUNTERS_HT2,
702 .fill_in_addresses = &p4_fill_in_addresses, 701 .fill_in_addresses = &p4_fill_in_addresses,
703 .setup_ctrs = &p4_setup_ctrs, 702 .setup_ctrs = &p4_setup_ctrs,
704 .check_ctrs = &p4_check_ctrs, 703 .check_ctrs = &p4_check_ctrs,
@@ -711,7 +710,6 @@ struct op_x86_model_spec op_p4_ht2_spec = {
711struct op_x86_model_spec op_p4_spec = { 710struct op_x86_model_spec op_p4_spec = {
712 .num_counters = NUM_COUNTERS_NON_HT, 711 .num_counters = NUM_COUNTERS_NON_HT,
713 .num_controls = NUM_CONTROLS_NON_HT, 712 .num_controls = NUM_CONTROLS_NON_HT,
714 .num_virt_counters = NUM_COUNTERS_NON_HT,
715 .fill_in_addresses = &p4_fill_in_addresses, 713 .fill_in_addresses = &p4_fill_in_addresses,
716 .setup_ctrs = &p4_setup_ctrs, 714 .setup_ctrs = &p4_setup_ctrs,
717 .check_ctrs = &p4_check_ctrs, 715 .check_ctrs = &p4_check_ctrs,
diff --git a/arch/x86/oprofile/op_model_ppro.c b/arch/x86/oprofile/op_model_ppro.c
index 753a02ab215b..4899215999de 100644
--- a/arch/x86/oprofile/op_model_ppro.c
+++ b/arch/x86/oprofile/op_model_ppro.c
@@ -206,7 +206,6 @@ static void ppro_shutdown(struct op_msrs const * const msrs)
206struct op_x86_model_spec op_ppro_spec = { 206struct op_x86_model_spec op_ppro_spec = {
207 .num_counters = 2, 207 .num_counters = 2,
208 .num_controls = 2, 208 .num_controls = 2,
209 .num_virt_counters = 2,
210 .reserved = MSR_PPRO_EVENTSEL_RESERVED, 209 .reserved = MSR_PPRO_EVENTSEL_RESERVED,
211 .fill_in_addresses = &ppro_fill_in_addresses, 210 .fill_in_addresses = &ppro_fill_in_addresses,
212 .setup_ctrs = &ppro_setup_ctrs, 211 .setup_ctrs = &ppro_setup_ctrs,