lkml.org 
[lkml]   [2023]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v5 4/9] tracing/probes: Add tracepoint support on fprobe_event
On Thu, Apr 20, 2023 at 08:26:10PM +0900, Masami Hiramatsu (Google) wrote:
> From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
>
> Allow fprobe_event to trace raw tracepoints so that user can trace
> tracepoints which don't have traceevent wrappers. This new event is
> always available if fprobe event is enabled since the tracepoint is
> disabled, trace-event and dynamic event is also not available.

I thought of ftrace tracepoints wrappers as standard in distros,
could you specify which config options that involves?

> + if (trace_fprobe_is_tracepoint(tf)) {
> + struct tracepoint *tpoint = tf->tpoint;
> + unsigned long ip = (unsigned long)tpoint->probestub;
> + /*
> + * Here, we do 2 steps to enable fprobe on a tracepoint.
> + * At first, put __probestub_##TP function on the tracepoint
> + * and put a fprobe on the stub function.
> + */
> + ret = tracepoint_probe_register_prio_may_exist(tpoint,
> + tpoint->probestub, NULL, 0);
> + if (ret < 0)
> + return ret;
> + return register_fprobe_ips(&tf->fp, &ip, 1);

nice idea

jirka

> + }
> +
> /* TODO: handle filter, nofilter or symbol list */
> return register_fprobe(&tf->fp, tf->symbol, NULL);
> }
> @@ -699,6 +723,12 @@ static void __unregister_trace_fprobe(struct trace_fprobe *tf)
> if (trace_fprobe_is_registered(tf)) {
> unregister_fprobe(&tf->fp);
> memset(&tf->fp, 0, sizeof(tf->fp));
> + if (trace_fprobe_is_tracepoint(tf)) {
> + tracepoint_probe_unregister(tf->tpoint,
> + tf->tpoint->probestub, NULL);
> + tf->tpoint = NULL;
> + tf->mod = NULL;
> + }
> }
> }

SNIP

\
 
 \ /
  Last update: 2023-04-23 09:43    [W:0.188 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site