aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r--kernel/trace/trace.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index d345d649d073..8a499e2adaec 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -34,6 +34,7 @@
34 34
35#include <linux/stacktrace.h> 35#include <linux/stacktrace.h>
36#include <linux/ring_buffer.h> 36#include <linux/ring_buffer.h>
37#include <linux/irqflags.h>
37 38
38#include "trace.h" 39#include "trace.h"
39 40
@@ -655,7 +656,11 @@ tracing_generic_entry_update(struct trace_entry *entry, unsigned long flags,
655 entry->preempt_count = pc & 0xff; 656 entry->preempt_count = pc & 0xff;
656 entry->pid = (tsk) ? tsk->pid : 0; 657 entry->pid = (tsk) ? tsk->pid : 0;
657 entry->flags = 658 entry->flags =
659#ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT
658 (irqs_disabled_flags(flags) ? TRACE_FLAG_IRQS_OFF : 0) | 660 (irqs_disabled_flags(flags) ? TRACE_FLAG_IRQS_OFF : 0) |
661#else
662 TRACE_FLAG_IRQS_NOSUPPORT |
663#endif
659 ((pc & HARDIRQ_MASK) ? TRACE_FLAG_HARDIRQ : 0) | 664 ((pc & HARDIRQ_MASK) ? TRACE_FLAG_HARDIRQ : 0) |
660 ((pc & SOFTIRQ_MASK) ? TRACE_FLAG_SOFTIRQ : 0) | 665 ((pc & SOFTIRQ_MASK) ? TRACE_FLAG_SOFTIRQ : 0) |
661 (need_resched() ? TRACE_FLAG_NEED_RESCHED : 0); 666 (need_resched() ? TRACE_FLAG_NEED_RESCHED : 0);
@@ -851,7 +856,7 @@ ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3)
851 preempt_enable_notrace(); 856 preempt_enable_notrace();
852} 857}
853 858
854#ifdef CONFIG_FTRACE 859#ifdef CONFIG_FUNCTION_TRACER
855static void 860static void
856function_trace_call(unsigned long ip, unsigned long parent_ip) 861function_trace_call(unsigned long ip, unsigned long parent_ip)
857{ 862{
@@ -865,9 +870,6 @@ function_trace_call(unsigned long ip, unsigned long parent_ip)
865 if (unlikely(!ftrace_function_enabled)) 870 if (unlikely(!ftrace_function_enabled))
866 return; 871 return;
867 872
868 if (skip_trace(ip))
869 return;
870
871 pc = preempt_count(); 873 pc = preempt_count();
872 resched = need_resched(); 874 resched = need_resched();
873 preempt_disable_notrace(); 875 preempt_disable_notrace();
@@ -1246,7 +1248,8 @@ lat_print_generic(struct trace_seq *s, struct trace_entry *entry, int cpu)
1246 trace_seq_printf(s, "%8.8s-%-5d ", comm, entry->pid); 1248 trace_seq_printf(s, "%8.8s-%-5d ", comm, entry->pid);
1247 trace_seq_printf(s, "%3d", cpu); 1249 trace_seq_printf(s, "%3d", cpu);
1248 trace_seq_printf(s, "%c%c", 1250 trace_seq_printf(s, "%c%c",
1249 (entry->flags & TRACE_FLAG_IRQS_OFF) ? 'd' : '.', 1251 (entry->flags & TRACE_FLAG_IRQS_OFF) ? 'd' :
1252 (entry->flags & TRACE_FLAG_IRQS_NOSUPPORT) ? 'X' : '.',
1250 ((entry->flags & TRACE_FLAG_NEED_RESCHED) ? 'N' : '.')); 1253 ((entry->flags & TRACE_FLAG_NEED_RESCHED) ? 'N' : '.'));
1251 1254
1252 hardirq = entry->flags & TRACE_FLAG_HARDIRQ; 1255 hardirq = entry->flags & TRACE_FLAG_HARDIRQ;
@@ -2379,9 +2382,10 @@ tracing_set_trace_write(struct file *filp, const char __user *ubuf,
2379 int i; 2382 int i;
2380 size_t ret; 2383 size_t ret;
2381 2384
2385 ret = cnt;
2386
2382 if (cnt > max_tracer_type_len) 2387 if (cnt > max_tracer_type_len)
2383 cnt = max_tracer_type_len; 2388 cnt = max_tracer_type_len;
2384 ret = cnt;
2385 2389
2386 if (copy_from_user(&buf, ubuf, cnt)) 2390 if (copy_from_user(&buf, ubuf, cnt))
2387 return -EFAULT; 2391 return -EFAULT;
@@ -2414,8 +2418,8 @@ tracing_set_trace_write(struct file *filp, const char __user *ubuf,
2414 out: 2418 out:
2415 mutex_unlock(&trace_types_lock); 2419 mutex_unlock(&trace_types_lock);
2416 2420
2417 if (ret == cnt) 2421 if (ret > 0)
2418 filp->f_pos += cnt; 2422 filp->f_pos += ret;
2419 2423
2420 return ret; 2424 return ret;
2421} 2425}
@@ -3097,7 +3101,7 @@ void ftrace_dump(void)
3097 dump_ran = 1; 3101 dump_ran = 1;
3098 3102
3099 /* No turning back! */ 3103 /* No turning back! */
3100 ftrace_kill_atomic(); 3104 ftrace_kill();
3101 3105
3102 for_each_tracing_cpu(cpu) { 3106 for_each_tracing_cpu(cpu) {
3103 atomic_inc(&global_trace.data[cpu]->disabled); 3107 atomic_inc(&global_trace.data[cpu]->disabled);