diff options
Diffstat (limited to 'kernel/trace')
-rw-r--r-- | kernel/trace/ftrace.c | 2 | ||||
-rw-r--r-- | kernel/trace/trace.c | 17 |
2 files changed, 14 insertions, 5 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 3ffe4c5ad3f3..41473b4ad7a4 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -3998,7 +3998,7 @@ static int ftrace_module_notify(struct notifier_block *self, | |||
3998 | 3998 | ||
3999 | struct notifier_block ftrace_module_nb = { | 3999 | struct notifier_block ftrace_module_nb = { |
4000 | .notifier_call = ftrace_module_notify, | 4000 | .notifier_call = ftrace_module_notify, |
4001 | .priority = 0, | 4001 | .priority = INT_MAX, /* Run before anything that can use kprobes */ |
4002 | }; | 4002 | }; |
4003 | 4003 | ||
4004 | extern unsigned long __start_mcount_loc[]; | 4004 | extern unsigned long __start_mcount_loc[]; |
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index e5125677efa0..3c13e46d7d24 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -2899,6 +2899,8 @@ tracing_trace_options_write(struct file *filp, const char __user *ubuf, | |||
2899 | if (copy_from_user(&buf, ubuf, cnt)) | 2899 | if (copy_from_user(&buf, ubuf, cnt)) |
2900 | return -EFAULT; | 2900 | return -EFAULT; |
2901 | 2901 | ||
2902 | buf[cnt] = 0; | ||
2903 | |||
2902 | trace_set_options(buf); | 2904 | trace_set_options(buf); |
2903 | 2905 | ||
2904 | *ppos += cnt; | 2906 | *ppos += cnt; |
@@ -3452,7 +3454,7 @@ static int tracing_wait_pipe(struct file *filp) | |||
3452 | return -EINTR; | 3454 | return -EINTR; |
3453 | 3455 | ||
3454 | /* | 3456 | /* |
3455 | * We block until we read something and tracing is enabled. | 3457 | * We block until we read something and tracing is disabled. |
3456 | * We still block if tracing is disabled, but we have never | 3458 | * We still block if tracing is disabled, but we have never |
3457 | * read anything. This allows a user to cat this file, and | 3459 | * read anything. This allows a user to cat this file, and |
3458 | * then enable tracing. But after we have read something, | 3460 | * then enable tracing. But after we have read something, |
@@ -3460,7 +3462,7 @@ static int tracing_wait_pipe(struct file *filp) | |||
3460 | * | 3462 | * |
3461 | * iter->pos will be 0 if we haven't read anything. | 3463 | * iter->pos will be 0 if we haven't read anything. |
3462 | */ | 3464 | */ |
3463 | if (tracing_is_enabled() && iter->pos) | 3465 | if (!tracing_is_enabled() && iter->pos) |
3464 | break; | 3466 | break; |
3465 | } | 3467 | } |
3466 | 3468 | ||
@@ -4815,10 +4817,17 @@ rb_simple_write(struct file *filp, const char __user *ubuf, | |||
4815 | return ret; | 4817 | return ret; |
4816 | 4818 | ||
4817 | if (buffer) { | 4819 | if (buffer) { |
4818 | if (val) | 4820 | mutex_lock(&trace_types_lock); |
4821 | if (val) { | ||
4819 | ring_buffer_record_on(buffer); | 4822 | ring_buffer_record_on(buffer); |
4820 | else | 4823 | if (current_trace->start) |
4824 | current_trace->start(tr); | ||
4825 | } else { | ||
4821 | ring_buffer_record_off(buffer); | 4826 | ring_buffer_record_off(buffer); |
4827 | if (current_trace->stop) | ||
4828 | current_trace->stop(tr); | ||
4829 | } | ||
4830 | mutex_unlock(&trace_types_lock); | ||
4822 | } | 4831 | } |
4823 | 4832 | ||
4824 | (*ppos)++; | 4833 | (*ppos)++; |