diff options
Diffstat (limited to 'kernel/trace/trace_functions_graph.c')
-rw-r--r-- | kernel/trace/trace_functions_graph.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c index baeb5fe3610..8b592418d8b 100644 --- a/kernel/trace/trace_functions_graph.c +++ b/kernel/trace/trace_functions_graph.c | |||
@@ -84,13 +84,14 @@ ftrace_push_return_trace(unsigned long ret, unsigned long func, int *depth) | |||
84 | current->ret_stack[index].ret = ret; | 84 | current->ret_stack[index].ret = ret; |
85 | current->ret_stack[index].func = func; | 85 | current->ret_stack[index].func = func; |
86 | current->ret_stack[index].calltime = calltime; | 86 | current->ret_stack[index].calltime = calltime; |
87 | current->ret_stack[index].subtime = 0; | ||
87 | *depth = index; | 88 | *depth = index; |
88 | 89 | ||
89 | return 0; | 90 | return 0; |
90 | } | 91 | } |
91 | 92 | ||
92 | /* Retrieve a function return address to the trace stack on thread info.*/ | 93 | /* Retrieve a function return address to the trace stack on thread info.*/ |
93 | void | 94 | static void |
94 | ftrace_pop_return_trace(struct ftrace_graph_ret *trace, unsigned long *ret) | 95 | ftrace_pop_return_trace(struct ftrace_graph_ret *trace, unsigned long *ret) |
95 | { | 96 | { |
96 | int index; | 97 | int index; |
@@ -110,9 +111,6 @@ ftrace_pop_return_trace(struct ftrace_graph_ret *trace, unsigned long *ret) | |||
110 | trace->calltime = current->ret_stack[index].calltime; | 111 | trace->calltime = current->ret_stack[index].calltime; |
111 | trace->overrun = atomic_read(¤t->trace_overrun); | 112 | trace->overrun = atomic_read(¤t->trace_overrun); |
112 | trace->depth = index; | 113 | trace->depth = index; |
113 | barrier(); | ||
114 | current->curr_ret_stack--; | ||
115 | |||
116 | } | 114 | } |
117 | 115 | ||
118 | /* | 116 | /* |
@@ -127,6 +125,8 @@ unsigned long ftrace_return_to_handler(void) | |||
127 | ftrace_pop_return_trace(&trace, &ret); | 125 | ftrace_pop_return_trace(&trace, &ret); |
128 | trace.rettime = trace_clock_local(); | 126 | trace.rettime = trace_clock_local(); |
129 | ftrace_graph_return(&trace); | 127 | ftrace_graph_return(&trace); |
128 | barrier(); | ||
129 | current->curr_ret_stack--; | ||
130 | 130 | ||
131 | if (unlikely(!ret)) { | 131 | if (unlikely(!ret)) { |
132 | ftrace_graph_stop(); | 132 | ftrace_graph_stop(); |
@@ -432,8 +432,8 @@ print_graph_irq(struct trace_iterator *iter, unsigned long addr, | |||
432 | return TRACE_TYPE_HANDLED; | 432 | return TRACE_TYPE_HANDLED; |
433 | } | 433 | } |
434 | 434 | ||
435 | static enum print_line_t | 435 | enum print_line_t |
436 | print_graph_duration(unsigned long long duration, struct trace_seq *s) | 436 | trace_print_graph_duration(unsigned long long duration, struct trace_seq *s) |
437 | { | 437 | { |
438 | unsigned long nsecs_rem = do_div(duration, 1000); | 438 | unsigned long nsecs_rem = do_div(duration, 1000); |
439 | /* log10(ULONG_MAX) + '\0' */ | 439 | /* log10(ULONG_MAX) + '\0' */ |
@@ -470,12 +470,23 @@ print_graph_duration(unsigned long long duration, struct trace_seq *s) | |||
470 | if (!ret) | 470 | if (!ret) |
471 | return TRACE_TYPE_PARTIAL_LINE; | 471 | return TRACE_TYPE_PARTIAL_LINE; |
472 | } | 472 | } |
473 | return TRACE_TYPE_HANDLED; | ||
474 | } | ||
475 | |||
476 | static enum print_line_t | ||
477 | print_graph_duration(unsigned long long duration, struct trace_seq *s) | ||
478 | { | ||
479 | int ret; | ||
480 | |||
481 | ret = trace_print_graph_duration(duration, s); | ||
482 | if (ret != TRACE_TYPE_HANDLED) | ||
483 | return ret; | ||
473 | 484 | ||
474 | ret = trace_seq_printf(s, "| "); | 485 | ret = trace_seq_printf(s, "| "); |
475 | if (!ret) | 486 | if (!ret) |
476 | return TRACE_TYPE_PARTIAL_LINE; | 487 | return TRACE_TYPE_PARTIAL_LINE; |
477 | return TRACE_TYPE_HANDLED; | ||
478 | 488 | ||
489 | return TRACE_TYPE_HANDLED; | ||
479 | } | 490 | } |
480 | 491 | ||
481 | /* Case of a leaf function on its call entry */ | 492 | /* Case of a leaf function on its call entry */ |