aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authormarkus.t.metzger@intel.com <markus.t.metzger@intel.com>2009-09-02 10:04:48 -0400
committerIngo Molnar <mingo@elte.hu>2009-09-04 03:26:40 -0400
commit1653192f510bd8114b7b133d7289e6e5c3e95046 (patch)
treec117851d55865c0a63d99af074bbdc65d68cc48b /arch
parent596da17f94c103348ebe04129c00d536ea0e80e2 (diff)
x86, perf_counter, bts: Do not allow kernel BTS tracing for now
Kernel BTS tracing generates too much data too fast for us to handle, causing the kernel to hang. Fail for BTS requests for kernel code. Signed-off-by: Markus Metzger <markus.t.metzger@intel.com> Acked-by: Peter Zijlstra <a.p.zjilstra@chello.nl> LKML-Reference: <20090902140616.901253000@intel.com> [ This is really a workaround - but we want BTS tracing in .32 so make sure we dont regress. The lockup should be fixed ASAP. ] Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/cpu/perf_counter.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/arch/x86/kernel/cpu/perf_counter.c b/arch/x86/kernel/cpu/perf_counter.c
index 3776b0b630c8..f9cd0849bd42 100644
--- a/arch/x86/kernel/cpu/perf_counter.c
+++ b/arch/x86/kernel/cpu/perf_counter.c
@@ -984,8 +984,15 @@ static int __hw_perf_counter_init(struct perf_counter *counter)
984 * Branch tracing: 984 * Branch tracing:
985 */ 985 */
986 if ((attr->config == PERF_COUNT_HW_BRANCH_INSTRUCTIONS) && 986 if ((attr->config == PERF_COUNT_HW_BRANCH_INSTRUCTIONS) &&
987 (hwc->sample_period == 1) && !bts_available()) 987 (hwc->sample_period == 1)) {
988 return -EOPNOTSUPP; 988 /* BTS is not supported by this architecture. */
989 if (!bts_available())
990 return -EOPNOTSUPP;
991
992 /* BTS is currently only allowed for user-mode. */
993 if (hwc->config & ARCH_PERFMON_EVENTSEL_OS)
994 return -EOPNOTSUPP;
995 }
989 996
990 hwc->config |= config; 997 hwc->config |= config;
991 998