lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZEYx+2WWixBkDbTn@krava>
Date:   Mon, 24 Apr 2023 09:38:35 +0200
From:   Jiri Olsa <olsajiri@...il.com>
To:     Masami Hiramatsu <mhiramat@...nel.org>
Cc:     Jiri Olsa <olsajiri@...il.com>, 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, Apr 23, 2023 at 10:37:40PM +0900, Masami Hiramatsu wrote:
> 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.
> ----

so this basically adds another way of attaching to tracepoint through ftrace
dynamic_events file interface.. but we can already attach to tracepoints
through ftrace via /sys/kernel/debug/tracing/events/* right?

I'm trying to find out what's the config for which this new way of attaching
tracepoints is useful

thanks,
jirka

> 
> > 
> > > +	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

Powered by Openwall GNU/*/Linux Powered by OpenVZ