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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 23 Apr 2023 09:41:54 +0200
From:   Jiri Olsa <olsajiri@...il.com>
To:     "Masami Hiramatsu (Google)" <mhiramat@...nel.org>
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 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?

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ