diff options
author | Robert Richter <robert.richter@amd.com> | 2010-02-26 17:20:55 +0100 |
---|---|---|
committer | Robert Richter <robert.richter@amd.com> | 2010-05-04 11:35:28 +0200 |
commit | 8617f98c001d00b176422d707e6a67b88bcd7e0d (patch) | |
tree | e857f11dcbc6e650f4d0c30839099358c814e537 /arch/x86/oprofile/op_model_p4.c | |
parent | 83300ce0df6b72e156b386457aa0f0902b8c0a98 (diff) | |
download | linux-8617f98c001d00b176422d707e6a67b88bcd7e0d.tar.gz linux-8617f98c001d00b176422d707e6a67b88bcd7e0d.tar.bz2 linux-8617f98c001d00b176422d707e6a67b88bcd7e0d.zip |
oprofile/x86: return -EBUSY if counters are already reserved
In case a counter is already reserved by the watchdog or perf_event
subsystem, oprofile ignored this counters silently. This case is
handled now and oprofile_setup() now reports an error.
Signed-off-by: Robert Richter <robert.richter@amd.com>
Diffstat (limited to 'arch/x86/oprofile/op_model_p4.c')
-rw-r--r-- | arch/x86/oprofile/op_model_p4.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/arch/x86/oprofile/op_model_p4.c b/arch/x86/oprofile/op_model_p4.c index 7cc80df330d5..182558dd5515 100644 --- a/arch/x86/oprofile/op_model_p4.c +++ b/arch/x86/oprofile/op_model_p4.c @@ -404,7 +404,7 @@ static void p4_shutdown(struct op_msrs const * const msrs) } } -static void p4_fill_in_addresses(struct op_msrs * const msrs) +static int p4_fill_in_addresses(struct op_msrs * const msrs) { unsigned int i; unsigned int addr, cccraddr, stag; @@ -486,6 +486,18 @@ static void p4_fill_in_addresses(struct op_msrs * const msrs) msrs->controls[i++].addr = MSR_P4_CRU_ESCR5; } } + + for (i = 0; i < num_counters; ++i) { + if (!counter_config[i].enabled) + continue; + if (msrs->controls[i].addr) + continue; + op_x86_warn_reserved(i); + p4_shutdown(msrs); + return -EBUSY; + } + + return 0; } |