lkml.org 
[lkml]   [2019]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[for-next][PATCH 4/5] function_graph: Use a ftrace_graph_ret_stub() for return
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

There's a unique ftrace_graph_entry_stub() for the entryfunc of a
fgraph_ops, but the ftrace_stub is used for the retfunc(). To be consistent
and also to use the same type of function as the type being called for
retfunc(), create and use ftrace_graph_ret_stub().

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
kernel/trace/fgraph.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/kernel/trace/fgraph.c b/kernel/trace/fgraph.c
index 8dfd5021b933..580ce7534a49 100644
--- a/kernel/trace/fgraph.c
+++ b/kernel/trace/fgraph.c
@@ -327,14 +327,17 @@ void ftrace_graph_sleep_time_control(bool enable)
fgraph_sleep_time = enable;
}

+static void ftrace_graph_ret_stub(struct ftrace_graph_ret *trace)
+{
+}
+
int ftrace_graph_entry_stub(struct ftrace_graph_ent *trace)
{
return 0;
}

/* The callbacks that hook a function */
-trace_func_graph_ret_t ftrace_graph_return =
- (trace_func_graph_ret_t)ftrace_stub;
+trace_func_graph_ret_t ftrace_graph_return = ftrace_graph_ret_stub;
trace_func_graph_ent_t ftrace_graph_entry = ftrace_graph_entry_stub;
static trace_func_graph_ent_t __ftrace_graph_entry = ftrace_graph_entry_stub;

@@ -614,7 +617,7 @@ void unregister_ftrace_graph(struct fgraph_ops *gops)
goto out;

ftrace_graph_active--;
- ftrace_graph_return = (trace_func_graph_ret_t)ftrace_stub;
+ ftrace_graph_return = ftrace_graph_ret_stub;
ftrace_graph_entry = ftrace_graph_entry_stub;
__ftrace_graph_entry = ftrace_graph_entry_stub;
ftrace_shutdown(&graph_ops, FTRACE_STOP_FUNC_RET);
--
2.20.1

\
 
 \ /
  Last update: 2019-04-25 18:29    [W:2.340 / U:1.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site