summaryrefslogtreecommitdiffstats
path: root/kernel/trace
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-11-11 09:40:18 +0100
committerIngo Molnar <mingo@elte.hu>2008-11-11 09:40:18 +0100
commite0cb4ebcd9e5b4ddd8216c20f54445c91b1fa4b9 (patch)
treed1c3b22b7e9f02fb56927da530da09c6ee7ce0b9 /kernel/trace
parenta309720c876d7ad2e224bfd1982c92ae4364c82e (diff)
parent45b86a96f17cb2900f291129b0e67287400e45b2 (diff)
Merge branch 'tracing/urgent' into tracing/ftrace
Conflicts: kernel/trace/trace.c
Diffstat (limited to 'kernel/trace')
-rw-r--r--kernel/trace/ring_buffer.c2
-rw-r--r--kernel/trace/trace.c17
2 files changed, 17 insertions, 2 deletions
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index 6781e9aab2c..ee9b93d318b 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -1065,7 +1065,7 @@ rb_reserve_next_event(struct ring_buffer_per_cpu *cpu_buffer,
/* Did the write stamp get updated already? */
if (unlikely(ts < cpu_buffer->write_stamp))
- goto again;
+ delta = 0;
if (test_time_stamp(delta)) {
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index f147f198b9a..0c22fe2d43a 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -2835,7 +2835,7 @@ tracing_entries_write(struct file *filp, const char __user *ubuf,
{
unsigned long val;
char buf[64];
- int ret;
+ int ret, cpu;
if (cnt >= sizeof(buf))
return -EINVAL;
@@ -2857,6 +2857,14 @@ tracing_entries_write(struct file *filp, const char __user *ubuf,
tracing_stop();
+ /* disable all cpu buffers */
+ for_each_tracing_cpu(cpu) {
+ if (global_trace.data[cpu])
+ atomic_inc(&global_trace.data[cpu]->disabled);
+ if (max_tr.data[cpu])
+ atomic_inc(&max_tr.data[cpu]->disabled);
+ }
+
if (val != global_trace.entries) {
ret = ring_buffer_resize(global_trace.buffer, val);
if (ret < 0) {
@@ -2888,6 +2896,13 @@ tracing_entries_write(struct file *filp, const char __user *ubuf,
if (tracing_disabled)
cnt = -ENOMEM;
out:
+ for_each_tracing_cpu(cpu) {
+ if (global_trace.data[cpu])
+ atomic_dec(&global_trace.data[cpu]->disabled);
+ if (max_tr.data[cpu])
+ atomic_dec(&max_tr.data[cpu]->disabled);
+ }
+
tracing_start();
max_tr.entries = global_trace.entries;
mutex_unlock(&trace_types_lock);