Skip to content

Commit

Permalink
x86, perf_counter, bts: Do not allow kernel BTS tracing for now
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
markus.t.metzger@intel.com authored and Ingo Molnar committed Sep 4, 2009
1 parent 596da17 commit 1653192
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions arch/x86/kernel/cpu/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 1653192

Please sign in to comment.