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>
This commit is contained in:

committed by
Ingo Molnar

parent
35bb7600c1
commit
de79f54f53
@@ -10,11 +10,12 @@
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/smp.h>
|
||||
|
||||
#include <asm/ds.h>
|
||||
|
||||
|
||||
#define DS_SELFTEST_BUFFER_SIZE 1021 /* Intentionally chose an odd size. */
|
||||
#define BUFFER_SIZE 1021 /* Intentionally chose an odd size. */
|
||||
|
||||
|
||||
static int ds_selftest_bts_consistency(const struct bts_trace *trace)
|
||||
@@ -125,12 +126,12 @@ int ds_selftest_bts(void)
|
||||
struct bts_tracer *tracer;
|
||||
int error = 0;
|
||||
void *top;
|
||||
unsigned char buffer[DS_SELFTEST_BUFFER_SIZE];
|
||||
unsigned char buffer[BUFFER_SIZE];
|
||||
|
||||
printk(KERN_INFO "[ds] bts selftest...");
|
||||
|
||||
tracer = ds_request_bts(NULL, buffer, DS_SELFTEST_BUFFER_SIZE,
|
||||
NULL, (size_t)-1, BTS_KERNEL);
|
||||
tracer = ds_request_bts_cpu(smp_processor_id(), buffer, BUFFER_SIZE,
|
||||
NULL, (size_t)-1, BTS_KERNEL);
|
||||
if (IS_ERR(tracer)) {
|
||||
error = PTR_ERR(tracer);
|
||||
tracer = NULL;
|
||||
|
Reference in New Issue
Block a user