diff options
author | Markus Metzger <markus.t.metzger@intel.com> | 2009-04-03 10:43:40 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-07 07:36:20 -0400 |
commit | de79f54f5347ad7ec6ff55ccbb6d4ab2a21f6a93 (patch) | |
tree | dfd3f000600b942a545cbc8acd2f2e67f4518015 /arch/x86/kernel/ds_selftest.c | |
parent | 35bb7600c17762bb129588c1877d2717fe325289 (diff) |
x86, bts, hw-branch-tracer: add _noirq variants to the debug store interface
The hw-branch-tracer uses debug store functions from an on_each_cpu()
context, which is simply wrong since the functions may sleep.
Add _noirq variants for most functions, which may be called with
interrupts disabled.
Separate per-cpu and per-task tracing and allow per-cpu tracing to be
controlled from any cpu.
Make the hw-branch-tracer use the new debug store interface, synchronize
with hotplug cpu event using get/put_online_cpus(), and remove the
unnecessary spinlock.
Make the ptrace bts and the ds selftest code use the new interface.
Defer the ds selftest.
Signed-off-by: Markus Metzger <markus.t.metzger@intel.com>
Cc: roland@redhat.com
Cc: eranian@googlemail.com
Cc: oleg@redhat.com
Cc: juan.villacis@intel.com
Cc: ak@linux.jf.intel.com
LKML-Reference: <20090403144555.658136000@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/ds_selftest.c')
-rw-r--r-- | arch/x86/kernel/ds_selftest.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/x86/kernel/ds_selftest.c b/arch/x86/kernel/ds_selftest.c index 8c46fbf38c46..e5a263c8a14c 100644 --- a/arch/x86/kernel/ds_selftest.c +++ b/arch/x86/kernel/ds_selftest.c | |||
@@ -10,11 +10,12 @@ | |||
10 | 10 | ||
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/string.h> | 12 | #include <linux/string.h> |
13 | #include <linux/smp.h> | ||
13 | 14 | ||
14 | #include <asm/ds.h> | 15 | #include <asm/ds.h> |
15 | 16 | ||
16 | 17 | ||
17 | #define DS_SELFTEST_BUFFER_SIZE 1021 /* Intentionally chose an odd size. */ | 18 | #define BUFFER_SIZE 1021 /* Intentionally chose an odd size. */ |
18 | 19 | ||
19 | 20 | ||
20 | static int ds_selftest_bts_consistency(const struct bts_trace *trace) | 21 | static int ds_selftest_bts_consistency(const struct bts_trace *trace) |
@@ -125,12 +126,12 @@ int ds_selftest_bts(void) | |||
125 | struct bts_tracer *tracer; | 126 | struct bts_tracer *tracer; |
126 | int error = 0; | 127 | int error = 0; |
127 | void *top; | 128 | void *top; |
128 | unsigned char buffer[DS_SELFTEST_BUFFER_SIZE]; | 129 | unsigned char buffer[BUFFER_SIZE]; |
129 | 130 | ||
130 | printk(KERN_INFO "[ds] bts selftest..."); | 131 | printk(KERN_INFO "[ds] bts selftest..."); |
131 | 132 | ||
132 | tracer = ds_request_bts(NULL, buffer, DS_SELFTEST_BUFFER_SIZE, | 133 | tracer = ds_request_bts_cpu(smp_processor_id(), buffer, BUFFER_SIZE, |
133 | NULL, (size_t)-1, BTS_KERNEL); | 134 | NULL, (size_t)-1, BTS_KERNEL); |
134 | if (IS_ERR(tracer)) { | 135 | if (IS_ERR(tracer)) { |
135 | error = PTR_ERR(tracer); | 136 | error = PTR_ERR(tracer); |
136 | tracer = NULL; | 137 | tracer = NULL; |