mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
tracing/fprobe: Enable fprobe events with CONFIG_DYNAMIC_FTRACE_WITH_ARGS
Allow fprobe events to be enabled with CONFIG_DYNAMIC_FTRACE_WITH_ARGS. With this change, fprobe events mostly use ftrace_regs instead of pt_regs. Note that if the arch doesn't enable HAVE_FTRACE_REGS_HAVING_PT_REGS, fprobe events will not be able to be used from perf. Cc: Alexei Starovoitov <alexei.starovoitov@gmail.com> Cc: Florent Revest <revest@chromium.org> Cc: Martin KaFai Lau <martin.lau@linux.dev> Cc: bpf <bpf@vger.kernel.org> Cc: Alexei Starovoitov <ast@kernel.org> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Alan Maguire <alan.maguire@oracle.com> Cc: Mark Rutland <mark.rutland@arm.com> Link: https://lore.kernel.org/173518999352.391279.13332699755290175168.stgit@devnote2 Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
This commit is contained in:
committed by
Steven Rostedt (Google)
parent
d5d01b7199
commit
0566cefe73
@@ -250,6 +250,23 @@ static __always_inline bool ftrace_regs_has_args(struct ftrace_regs *fregs)
|
||||
return ftrace_get_regs(fregs) != NULL;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_HAVE_REGS_AND_STACK_ACCESS_API
|
||||
static __always_inline unsigned long
|
||||
ftrace_regs_get_kernel_stack_nth(struct ftrace_regs *fregs, unsigned int nth)
|
||||
{
|
||||
unsigned long *stackp;
|
||||
|
||||
stackp = (unsigned long *)ftrace_regs_get_stack_pointer(fregs);
|
||||
if (((unsigned long)(stackp + nth) & ~(THREAD_SIZE - 1)) ==
|
||||
((unsigned long)stackp & ~(THREAD_SIZE - 1)))
|
||||
return *(stackp + nth);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#else /* !CONFIG_HAVE_REGS_AND_STACK_ACCESS_API */
|
||||
#define ftrace_regs_get_kernel_stack_nth(fregs, nth) (0L)
|
||||
#endif /* CONFIG_HAVE_REGS_AND_STACK_ACCESS_API */
|
||||
|
||||
typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip,
|
||||
struct ftrace_ops *op, struct ftrace_regs *fregs);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user