[DTrace-devel] [PATCH 02/04] options: ensure lockmem is set before retrieving probe info

Eugene Loh eugene.loh at oracle.com
Thu Nov 23 02:52:50 UTC 2023


Reviewed-by: Eugene Loh <eugene.loh at oracle.com>
subject to moving lockmem stuff from the previous patch into this one.

Also...

On 11/22/23 10:49, Kris Van Hees via DTrace-devel wrote:
> diff --git a/libdtrace/dt_open.c b/libdtrace/dt_open.c
> @@ -1173,13 +1173,24 @@ dtrace_vopen(int version, int flags, int *errp,
>   int
>   dtrace_init(dtrace_hdl_t *dtp)
>   {
> -	int	i;
> +	int		i;
> +	dtrace_optval_t	lockmem = dtp->dt_options[DTRACEOPT_LOCKMEM];
>   
>   	/*
>   	 * Initialize the BPF library handling.
>   	 */
>   	dt_dlib_init(dtp);
>   
> +	/*
> +	 * Set the locked-memory limit if so directed by the user.
> +	 */
> +        if (lockmem != DTRACEOPT_UNSET) {
> +		struct rlimit	rl;
> +
> +                rl.rlim_cur = rl.rlim_max = lockmem;
> +                setrlimit(RLIMIT_MEMLOCK, &rl);
> +        }
> +

Four of those lines have leading spaces rather than tabs.



More information about the DTrace-devel mailing list