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.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 8b6409a62b54..710b39acd81b 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -1209,6 +1209,9 @@ int trace_graph_entry(struct ftrace_graph_ent *trace)
1209 int cpu; 1209 int cpu;
1210 int pc; 1210 int pc;
1211 1211
1212 if (!ftrace_graph_addr(trace->func))
1213 return 0;
1214
1212 local_irq_save(flags); 1215 local_irq_save(flags);
1213 cpu = raw_smp_processor_id(); 1216 cpu = raw_smp_processor_id();
1214 data = tr->data[cpu]; 1217 data = tr->data[cpu];
@@ -1217,6 +1220,9 @@ int trace_graph_entry(struct ftrace_graph_ent *trace)
1217 pc = preempt_count(); 1220 pc = preempt_count();
1218 __trace_graph_entry(tr, data, trace, flags, pc); 1221 __trace_graph_entry(tr, data, trace, flags, pc);
1219 } 1222 }
1223 /* Only do the atomic if it is not already set */
1224 if (!test_tsk_trace_graph(current))
1225 set_tsk_trace_graph(current);
1220 atomic_dec(&data->disabled); 1226 atomic_dec(&data->disabled);
1221 local_irq_restore(flags); 1227 local_irq_restore(flags);
1222 1228
@@ -1240,6 +1246,8 @@ void trace_graph_return(struct ftrace_graph_ret *trace)
1240 pc = preempt_count(); 1246 pc = preempt_count();
1241 __trace_graph_return(tr, data, trace, flags, pc); 1247 __trace_graph_return(tr, data, trace, flags, pc);
1242 } 1248 }
1249 if (!trace->depth)
1250 clear_tsk_trace_graph(current);
1243 atomic_dec(&data->disabled); 1251 atomic_dec(&data->disabled);
1244 local_irq_restore(flags); 1252 local_irq_restore(flags);
1245} 1253}