diff options
| author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2010-03-25 09:51:50 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2010-03-26 06:33:55 -0400 |
| commit | faa4602e47690fb11221e00f9b9697c8dc0d4b19 (patch) | |
| tree | af667d1cdff7dc63b6893ee3f27a1f2503229ed1 | |
| parent | 7c5ecaf7666617889f337296c610815b519abfa9 (diff) | |
x86, perf, bts, mm: Delete the never used BTS-ptrace code
Support for the PMU's BTS features has been upstreamed in
v2.6.32, but we still have the old and disabled ptrace-BTS,
as Linus noticed it not so long ago.
It's buggy: TIF_DEBUGCTLMSR is trampling all over that MSR without
regard for other uses (perf) and doesn't provide the flexibility
needed for perf either.
Its users are ptrace-block-step and ptrace-bts, since ptrace-bts
was never used and ptrace-block-step can be implemented using a
much simpler approach.
So axe all 3000 lines of it. That includes the *locked_memory*()
APIs in mm/mlock.c as well.
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Roland McGrath <roland@redhat.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Markus Metzger <markus.t.metzger@intel.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
LKML-Reference: <20100325135413.938004390@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
34 files changed, 9 insertions, 3269 deletions
diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu index a19829374e6a..918fbb1855cc 100644 --- a/arch/x86/Kconfig.cpu +++ b/arch/x86/Kconfig.cpu | |||
| @@ -502,23 +502,3 @@ config CPU_SUP_UMC_32 | |||
| 502 | CPU might render the kernel unbootable. | 502 | CPU might render the kernel unbootable. |
| 503 | 503 | ||
| 504 | If unsure, say N. | 504 | If unsure, say N. |
| 505 | |||
| 506 | config X86_DS | ||
| 507 | def_bool X86_PTRACE_BTS | ||
| 508 | depends on X86_DEBUGCTLMSR | ||
| 509 | select HAVE_HW_BRANCH_TRACER | ||
| 510 | |||
| 511 | config X86_PTRACE_BTS | ||
| 512 | bool "Branch Trace Store" | ||
| 513 | default y | ||
| 514 | depends on X86_DEBUGCTLMSR | ||
| 515 | depends on BROKEN | ||
| 516 | ---help--- | ||
| 517 | This adds a ptrace interface to the hardware's branch trace store. | ||
| 518 | |||
| 519 | Debuggers may use it to collect an execution trace of the debugged | ||
| 520 | application in order to answer the question 'how did I get here?'. | ||
| 521 | Debuggers may trace user mode as well as kernel mode. | ||
| 522 | |||
| 523 | Say Y unless there is no application development on this machine | ||
| 524 | and you want to save a small amount of code size. | ||
diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug index bc01e3ebfeb2..bd58c8abbfbd 100644 --- a/arch/x86/Kconfig.debug +++ b/arch/x86/Kconfig.debug | |||
| @@ -174,15 +174,6 @@ config IOMMU_LEAK | |||
| 174 | Add a simple leak tracer to the IOMMU code. This is useful when you | 174 | Add a simple leak tracer to the IOMMU code. This is useful when you |
| 175 | are debugging a buggy device driver that leaks IOMMU mappings. | 175 | are debugging a buggy device driver that leaks IOMMU mappings. |
| 176 | 176 | ||
| 177 | config X86_DS_SELFTEST | ||
| 178 | bool "DS selftest" | ||
| 179 | default y | ||
| 180 | depends on DEBUG_KERNEL | ||
| 181 | depends on X86_DS | ||
| 182 | ---help--- | ||
| 183 | Perform Debug Store selftests at boot time. | ||
| 184 | If in doubt, say "N". | ||
| 185 | |||
| 186 | config HAVE_MMIOTRACE_SUPPORT | 177 | config HAVE_MMIOTRACE_SUPPORT |
| 187 | def_bool y | 178 | def_bool y |
| 188 | 179 | ||
diff --git a/arch/x86/include/asm/ds.h b/arch/x86/include/asm/ds.h deleted file mode 100644 index 70dac199b093..000000000000 --- a/arch/x86/include/asm/ds.h +++ /dev/null | |||
| @@ -1,302 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Debug Store (DS) support | ||
| 3 | * | ||
| 4 | * This provides a low-level interface to the hardware's Debug Store | ||
| 5 | * feature that is used for branch trace store (BTS) and | ||
| 6 | * precise-event based sampling (PEBS). | ||
| 7 | * | ||
| 8 | * It manages: | ||
| 9 | * - DS and BTS hardware configuration | ||
| 10 | * - buffer overflow handling (to be done) | ||
| 11 | * - buffer access | ||
| 12 | * | ||
| 13 | * It does not do: | ||
| 14 | * - security checking (is the caller allowed to trace the task) | ||
| 15 | * - buffer allocation (memory accounting) | ||
| 16 | * | ||
| 17 | * | ||
| 18 | * Copyright (C) 2007-2009 Intel Corporation. | ||
| 19 | * Markus Metzger <markus.t.metzger@intel.com>, 2007-2009 | ||
| 20 | */ | ||
| 21 | |||
| 22 | #ifndef _ASM_X86_DS_H | ||
| 23 | #define _ASM_X86_DS_H | ||
| 24 | |||
| 25 | |||
| 26 | #include <linux/types.h> | ||
| 27 | #include <linux/init.h> | ||
| 28 | #include <linux/err.h> | ||
| 29 | |||
| 30 | |||
| 31 | #ifdef CONFIG_X86_DS | ||
| 32 | |||
| 33 | struct task_struct; | ||
| 34 | struct ds_context; | ||
| 35 | struct ds_tracer; | ||
| 36 | struct bts_tracer; | ||
| 37 | struct pebs_tracer; | ||
| 38 | |||
| 39 | typedef void (*bts_ovfl_callback_t)(struct bts_tracer *); | ||
| 40 | typedef void (*pebs_ovfl_callback_t)(struct pebs_tracer *); | ||
| 41 | |||
| 42 | |||
| 43 | /* | ||
| 44 | * A list of features plus corresponding macros to talk about them in | ||
| 45 | * the ds_request function's flags parameter. | ||
| 46 | * | ||
| 47 | * We use the enum to index an array of corresponding control bits; | ||
| 48 | * we use the macro to index a flags bit-vector. | ||
| 49 | */ | ||
| 50 | enum ds_feature { | ||
| 51 | dsf_bts = 0, | ||
| 52 | dsf_bts_kernel, | ||
| 53 | #define BTS_KERNEL (1 << dsf_bts_kernel) | ||
| 54 | /* trace kernel-mode branches */ | ||
| 55 | |||
| 56 | dsf_bts_user, | ||
| 57 | #define BTS_USER (1 << dsf_bts_user) | ||
| 58 | /* trace user-mode branches */ | ||
| 59 | |||
| 60 | dsf_bts_overflow, | ||
| 61 | dsf_bts_max, | ||
| 62 | dsf_pebs = dsf_bts_max, | ||
| 63 | |||
| 64 | dsf_pebs_max, | ||
| 65 | dsf_ctl_max = dsf_pebs_max, | ||
| 66 | dsf_bts_timestamps = dsf_ctl_max, | ||
| 67 | #define BTS_TIMESTAMPS (1 << dsf_bts_timestamps) | ||
| 68 | /* add timestamps into BTS trace */ | ||
| 69 | |||
| 70 | #define BTS_USER_FLAGS (BTS_KERNEL | BTS_USER | BTS_TIMESTAMPS) | ||
| 71 | }; | ||
| 72 | |||
| 73 | |||
| 74 | /* | ||
| 75 | * Request BTS or PEBS | ||
| 76 | * | ||
| 77 | * Due to alignement constraints, the actual buffer may be slightly | ||
| 78 | * smaller than the requested or provided buffer. | ||
| 79 | * | ||
| 80 | * Returns a pointer to a tracer structure on success, or | ||
| 81 | * ERR_PTR(errcode) on failure. | ||
| 82 | * | ||
| 83 | * The interrupt threshold is independent from the overflow callback | ||
| 84 | * to allow users to use their own overflow interrupt handling mechanism. | ||
| 85 | * | ||
| 86 | * The function might sleep. | ||
| 87 | * | ||
| 88 | * task: the task to request recording for | ||
| 89 | * cpu: the cpu to request recording for | ||
| 90 | * base: the base pointer for the (non-pageable) buffer; | ||
| 91 | * size: the size of the provided buffer in bytes | ||
| 92 | * ovfl: pointer to a function to be called on buffer overflow; | ||
| 93 | * NULL if cyclic buffer requested | ||
| 94 | * th: the interrupt threshold in records from the end of the buffer; | ||
| 95 | * -1 if no interrupt threshold is requested. | ||
| 96 | * flags: a bit-mask of the above flags | ||
| 97 | */ | ||
| 98 | extern struct bts_tracer *ds_request_bts_task(struct task_struct *task, | ||
