aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/trace')
-rw-r--r--kernel/trace/trace_functions_graph.c66
1 files changed, 62 insertions, 4 deletions
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index af60eef4cbcc..4bf39fcae97a 100644
--- a/kernel/trace/trace_functions_graph.c
+++ b/kernel/trace/trace_functions_graph.c
@@ -231,6 +231,49 @@ trace_branch_is_leaf(struct trace_iterator *iter,
231 return true; 231 return true;
232} 232}
233 233
234static enum print_line_t
235print_graph_irq(struct trace_seq *s, unsigned long addr,
236 enum trace_type type, int cpu, pid_t pid)
237{
238 int ret;
239
240 if (addr < (unsigned long)__irqentry_text_start ||
241 addr >= (unsigned long)__irqentry_text_end)
242 return TRACE_TYPE_UNHANDLED;
243
244 if (type == TRACE_GRAPH_ENT) {
245 ret = trace_seq_printf(s, "==========> | ");
246 } else {
247 /* Cpu */
248 if (tracer_flags.val & TRACE_GRAPH_PRINT_CPU) {
249 ret = print_graph_cpu(s, cpu);
250 if (ret == TRACE_TYPE_PARTIAL_LINE)
251 return TRACE_TYPE_PARTIAL_LINE;
252 }
253 /* Proc */
254 if (tracer_flags.val & TRACE_GRAPH_PRINT_PROC) {
255 ret = print_graph_proc(s, pid);
256 if (ret == TRACE_TYPE_PARTIAL_LINE)
257 return TRACE_TYPE_PARTIAL_LINE;
258
259 ret = trace_seq_printf(s, " | ");
260 if (!ret)
261 return TRACE_TYPE_PARTIAL_LINE;
262 }
263
264 /* No overhead */
265 if (tracer_flags.val & TRACE_GRAPH_PRINT_OVERHEAD) {
266 ret = trace_seq_printf(s, " ");
267 if (!ret)
268 return TRACE_TYPE_PARTIAL_LINE;
269 }
270
271 ret = trace_seq_printf(s, "<========== |\n");
272 }
273 if (!ret)
274 return TRACE_TYPE_PARTIAL_LINE;
275 return TRACE_TYPE_HANDLED;
276}
234 277
235static enum print_line_t 278static enum print_line_t
236print_graph_duration(unsigned long long duration, struct trace_seq *s) 279print_graph_duration(unsigned long long duration, struct trace_seq *s)
@@ -344,7 +387,7 @@ print_graph_entry_leaf(struct trace_iterator *iter,
344 387
345static enum print_line_t 388static enum print_line_t
346print_graph_entry_nested(struct ftrace_graph_ent_entry *entry, 389print_graph_entry_nested(struct ftrace_graph_ent_entry *entry,
347 struct trace_seq *s) 390 struct trace_seq *s, pid_t pid, int cpu)
348{ 391{
349 int i; 392 int i;
350 int ret; 393 int ret;
@@ -357,8 +400,18 @@ print_graph_entry_nested(struct ftrace_graph_ent_entry *entry,
357 return TRACE_TYPE_PARTIAL_LINE; 400 return TRACE_TYPE_PARTIAL_LINE;
358 } 401 }
359 402
360 /* No time */ 403 /* Interrupt */
361 ret = trace_seq_printf(s, " | "); 404 ret = print_graph_irq(s, call->func, TRACE_GRAPH_ENT, cpu, pid);
405 if (ret == TRACE_TYPE_UNHANDLED) {
406 /* No time */
407 ret = trace_seq_printf(s, " | ");
408 if (!ret)
409 return TRACE_TYPE_PARTIAL_LINE;
410 } else {
411 if (ret == TRACE_TYPE_PARTIAL_LINE)
412 return TRACE_TYPE_PARTIAL_LINE;
413 }
414
362 415
363 /* Function */ 416 /* Function */
364 for (i = 0; i < call->depth * TRACE_GRAPH_INDENT; i++) { 417 for (i = 0; i < call->depth * TRACE_GRAPH_INDENT; i++) {
@@ -410,7 +463,7 @@ print_graph_entry(struct ftrace_graph_ent_entry *field, struct trace_seq *s,
410 if (trace_branch_is_leaf(iter, field)) 463 if (trace_branch_is_leaf(iter, field))
411 return print_graph_entry_leaf(iter, field, s); 464 return print_graph_entry_leaf(iter, field, s);
412 else 465 else
413 return print_graph_entry_nested(field, s); 466 return print_graph_entry_nested(field, s, iter->ent->pid, cpu);
414 467
415} 468}
416 469
@@ -474,6 +527,11 @@ print_graph_return(struct ftrace_graph_ret *trace, struct trace_seq *s,
474 if (!ret) 527 if (!ret)
475 return TRACE_TYPE_PARTIAL_LINE; 528 return TRACE_TYPE_PARTIAL_LINE;
476 } 529 }
530
531 ret = print_graph_irq(s, trace->func, TRACE_GRAPH_RET, cpu, ent->pid);
532 if (ret == TRACE_TYPE_PARTIAL_LINE)
533 return TRACE_TYPE_PARTIAL_LINE;
534
477 return TRACE_TYPE_HANDLED; 535 return TRACE_TYPE_HANDLED;
478} 536}
479 537