diff options
author | markus.t.metzger@intel.com <markus.t.metzger@intel.com> | 2009-09-02 16:04:48 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-09-04 09:26:40 +0200 |
commit | 1653192f510bd8114b7b133d7289e6e5c3e95046 (patch) | |
tree | c117851d55865c0a63d99af074bbdc65d68cc48b /arch/x86 | |
parent | 596da17f94c103348ebe04129c00d536ea0e80e2 (diff) | |
download | op-kernel-dev-1653192f510bd8114b7b133d7289e6e5c3e95046.zip op-kernel-dev-1653192f510bd8114b7b133d7289e6e5c3e95046.tar.gz |
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/x86')
-rw-r--r-- | arch/x86/kernel/cpu/perf_counter.c | 11 |
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 3776b0b..f9cd084 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) * Branch tracing: */ if ((attr->config == PERF_COUNT_HW_BRANCH_INSTRUCTIONS) && - (hwc->sample_period == 1) && !bts_available()) - return -EOPNOTSUPP; + (hwc->sample_period == 1)) { + /* BTS is not supported by this architecture. */ + if (!bts_available()) + return -EOPNOTSUPP; + + /* BTS is currently only allowed for user-mode. */ + if (hwc->config & ARCH_PERFMON_EVENTSEL_OS) + return -EOPNOTSUPP; + } hwc->config |= config; |