Commit 4c685e1f authored by Gilles Chanteperdrix's avatar Gilles Chanteperdrix
Browse files

Revert "Revert "ipipe: Register function tracer for direct and exclusive invocation""

This reverts commit b115c409.
parent 4ac08725
......@@ -134,6 +134,7 @@ enum {
FTRACE_OPS_FL_ALLOC_TRAMP = 1 << 12,
FTRACE_OPS_FL_IPMODIFY = 1 << 13,
FTRACE_OPS_FL_PID = 1 << 14,
FTRACE_OPS_FL_IPIPE_EXCLUSIVE = 1 << 15,
};
#ifdef CONFIG_DYNAMIC_FTRACE
......
......@@ -1332,7 +1332,7 @@ ipipe_trace_function(unsigned long ip, unsigned long parent_ip,
static struct ftrace_ops ipipe_trace_ops = {
.func = ipipe_trace_function,
.flags = FTRACE_OPS_FL_RECURSION_SAFE,
.flags = FTRACE_OPS_FL_IPIPE_EXCLUSIVE,
};
static ssize_t __ipipe_wr_enable(struct file *file, const char __user *buffer,
......
......@@ -263,8 +263,17 @@ static ftrace_func_t ftrace_ops_get_list_func(struct ftrace_ops *ops)
static void update_ftrace_function(void)
{
struct ftrace_ops *ops;
ftrace_func_t func;
for (ops = ftrace_ops_list;
ops != &ftrace_list_end; ops = ops->next)
if (ops->flags & FTRACE_OPS_FL_IPIPE_EXCLUSIVE) {
set_function_trace_op = ops;
func = ops->func;
goto set_pointers;
}
/*
* Prepare the ftrace_ops that the arch callback will use.
* If there's only one ftrace_ops registered, the ftrace_ops_list
......@@ -292,6 +301,7 @@ static void update_ftrace_function(void)
update_function_graph_func();
set_pointers:
/* If there's no change, then do nothing more here */
if (ftrace_trace_function == func)
return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment