[DTrace-devel] [PATCH 10/12] Add support for built-in variable ucaller

Kris Van Hees kris.van.hees at oracle.com
Fri Jun 11 12:29:22 PDT 2021


Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>

On Fri, May 28, 2021 at 02:35:14PM -0400, eugene.loh at oracle.com wrote:
> From: Eugene Loh <eugene.loh at oracle.com>
> 
> Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
> ---
>  bpf/get_bvar.c                             | 6 +++++-
>  test/unittest/variables/bvar/tst.ucaller.d | 1 -
>  2 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/bpf/get_bvar.c b/bpf/get_bvar.c
> index 570334f9..f41de548 100644
> --- a/bpf/get_bvar.c
> +++ b/bpf/get_bvar.c
> @@ -78,10 +78,14 @@ noinline uint64_t dt_get_bvar(dt_dctx_t *dctx, uint32_t id)
>  		 */
>  		return copylen / 8;
>  	}
> -	case DIF_VAR_CALLER: {
> +	case DIF_VAR_CALLER:
> +	case DIF_VAR_UCALLER: {
>  		uint64_t flags = 0 & BPF_F_SKIP_FIELD_MASK;
>  		uint64_t buf[2];
>  
> +		if (id == DIF_VAR_UCALLER)
> +			flags |= BPF_F_USER_STACK;
> +
>  		if (bpf_get_stack(dctx->ctx, buf, 16, flags) < 0)
>  			return 0;
>  		return buf[1];
> diff --git a/test/unittest/variables/bvar/tst.ucaller.d b/test/unittest/variables/bvar/tst.ucaller.d
> index 930f10e8..eef56fd4 100644
> --- a/test/unittest/variables/bvar/tst.ucaller.d
> +++ b/test/unittest/variables/bvar/tst.ucaller.d
> @@ -4,7 +4,6 @@
>   * Licensed under the Universal Permissive License v 1.0 as shown at
>   * http://oss.oracle.com/licenses/upl.
>   */
> -/* @@xfail: dtv2 */
>  
>  /*
>   * ASSERTION: The 'ucaller' variable can be accessed and is not -1.
> -- 
> 2.18.4
> 
> 
> _______________________________________________
> DTrace-devel mailing list
> DTrace-devel at oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/dtrace-devel



More information about the DTrace-devel mailing list