aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-11-11 03:40:18 -0500
committerIngo Molnar <mingo@elte.hu>2008-11-11 03:40:18 -0500
commite0cb4ebcd9e5b4ddd8216c20f54445c91b1fa4b9 (patch)
treed1c3b22b7e9f02fb56927da530da09c6ee7ce0b9 /kernel/trace/trace.c
parenta309720c876d7ad2e224bfd1982c92ae4364c82e (diff)
parent45b86a96f17cb2900f291129b0e67287400e45b2 (diff)
Merge branch 'tracing/urgent' into tracing/ftrace
Conflicts: kernel/trace/trace.c
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r--kernel/trace/trace.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index f147f198b9a6..0c22fe2d43a7 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,
2835{ 2835{
2836 unsigned long val; 2836 unsigned long val;
2837 char buf[64]; 2837 char buf[64];
2838 int ret; 2838 int ret, cpu;
2839 2839
2840 if (cnt >= sizeof(buf)) 2840 if (cnt >= sizeof(buf))
2841 return -EINVAL; 2841 return -EINVAL;
@@ -2857,6 +2857,14 @@ tracing_entries_write(struct file *filp, const char __user *ubuf,
2857 2857
2858 tracing_stop(); 2858 tracing_stop();
2859 2859
2860 /* disable all cpu buffers */
2861 for_each_tracing_cpu(cpu) {
2862 if (global_trace.data[cpu])
2863 atomic_inc(&global_trace.data[cpu]->disabled);
2864 if (max_tr.data[cpu])
2865 atomic_inc(&max_tr.data[cpu]->disabled);
2866 }
2867
2860 if (val != global_trace.entries) { 2868 if (val != global_trace.entries) {
2861 ret = ring_buffer_resize(global_trace.buffer, val); 2869 ret = ring_buffer_resize(global_trace.buffer, val);
2862 if (ret < 0) { 2870 if (ret < 0) {
@@ -2888,6 +2896,13 @@ tracing_entries_write(struct file *filp, const char __user *ubuf,
2888 if (tracing_disabled) 2896 if (tracing_disabled)
2889 cnt = -ENOMEM; 2897 cnt = -ENOMEM;
2890 out: 2898 out:
2899 for_each_tracing_cpu(cpu) {
2900 if (global_trace.data[cpu])
2901 atomic_dec(&global_trace.data[cpu]->disabled);
2902 if (max_tr.data[cpu])
2903 atomic_dec(&max_tr.data[cpu]->disabled);
2904 }
2905
2891 tracing_start(); 2906 tracing_start();
2892 max_tr.entries = global_trace.entries; 2907 max_tr.entries = global_trace.entries;
2893 mutex_unlock(&trace_types_lock); 2908 mutex_unlock(&trace_types_lock);