Commit 52471c67 authored by Robert Richter's avatar Robert Richter

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: default avatarRobert Richter <robert.richter@amd.com>
parent 2904a527
...@@ -674,6 +674,9 @@ int __init op_nmi_init(struct oprofile_operations *ops) ...@@ -674,6 +674,9 @@ int __init op_nmi_init(struct oprofile_operations *ops)
if (ret) if (ret)
return ret; return ret;
if (!model->num_virt_counters)
model->num_virt_counters = model->num_counters;
init_sysfs(); init_sysfs();
using_nmi = 1; using_nmi = 1;
printk(KERN_INFO "oprofile: using NMI interrupt.\n"); printk(KERN_INFO "oprofile: using NMI interrupt.\n");
......
...@@ -698,7 +698,6 @@ static void p4_shutdown(struct op_msrs const * const msrs) ...@@ -698,7 +698,6 @@ static void p4_shutdown(struct op_msrs const * const msrs)
struct op_x86_model_spec op_p4_ht2_spec = { struct op_x86_model_spec op_p4_ht2_spec = {
.num_counters = NUM_COUNTERS_HT2, .num_counters = NUM_COUNTERS_HT2,
.num_controls = NUM_CONTROLS_HT2, .num_controls = NUM_CONTROLS_HT2,
.num_virt_counters = NUM_COUNTERS_HT2,
.fill_in_addresses = &p4_fill_in_addresses, .fill_in_addresses = &p4_fill_in_addresses,
.setup_ctrs = &p4_setup_ctrs, .setup_ctrs = &p4_setup_ctrs,
.check_ctrs = &p4_check_ctrs, .check_ctrs = &p4_check_ctrs,
...@@ -711,7 +710,6 @@ struct op_x86_model_spec op_p4_ht2_spec = { ...@@ -711,7 +710,6 @@ struct op_x86_model_spec op_p4_ht2_spec = {
struct op_x86_model_spec op_p4_spec = { struct op_x86_model_spec op_p4_spec = {
.num_counters = NUM_COUNTERS_NON_HT, .num_counters = NUM_COUNTERS_NON_HT,
.num_controls = NUM_CONTROLS_NON_HT, .num_controls = NUM_CONTROLS_NON_HT,
.num_virt_counters = NUM_COUNTERS_NON_HT,
.fill_in_addresses = &p4_fill_in_addresses, .fill_in_addresses = &p4_fill_in_addresses,
.setup_ctrs = &p4_setup_ctrs, .setup_ctrs = &p4_setup_ctrs,
.check_ctrs = &p4_check_ctrs, .check_ctrs = &p4_check_ctrs,
......
...@@ -206,7 +206,6 @@ static void ppro_shutdown(struct op_msrs const * const msrs) ...@@ -206,7 +206,6 @@ static void ppro_shutdown(struct op_msrs const * const msrs)
struct op_x86_model_spec op_ppro_spec = { struct op_x86_model_spec op_ppro_spec = {
.num_counters = 2, .num_counters = 2,
.num_controls = 2, .num_controls = 2,
.num_virt_counters = 2,
.reserved = MSR_PPRO_EVENTSEL_RESERVED, .reserved = MSR_PPRO_EVENTSEL_RESERVED,
.fill_in_addresses = &ppro_fill_in_addresses, .fill_in_addresses = &ppro_fill_in_addresses,
.setup_ctrs = &ppro_setup_ctrs, .setup_ctrs = &ppro_setup_ctrs,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment