Re: [PATCH v7 04/11] tracing/probes: Add tracepoint support on fprobe_events

From: Google
Date: Thu Apr 27 2023 - 21:22:35 EST


On Thu, 27 Apr 2023 13:59:03 +0200
Jiri Olsa <olsajiri@xxxxxxxxx> wrote:

> On Thu, Apr 27, 2023 at 10:18:24AM +0900, Masami Hiramatsu (Google) wrote:
>
> SNIP
>
> > ret = traceprobe_parse_probe_arg(&ep->tp, i, argv[i], flags);
> > diff --git a/kernel/trace/trace_fprobe.c b/kernel/trace/trace_fprobe.c
> > index 0049d9ef2402..7c8be8a3616f 100644
> > --- a/kernel/trace/trace_fprobe.c
> > +++ b/kernel/trace/trace_fprobe.c
> > @@ -9,6 +9,7 @@
> > #include <linux/module.h>
> > #include <linux/rculist.h>
> > #include <linux/security.h>
> > +#include <linux/tracepoint.h>
> > #include <linux/uaccess.h>
> >
> > #include "trace_dynevent.h"
> > @@ -17,6 +18,7 @@
> > #include "trace_probe_tmpl.h"
> >
> > #define FPROBE_EVENT_SYSTEM "fprobes"
> > +#define TRACEPOINT_EVENT_SYSTEM "tracepoints"
>
> so the created tracepoints go under 'events/tracepoints' directory,
> should the name be more fprobe specific? like under 'events/fprobe/tracepoints' ?

No, because trace event only support single-level class directory, and
I think this can provide a more abstract interface to the user.

Thanks,

>
> jirka
>
> > #define RETHOOK_MAXACTIVE_MAX 4096
> >
> > static int trace_fprobe_create(const char *raw_command);
> > @@ -41,6 +43,8 @@ struct trace_fprobe {
> > struct dyn_event devent;
> > struct fprobe fp;
> > const char *symbol;
> > + struct tracepoint *tpoint;
> > + struct module *mod;
> > struct trace_probe tp;
> > };
> >
> > @@ -68,6 +72,11 @@ static bool trace_fprobe_is_return(struct trace_fprobe *tf)
> > return tf->fp.exit_handler != NULL;
> > }
> >
> > +static bool trace_fprobe_is_tracepoint(struct trace_fprobe *tf)
> > +{
> > + return tf->tpoint != NULL;
> > +}
> > +
>
> SNIP


--
Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>