[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230423223740.9f1186a08b3b316b5a0156e7@kernel.org>
Date: Sun, 23 Apr 2023 22:37:40 +0900
From: Masami Hiramatsu (Google) <mhiramat@...nel.org>
To: Jiri Olsa <olsajiri@...il.com>
Cc: linux-trace-kernel@...r.kernel.org, linux-kernel@...r.kernel.org,
Steven Rostedt <rostedt@...dmis.org>,
Florent Revest <revest@...omium.org>,
Mark Rutland <mark.rutland@....com>,
Will Deacon <will@...nel.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Martin KaFai Lau <martin.lau@...ux.dev>, bpf@...r.kernel.org
Subject: Re: [PATCH v5 4/9] tracing/probes: Add tracepoint support on
fprobe_event
On Sun, 23 Apr 2023 09:41:54 +0200
Jiri Olsa <olsajiri@...il.com> wrote:
> On Thu, Apr 20, 2023 at 08:26:10PM +0900, Masami Hiramatsu (Google) wrote:
> > From: Masami Hiramatsu (Google) <mhiramat@...nel.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?
Ah, sorry, I'm completely confused you.
----
This new event is always available if fprobe event is enabled. If the
tracepoint is disabled, trace-event and dynamic event including
fprobe is also not available.
----
>
> > + 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
Thanks!
>
> 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
--
Masami Hiramatsu (Google) <mhiramat@...nel.org>
Powered by blists - more mailing lists