Commit e00888b4 authored by Jan Kiszka's avatar Jan Kiszka
Browse files

ipipe: Register function tracer for direct and exclusive invocation



The current I-pipe tracer is best called directly from mcount. This
reduces the overhead and avoids troubles with intermediate trampoline
functions /wrt locking.

We can revise this once our RT domains are compatible with preemption
and RCU based locking, or we are even able to replace the I-pipe tracer
with ftrace.
Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
parent 5d353a3e
......@@ -98,6 +98,7 @@ enum {
FTRACE_OPS_FL_SAVE_REGS = 1 << 4,
FTRACE_OPS_FL_SAVE_REGS_IF_SUPPORTED = 1 << 5,
FTRACE_OPS_FL_RECURSION_SAFE = 1 << 6,
FTRACE_OPS_FL_IPIPE_EXCLUSIVE = 1 << 7,
};
struct ftrace_ops {
......
......@@ -1305,7 +1305,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 int __ipipe_wr_enable(struct file *file, const char __user *buffer,
......
......@@ -238,10 +238,19 @@ static void update_global_ops(void)
static void update_ftrace_function(void)
{
struct ftrace_ops *ops;
ftrace_func_t func;
update_global_ops();
for (ops = ftrace_ops_list;
ops != &ftrace_list_end; ops = ops->next)
if (ops->flags & FTRACE_OPS_FL_IPIPE_EXCLUSIVE) {
function_trace_op = ops;
ftrace_trace_function = ops->func;
return;
}
/*
* If we are at the end of the list and this ops is
* recursion safe and not dynamic and the arch supports passing ops,
......
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