Commit 1653192f authored by markus.t.metzger@intel.com's avatar markus.t.metzger@intel.com Committed by Ingo Molnar

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: default avatarMarkus Metzger <markus.t.metzger@intel.com>
Acked-by: default avatarPeter 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: default avatarIngo Molnar <mingo@elte.hu>
parent 596da17f
...@@ -984,9 +984,16 @@ static int __hw_perf_counter_init(struct perf_counter *counter) ...@@ -984,9 +984,16 @@ static int __hw_perf_counter_init(struct perf_counter *counter)
* Branch tracing: * Branch tracing:
*/ */
if ((attr->config == PERF_COUNT_HW_BRANCH_INSTRUCTIONS) && if ((attr->config == PERF_COUNT_HW_BRANCH_INSTRUCTIONS) &&
(hwc->sample_period == 1) && !bts_available()) (hwc->sample_period == 1)) {
/* BTS is not supported by this architecture. */
if (!bts_available())
return -EOPNOTSUPP; return -EOPNOTSUPP;
/* BTS is currently only allowed for user-mode. */
if (hwc->config & ARCH_PERFMON_EVENTSEL_OS)
return -EOPNOTSUPP;
}
hwc->config |= config; hwc->config |= config;
return 0; return 0;
......
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