diff options
-rw-r--r-- | arch/x86/kernel/ftrace.c | 6 | ||||
-rw-r--r-- | include/linux/ftrace.h | 3 | ||||
-rw-r--r-- | kernel/trace/trace_functions_graph.c | 8 |
3 files changed, 7 insertions, 10 deletions
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c index 57b33edb7ce3..61df77532120 100644 --- a/arch/x86/kernel/ftrace.c +++ b/arch/x86/kernel/ftrace.c | |||
@@ -410,7 +410,6 @@ int ftrace_disable_ftrace_graph_caller(void) | |||
410 | void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr) | 410 | void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr) |
411 | { | 411 | { |
412 | unsigned long old; | 412 | unsigned long old; |
413 | unsigned long long calltime; | ||
414 | int faulted; | 413 | int faulted; |
415 | struct ftrace_graph_ent trace; | 414 | struct ftrace_graph_ent trace; |
416 | unsigned long return_hooker = (unsigned long) | 415 | unsigned long return_hooker = (unsigned long) |
@@ -453,10 +452,7 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr) | |||
453 | return; | 452 | return; |
454 | } | 453 | } |
455 | 454 | ||
456 | calltime = trace_clock_local(); | 455 | if (ftrace_push_return_trace(old, self_addr, &trace.depth) == -EBUSY) { |
457 | |||
458 | if (ftrace_push_return_trace(old, calltime, | ||
459 | self_addr, &trace.depth) == -EBUSY) { | ||
460 | *parent = old; | 456 | *parent = old; |
461 | return; | 457 | return; |
462 | } | 458 | } |
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index db3fed630db3..1141248c84ee 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -369,8 +369,7 @@ struct ftrace_ret_stack { | |||
369 | extern void return_to_handler(void); | 369 | extern void return_to_handler(void); |
370 | 370 | ||
371 | extern int | 371 | extern int |
372 | ftrace_push_return_trace(unsigned long ret, unsigned long long time, | 372 | ftrace_push_return_trace(unsigned long ret, unsigned long func, int *depth); |
373 | unsigned long func, int *depth); | ||
374 | extern void | 373 | extern void |
375 | ftrace_pop_return_trace(struct ftrace_graph_ret *trace, unsigned long *ret); | 374 | ftrace_pop_return_trace(struct ftrace_graph_ret *trace, unsigned long *ret); |
376 | 375 | ||
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c index e876816fa8e7..d28687e7b3a7 100644 --- a/kernel/trace/trace_functions_graph.c +++ b/kernel/trace/trace_functions_graph.c | |||
@@ -57,9 +57,9 @@ static struct tracer_flags tracer_flags = { | |||
57 | 57 | ||
58 | /* Add a function return address to the trace stack on thread info.*/ | 58 | /* Add a function return address to the trace stack on thread info.*/ |
59 | int | 59 | int |
60 | ftrace_push_return_trace(unsigned long ret, unsigned long long time, | 60 | ftrace_push_return_trace(unsigned long ret, unsigned long func, int *depth) |
61 | unsigned long func, int *depth) | ||
62 | { | 61 | { |
62 | unsigned long long calltime; | ||
63 | int index; | 63 | int index; |
64 | 64 | ||
65 | if (!current->ret_stack) | 65 | if (!current->ret_stack) |
@@ -71,11 +71,13 @@ ftrace_push_return_trace(unsigned long ret, unsigned long long time, | |||
71 | return -EBUSY; | 71 | return -EBUSY; |
72 | } | 72 | } |
73 | 73 | ||
74 | calltime = trace_clock_local(); | ||
75 | |||
74 | index = ++current->curr_ret_stack; | 76 | index = ++current->curr_ret_stack; |
75 | barrier(); | 77 | barrier(); |
76 | current->ret_stack[index].ret = ret; | 78 | current->ret_stack[index].ret = ret; |
77 | current->ret_stack[index].func = func; | 79 | current->ret_stack[index].func = func; |
78 | current->ret_stack[index].calltime = time; | 80 | current->ret_stack[index].calltime = calltime; |
79 | *depth = index; | 81 | *depth = index; |
80 | 82 | ||
81 | return 0; | 83 | return 0; |