[DTrace-devel] [PATCH 09/47] ensure global and TLS variables map to keys starting at 0

Eugene Loh eugene.loh at oracle.com
Sun May 3 20:16:52 PDT 2020


Global and TLS variables are assigned an id from DIF_VAR_OTHER_UBASE
onward in order to distinguish them from built-in global variables.
Up until now the code generator was applying a base offset to the
variable ids for debugging purposes.

This patch adds support for distinguishing built-in variables from
user defined global variables.  All variables in a specific class
or scope should be mapped to keys that are assigned from 0 onward.

Built-in variables are loaded using dt_get_bvar.
Global variables are loaded using dt_get_gvar, and stored using
dt_set_gvar.
TLS variables are loaded using dt_get_tvar, and stored using
dt_set_tvar.

This patch also adjusts the disassembler to ensure that it is able to
retrieve the correct variable name (and scope).

The support for TLS variables is still left unimplemented at this
point and it is therefore encoded as if they are regular global
variables.  A correct implementation is forthcoming.

The dt_get_bvar() BPF function is a placeholder that returns -1 for
every builtin variable.  This patch also adds a tests for the entire
collection of available builtin variables, and are expected to fail
(for now) because none of the actual builtin variables have been
implemented yet.

Orabug: 31220516
Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
---
 bpf/Build                                     |   1 +
 bpf/get_bvar.c                                |  17 +++
 libdtrace/dt_bpf_builtins.h                   |   1 +
 libdtrace/dt_cg.c                             | 119 +++++++++---------
 libdtrace/dt_dis.c                            |  22 +++-
 libdtrace/dt_dlibs.c                          |   1 +
 test/unittest/variables/bvar/tst.arg0.d       |  20 +++
 test/unittest/variables/bvar/tst.arg1.d       |  20 +++
 test/unittest/variables/bvar/tst.arg2.d       |  20 +++
 test/unittest/variables/bvar/tst.arg3.d       |  20 +++
 test/unittest/variables/bvar/tst.arg4.d       |  20 +++
 test/unittest/variables/bvar/tst.arg5.d       |  20 +++
 test/unittest/variables/bvar/tst.arg6.d       |  20 +++
 test/unittest/variables/bvar/tst.arg7.d       |  20 +++
 test/unittest/variables/bvar/tst.arg8.d       |  20 +++
 test/unittest/variables/bvar/tst.arg9.d       |  20 +++
 test/unittest/variables/bvar/tst.args.d       |  20 +++
 test/unittest/variables/bvar/tst.caller.d     |  20 +++
 test/unittest/variables/bvar/tst.curcpu.d     |  20 +++
 test/unittest/variables/bvar/tst.curthread.d  |  20 +++
 test/unittest/variables/bvar/tst.epid.d       |  20 +++
 test/unittest/variables/bvar/tst.errno.d      |  20 +++
 test/unittest/variables/bvar/tst.execname.d   |  20 +++
 test/unittest/variables/bvar/tst.gid.d        |  20 +++
 test/unittest/variables/bvar/tst.id.d         |  20 +++
 test/unittest/variables/bvar/tst.ipl.d        |  20 +++
 test/unittest/variables/bvar/tst.pid.d        |  20 +++
 test/unittest/variables/bvar/tst.ppid.d       |  20 +++
 test/unittest/variables/bvar/tst.probefunc.d  |  20 +++
 test/unittest/variables/bvar/tst.probemod.d   |  20 +++
 test/unittest/variables/bvar/tst.probename.d  |  20 +++
 test/unittest/variables/bvar/tst.probeprov.d  |  20 +++
 test/unittest/variables/bvar/tst.stackdepth.d |  20 +++
 test/unittest/variables/bvar/tst.tid.d        |  20 +++
 test/unittest/variables/bvar/tst.timestamp.d  |  20 +++
 test/unittest/variables/bvar/tst.ucaller.d    |  20 +++
 test/unittest/variables/bvar/tst.uid.d        |  20 +++
 test/unittest/variables/bvar/tst.uregs.d      |  20 +++
 .../unittest/variables/bvar/tst.ustackdepth.d |  20 +++
 test/unittest/variables/bvar/tst.vtimestamp.d |  20 +++
 .../variables/bvar/tst.walltimestamp.d        |  20 +++
 41 files changed, 794 insertions(+), 67 deletions(-)
 create mode 100644 bpf/get_bvar.c
 create mode 100644 test/unittest/variables/bvar/tst.arg0.d
 create mode 100644 test/unittest/variables/bvar/tst.arg1.d
 create mode 100644 test/unittest/variables/bvar/tst.arg2.d
 create mode 100644 test/unittest/variables/bvar/tst.arg3.d
 create mode 100644 test/unittest/variables/bvar/tst.arg4.d
 create mode 100644 test/unittest/variables/bvar/tst.arg5.d
 create mode 100644 test/unittest/variables/bvar/tst.arg6.d
 create mode 100644 test/unittest/variables/bvar/tst.arg7.d
 create mode 100644 test/unittest/variables/bvar/tst.arg8.d
 create mode 100644 test/unittest/variables/bvar/tst.arg9.d
 create mode 100644 test/unittest/variables/bvar/tst.args.d
 create mode 100644 test/unittest/variables/bvar/tst.caller.d
 create mode 100644 test/unittest/variables/bvar/tst.curcpu.d
 create mode 100644 test/unittest/variables/bvar/tst.curthread.d
 create mode 100644 test/unittest/variables/bvar/tst.epid.d
 create mode 100644 test/unittest/variables/bvar/tst.errno.d
 create mode 100644 test/unittest/variables/bvar/tst.execname.d
 create mode 100644 test/unittest/variables/bvar/tst.gid.d
 create mode 100644 test/unittest/variables/bvar/tst.id.d
 create mode 100644 test/unittest/variables/bvar/tst.ipl.d
 create mode 100644 test/unittest/variables/bvar/tst.pid.d
 create mode 100644 test/unittest/variables/bvar/tst.ppid.d
 create mode 100644 test/unittest/variables/bvar/tst.probefunc.d
 create mode 100644 test/unittest/variables/bvar/tst.probemod.d
 create mode 100644 test/unittest/variables/bvar/tst.probename.d
 create mode 100644 test/unittest/variables/bvar/tst.probeprov.d
 create mode 100644 test/unittest/variables/bvar/tst.stackdepth.d
 create mode 100644 test/unittest/variables/bvar/tst.tid.d
 create mode 100644 test/unittest/variables/bvar/tst.timestamp.d
 create mode 100644 test/unittest/variables/bvar/tst.ucaller.d
 create mode 100644 test/unittest/variables/bvar/tst.uid.d
 create mode 100644 test/unittest/variables/bvar/tst.uregs.d
 create mode 100644 test/unittest/variables/bvar/tst.ustackdepth.d
 create mode 100644 test/unittest/variables/bvar/tst.vtimestamp.d
 create mode 100644 test/unittest/variables/bvar/tst.walltimestamp.d

diff --git a/bpf/Build b/bpf/Build
index cda738b6..0feb8b3b 100644
--- a/bpf/Build
+++ b/bpf/Build
@@ -17,6 +17,7 @@ bpf_dlib_TARGET = dlibs/bpf_dlib
 bpf_dlib_DIR := $(current-dir)
 bpf_dlib_SRCDEPS = $(objdir)/include/.dir.stamp
 bpf_dlib_SOURCES = \
+	get_bvar.c \
 	map_gvar.c get_gvar.c set_gvar.c \
 	map_tvar.c get_tvar.c set_tvar.c \
 	memcpy.c strnlen.c
diff --git a/bpf/get_bvar.c b/bpf/get_bvar.c
new file mode 100644
index 00000000..6b0b354a
--- /dev/null
+++ b/bpf/get_bvar.c
@@ -0,0 +1,17 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ */
+#include <linux/bpf.h>
+#include <stdint.h>
+#include <bpf-helpers.h>
+
+#ifndef noinline
+# define noinline	__attribute__((noinline))
+#endif
+
+noinline uint64_t dt_get_bvar(uint32_t id)
+{
+	/* Not implemented yet. */
+	return (uint64_t)-1;
+}
diff --git a/libdtrace/dt_bpf_builtins.h b/libdtrace/dt_bpf_builtins.h
index 30b24624..edf0333e 100644
--- a/libdtrace/dt_bpf_builtins.h
+++ b/libdtrace/dt_bpf_builtins.h
@@ -14,6 +14,7 @@ extern "C" {
 #endif
 
 #define DT_BPF_MAP_BUILTINS(FN) \
+	FN(get_bvar), \
 	FN(get_gvar), \
 	FN(get_string), \
 	FN(get_tvar), \
diff --git a/libdtrace/dt_cg.c b/libdtrace/dt_cg.c
index e0e58abc..4945dead 100644
--- a/libdtrace/dt_cg.c
+++ b/libdtrace/dt_cg.c
@@ -774,6 +774,58 @@ dt_cg_load(dt_node_t *dnp, ctf_file_t *ctfp, ctf_id_t type)
 #endif
 }
 
+static void
+dt_cg_load_var(dt_node_t *dst, dt_irlist_t *dlp, dt_regset_t *drp)
+{
+	struct bpf_insn	instr;
+	dt_ident_t	*idp = dt_ident_resolve(dst->dn_ident);
+
+	idp->di_flags |= DT_IDFLG_DIFR;
+	if (idp->di_flags & DT_IDFLG_LOCAL) {		/* local var */
+		instr = BPF_LOAD(BPF_DW, dst->dn_reg, BPF_REG_FP,
+				 DT_STK_LVAR(idp->di_id));
+		dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr));
+	} else if (idp->di_flags & DT_IDFLG_TLS) {	/* TLS var */
+		dt_regset_xalloc(drp, BPF_REG_1);
+		instr = BPF_MOV_IMM(BPF_REG_1,
+				    idp->di_id - DIF_VAR_OTHER_UBASE);
+		dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr));
+		idp = dt_dlib_get_func(yypcb->pcb_hdl, "dt_get_tvar");
+		assert(idp != NULL);
+		dt_regset_xalloc(drp, BPF_REG_0);
+		instr = BPF_CALL_FUNC(idp->di_id);
+		dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr));
+		dlp->dl_last->di_extern = idp;
+		instr = BPF_MOV_REG(dst->dn_reg, BPF_REG_0);
+		dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr));
+		dt_regset_free(drp, BPF_REG_0);
+		dt_regset_free(drp, BPF_REG_1);
+	} else {					/* global var */
+		dt_regset_xalloc(drp, BPF_REG_1);
+		if (idp->di_id < DIF_VAR_OTHER_UBASE) {	/* built-in var */
+			instr = BPF_MOV_IMM(BPF_REG_1, idp->di_id);
+			dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE,
+					 instr));
+			idp = dt_dlib_get_func(yypcb->pcb_hdl, "dt_get_bvar");
+		} else {
+			instr = BPF_MOV_IMM(BPF_REG_1,
+					    idp->di_id - DIF_VAR_OTHER_UBASE);
+			dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE,
+					 instr));
+			idp = dt_dlib_get_func(yypcb->pcb_hdl, "dt_get_gvar");
+		}
+		assert(idp != NULL);
+		dt_regset_xalloc(drp, BPF_REG_0);
+		instr = BPF_CALL_FUNC(idp->di_id);
+		dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr));
+		dlp->dl_last->di_extern = idp;
+		instr = BPF_MOV_REG(dst->dn_reg, BPF_REG_0);
+		dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr));
+		dt_regset_free(drp, BPF_REG_0);
+		dt_regset_free(drp, BPF_REG_1);
+	}
+}
+
 static void
 dt_cg_ptrsize(dt_node_t *dnp, dt_irlist_t *dlp, dt_regset_t *drp,
     uint_t op, int dreg)
@@ -1054,7 +1106,8 @@ dt_cg_store_var(dt_node_t *src, dt_irlist_t *dlp, dt_regset_t *drp,
 		instr = BPF_MOV_REG(BPF_REG_2, src->dn_reg);
 		dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr));
 		dt_regset_xalloc(drp, BPF_REG_1);
-		instr = BPF_MOV_IMM(BPF_REG_1, 0x2000 + idp->di_id);
+		instr = BPF_MOV_IMM(BPF_REG_1,
+				    idp->di_id - DIF_VAR_OTHER_UBASE);
 		dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr));
 		idp = dt_dlib_get_func(yypcb->pcb_hdl, "dt_set_tvar");
 		assert(idp != NULL);
@@ -1070,7 +1123,8 @@ dt_cg_store_var(dt_node_t *src, dt_irlist_t *dlp, dt_regset_t *drp,
 		instr = BPF_MOV_REG(BPF_REG_2, src->dn_reg);
 		dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr));
 		dt_regset_xalloc(drp, BPF_REG_1);
-		instr = BPF_MOV_IMM(BPF_REG_1, 0x3000 + idp->di_id);
+		instr = BPF_MOV_IMM(BPF_REG_1,
+				    idp->di_id - DIF_VAR_OTHER_UBASE);
 		dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr));
 		idp = dt_dlib_get_func(yypcb->pcb_hdl, "dt_set_gvar");
 		assert(idp != NULL);
@@ -2433,8 +2487,6 @@ if ((idp = dnp->dn_ident)->di_kind != DT_IDENT_FUNC)
 			break;
 
 		case DT_NODE_VAR: {
-			ssize_t	base;
-
 			if (dnp->dn_ident->di_kind == DT_IDENT_XLSOU ||
 			    dnp->dn_ident->di_kind == DT_IDENT_XLPTR) {
 				/*
@@ -2457,65 +2509,8 @@ if ((idp = dnp->dn_ident)->di_kind != DT_IDENT_FUNC)
 			if ((dnp->dn_reg = dt_regset_alloc(drp)) == -1)
 				longjmp(yypcb->pcb_jmpbuf, EDT_NOREG);
 
-			if (dnp->dn_ident->di_flags & DT_IDFLG_LOCAL) {
-				base = 0x1000;
-				instr = BPF_LOAD(
-					    BPF_DW, dnp->dn_reg, BPF_REG_FP,
-					    DT_STK_LVAR(dnp->dn_ident->di_id));
-				dt_irlist_append(dlp,
-						 dt_cg_node_alloc(DT_LBL_NONE,
-								  instr));
-			} else if (dnp->dn_ident->di_flags & DT_IDFLG_TLS)
-				base = 0x2000;
-			else
-				base = 0x3000;
-
-			dnp->dn_ident->di_flags |= DT_IDFLG_DIFR;
+			dt_cg_load_var(dnp, dlp, drp);
 
-/* FIXME */
-			if (base == 0x3000) {
-				dt_regset_xalloc(drp, BPF_REG_1);
-				instr = BPF_ALU64_IMM(BPF_MOV, BPF_REG_1,
-						      dnp->dn_ident->di_id);
-				dt_irlist_append(dlp,
-						 dt_cg_node_alloc(DT_LBL_NONE,
-								  instr));
-				idp = dt_dlib_get_func(yypcb->pcb_hdl,
-						       "dt_get_gvar");
-				assert(idp != NULL);
-				dt_regset_xalloc(drp, BPF_REG_0);
-				instr = BPF_CALL_FUNC(idp->di_id);
-				dt_irlist_append(dlp,
-						 dt_cg_node_alloc(DT_LBL_NONE,
-								  instr));
-				dlp->dl_last->di_extern = idp;
-				instr = BPF_ALU64_REG(BPF_MOV, dnp->dn_reg,
-						      BPF_REG_0);
-				dt_irlist_append(dlp,
-						 dt_cg_node_alloc(DT_LBL_NONE,
-								  instr));
-				dt_regset_free(drp, BPF_REG_0);
-				dt_regset_free(drp, BPF_REG_1);
-			} else if (base == 0x2000) {
-				instr = BPF_ALU64_IMM(BPF_MOV, dnp->dn_reg,
-						      dnp->dn_ident->di_id);
-				dt_irlist_append(dlp,
-						 dt_cg_node_alloc(DT_LBL_NONE,
-								  instr));
-				idp = dt_dlib_get_func(yypcb->pcb_hdl,
-						       "dt_get_tvar");
-				assert(idp != NULL);
-				instr = BPF_CALL_FUNC(idp->di_id);
-				dt_irlist_append(dlp,
-						 dt_cg_node_alloc(DT_LBL_NONE,
-								  instr));
-				dlp->dl_last->di_extern = idp;
-				instr = BPF_ALU64_REG(BPF_MOV, dnp->dn_reg,
-						      BPF_REG_0);
-				dt_irlist_append(dlp,
-						 dt_cg_node_alloc(DT_LBL_NONE,
-								  instr));
-			}
 			break;
 		}
 
diff --git a/libdtrace/dt_dis.c b/libdtrace/dt_dis.c
index 58726a91..9b272958 100644
--- a/libdtrace/dt_dis.c
+++ b/libdtrace/dt_dis.c
@@ -224,27 +224,39 @@ dt_dis_bpf_args(const dtrace_difo_t *dp, const char *fn,
 {
 	char		*s;
 
-	if (strcmp(fn, "dt_get_gvar") == 0 ||
-	    strcmp(fn, "dt_set_gvar") == 0) {
+	if (strcmp(fn, "dt_get_bvar") == 0) {
 		/*
 		 * We know that the previous instruction exists and assigns
 		 * the variable id to %r1 (because we wrote the code generator
-		 * to emit these instructions in this exact order.
+		 * to emit these instructions in this exact order.)
 		 */
 		in--;
 		snprintf(buf, len, "%s",
 			 dt_dis_varname(dp, in->imm, DIFV_SCOPE_GLOBAL));
 		return buf;
+	} else if (strcmp(fn, "dt_get_gvar") == 0 ||
+		   strcmp(fn, "dt_set_gvar") == 0) {
+		/*
+		 * We know that the previous instruction exists and assigns
+		 * the variable id to %r1 (because we wrote the code generator
+		 * to emit these instructions in this exact order.)
+		 */
+		in--;
+		snprintf(buf, len, "%s",
+			 dt_dis_varname(dp, in->imm + DIF_VAR_OTHER_UBASE,
+					DIFV_SCOPE_GLOBAL));
+		return buf;
 	} else if (strcmp(fn, "dt_get_tvar") == 0 ||
 		   strcmp(fn, "dt_set_tvar") == 0 ) {
 		/*
 		 * We know that the previous instruction exists and assigns
 		 * the variable id to %r1 (because we wrote the code generator
-		 * to emit these instructions in this exact order.
+		 * to emit these instructions in this exact order.)
 		 */
 		in--;
 		snprintf(buf, len, "self->%s",
-			 dt_dis_varname(dp, in->imm, DIFV_SCOPE_THREAD));
+			 dt_dis_varname(dp, in->imm + DIF_VAR_OTHER_UBASE,
+					DIFV_SCOPE_THREAD));
 		return buf;
 	} else if (strcmp(fn, "dt_get_string") == 0) {
 		/*
diff --git a/libdtrace/dt_dlibs.c b/libdtrace/dt_dlibs.c
index 4f1aeaa2..1fd0f0a8 100644
--- a/libdtrace/dt_dlibs.c
+++ b/libdtrace/dt_dlibs.c
@@ -51,6 +51,7 @@ static const dt_ident_t	dt_bpf_symbols[] = {
 	DT_BPF_SYMBOL(dt_predicate, DT_IDENT_FUNC),
 	DT_BPF_SYMBOL(dt_program, DT_IDENT_FUNC),
 	/* BPF library (external) functions */
+	DT_BPF_SYMBOL(dt_get_bvar, DT_IDENT_SYMBOL),
 	DT_BPF_SYMBOL(dt_get_gvar, DT_IDENT_SYMBOL),
 	DT_BPF_SYMBOL(dt_get_string, DT_IDENT_SYMBOL),
 	DT_BPF_SYMBOL(dt_get_tvar, DT_IDENT_SYMBOL),
diff --git a/test/unittest/variables/bvar/tst.arg0.d b/test/unittest/variables/bvar/tst.arg0.d
new file mode 100644
index 00000000..1b8f408f
--- /dev/null
+++ b/test/unittest/variables/bvar/tst.arg0.d
@@ -0,0 +1,20 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Licensed under the Universal Permissive License v 1.0 as shown at
+ * http://oss.oracle.com/licenses/upl.
+ */
+/* @@xfail: dtv2 */
+
+/*
+ * ASSERTION: The 'arg0' variable can be accessed and is not -1.
+ *
+ * SECTION: Variables/Built-in Variables/arg0
+ */
+
+#pragma D option quiet
+
+BEGIN {
+	trace(arg0);
+	exit(arg0 != -1 ? 0 : 1);
+}
diff --git a/test/unittest/variables/bvar/tst.arg1.d b/test/unittest/variables/bvar/tst.arg1.d
new file mode 100644
index 00000000..c316439a
--- /dev/null
+++ b/test/unittest/variables/bvar/tst.arg1.d
@@ -0,0 +1,20 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Licensed under the Universal Permissive License v 1.0 as shown at
+ * http://oss.oracle.com/licenses/upl.
+ */
+/* @@xfail: dtv2 */
+
+/*
+ * ASSERTION: The 'arg1' variable can be accessed and is not -1.
+ *
+ * SECTION: Variables/Built-in Variables/arg1
+ */
+
+#pragma D option quiet
+
+BEGIN {
+	trace(arg1);
+	exit(arg1 != -1 ? 0 : 1);
+}
diff --git a/test/unittest/variables/bvar/tst.arg2.d b/test/unittest/variables/bvar/tst.arg2.d
new file mode 100644
index 00000000..4284b30f
--- /dev/null
+++ b/test/unittest/variables/bvar/tst.arg2.d
@@ -0,0 +1,20 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Licensed under the Universal Permissive License v 1.0 as shown at
+ * http://oss.oracle.com/licenses/upl.
+ */
+/* @@xfail: dtv2 */
+
+/*
+ * ASSERTION: The 'arg2' variable can be accessed and is not -1.
+ *
+ * SECTION: Variables/Built-in Variables/arg2
+ */
+
+#pragma D option quiet
+
+BEGIN {
+	trace(arg2);
+	exit(arg2 != -1 ? 0 : 1);
+}
diff --git a/test/unittest/variables/bvar/tst.arg3.d b/test/unittest/variables/bvar/tst.arg3.d
new file mode 100644
index 00000000..5519c585
--- /dev/null
+++ b/test/unittest/variables/bvar/tst.arg3.d
@@ -0,0 +1,20 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Licensed under the Universal Permissive License v 1.0 as shown at
+ * http://oss.oracle.com/licenses/upl.
+ */
+/* @@xfail: dtv2 */
+
+/*
+ * ASSERTION: The 'arg3' variable can be accessed and is not -1.
+ *
+ * SECTION: Variables/Built-in Variables/arg3
+ */
+
+#pragma D option quiet
+
+BEGIN {
+	trace(arg3);
+	exit(arg3 != -1 ? 0 : 1);
+}
diff --git a/test/unittest/variables/bvar/tst.arg4.d b/test/unittest/variables/bvar/tst.arg4.d
new file mode 100644
index 00000000..4b12f97d
--- /dev/null
+++ b/test/unittest/variables/bvar/tst.arg4.d
@@ -0,0 +1,20 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Licensed under the Universal Permissive License v 1.0 as shown at
+ * http://oss.oracle.com/licenses/upl.
+ */
+/* @@xfail: dtv2 */
+
+/*
+ * ASSERTION: The 'arg4' variable can be accessed and is not -1.
+ *
+ * SECTION: Variables/Built-in Variables/arg4
+ */
+
+#pragma D option quiet
+
+BEGIN {
+	trace(arg4);
+	exit(arg4 != -1 ? 0 : 1);
+}
diff --git a/test/unittest/variables/bvar/tst.arg5.d b/test/unittest/variables/bvar/tst.arg5.d
new file mode 100644
index 00000000..51db52ab
--- /dev/null
+++ b/test/unittest/variables/bvar/tst.arg5.d
@@ -0,0 +1,20 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Licensed under the Universal Permissive License v 1.0 as shown at
+ * http://oss.oracle.com/licenses/upl.
+ */
+/* @@xfail: dtv2 */
+
+/*
+ * ASSERTION: The 'arg5' variable can be accessed and is not -1.
+ *
+ * SECTION: Variables/Built-in Variables/arg5
+ */
+
+#pragma D option quiet
+
+BEGIN {
+	trace(arg5);
+	exit(arg5 != -1 ? 0 : 1);
+}
diff --git a/test/unittest/variables/bvar/tst.arg6.d b/test/unittest/variables/bvar/tst.arg6.d
new file mode 100644
index 00000000..04d32b36
--- /dev/null
+++ b/test/unittest/variables/bvar/tst.arg6.d
@@ -0,0 +1,20 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Licensed under the Universal Permissive License v 1.0 as shown at
+ * http://oss.oracle.com/licenses/upl.
+ */
+/* @@xfail: dtv2 */
+
+/*
+ * ASSERTION: The 'arg6' variable can be accessed and is not -1.
+ *
+ * SECTION: Variables/Built-in Variables/arg6
+ */
+
+#pragma D option quiet
+
+BEGIN {
+	trace(arg6);
+	exit(arg6 != -1 ? 0 : 1);
+}
diff --git a/test/unittest/variables/bvar/tst.arg7.d b/test/unittest/variables/bvar/tst.arg7.d
new file mode 100644
index 00000000..fb3cd7fa
--- /dev/null
+++ b/test/unittest/variables/bvar/tst.arg7.d
@@ -0,0 +1,20 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Licensed under the Universal Permissive License v 1.0 as shown at
+ * http://oss.oracle.com/licenses/upl.
+ */
+/* @@xfail: dtv2 */
+
+/*
+ * ASSERTION: The 'arg7' variable can be accessed and is not -1.
+ *
+ * SECTION: Variables/Built-in Variables/arg7
+ */
+
+#pragma D option quiet
+
+BEGIN {
+	trace(arg7);
+	exit(arg7 != -1 ? 0 : 1);
+}
diff --git a/test/unittest/variables/bvar/tst.arg8.d b/test/unittest/variables/bvar/tst.arg8.d
new file mode 100644
index 00000000..17a6397d
--- /dev/null
+++ b/test/unittest/variables/bvar/tst.arg8.d
@@ -0,0 +1,20 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Licensed under the Universal Permissive License v 1.0 as shown at
+ * http://oss.oracle.com/licenses/upl.
+ */
+/* @@xfail: dtv2 */
+
+/*
+ * ASSERTION: The 'arg8' variable can be accessed and is not -1.
+ *
+ * SECTION: Variables/Built-in Variables/arg8
+ */
+
+#pragma D option quiet
+
+BEGIN {
+	trace(arg8);
+	exit(arg8 != -1 ? 0 : 1);
+}
diff --git a/test/unittest/variables/bvar/tst.arg9.d b/test/unittest/variables/bvar/tst.arg9.d
new file mode 100644
index 00000000..fa198bf8
--- /dev/null
+++ b/test/unittest/variables/bvar/tst.arg9.d
@@ -0,0 +1,20 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Licensed under the Universal Permissive License v 1.0 as shown at
+ * http://oss.oracle.com/licenses/upl.
+ */
+/* @@xfail: dtv2 */
+
+/*
+ * ASSERTION: The 'arg9' variable can be accessed and is not -1.
+ *
+ * SECTION: Variables/Built-in Variables/arg9
+ */
+
+#pragma D option quiet
+
+BEGIN {
+	trace(arg9);
+	exit(arg9 != -1 ? 0 : 1);
+}
diff --git a/test/unittest/variables/bvar/tst.args.d b/test/unittest/variables/bvar/tst.args.d
new file mode 100644
index 00000000..20820563
--- /dev/null
+++ b/test/unittest/variables/bvar/tst.args.d
@@ -0,0 +1,20 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Licensed under the Universal Permissive License v 1.0 as shown at
+ * http://oss.oracle.com/licenses/upl.
+ */
+/* @@xfail: dtv2 */
+
+/*
+ * ASSERTION: The 'args' variable can be accessed and is not -1.
+ *
+ * SECTION: Variables/Built-in Variables/args
+ */
+
+#pragma D option quiet
+
+BEGIN {
+	trace(args);
+	exit(args != -1 ? 0 : 1);
+}
diff --git a/test/unittest/variables/bvar/tst.caller.d b/test/unittest/variables/bvar/tst.caller.d
new file mode 100644
index 00000000..d4717dd4
--- /dev/null
+++ b/test/unittest/variables/bvar/tst.caller.d
@@ -0,0 +1,20 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Licensed under the Universal Permissive License v 1.0 as shown at
+ * http://oss.oracle.com/licenses/upl.
+ */
+/* @@xfail: dtv2 */
+
+/*
+ * ASSERTION: The 'caller' variable can be accessed and is not -1.
+ *
+ * SECTION: Variables/Built-in Variables/caller
+ */
+
+#pragma D option quiet
+
+BEGIN {
+	trace(caller);
+	exit(caller != -1 ? 0 : 1);
+}
diff --git a/test/unittest/variables/bvar/tst.curcpu.d b/test/unittest/variables/bvar/tst.curcpu.d
new file mode 100644
index 00000000..bf3acbe8
--- /dev/null
+++ b/test/unittest/variables/bvar/tst.curcpu.d
@@ -0,0 +1,20 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Licensed under the Universal Permissive License v 1.0 as shown at
+ * http://oss.oracle.com/licenses/upl.
+ */
+/* @@xfail: dtv2 */
+
+/*
+ * ASSERTION: The 'curcpu' variable can be accessed and is not -1.
+ *
+ * SECTION: Variables/Built-in Variables/curcpu
+ */
+
+#pragma D option quiet
+
+BEGIN {
+	trace(curcpu);
+	exit(curcpu != -1 ? 0 : 1);
+}
diff --git a/test/unittest/variables/bvar/tst.curthread.d b/test/unittest/variables/bvar/tst.curthread.d
new file mode 100644
index 00000000..87a27326
--- /dev/null
+++ b/test/unittest/variables/bvar/tst.curthread.d
@@ -0,0 +1,20 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Licensed under the Universal Permissive License v 1.0 as shown at
+ * http://oss.oracle.com/licenses/upl.
+ */
+/* @@xfail: dtv2 */
+
+/*
+ * ASSERTION: The 'curthread' variable can be accessed and is not -1.
+ *
+ * SECTION: Variables/Built-in Variables/curthread
+ */
+
+#pragma D option quiet
+
+BEGIN {
+	trace(curthread);
+	exit(curthread != -1 ? 0 : 1);
+}
diff --git a/test/unittest/variables/bvar/tst.epid.d b/test/unittest/variables/bvar/tst.epid.d
new file mode 100644
index 00000000..81f8ca27
--- /dev/null
+++ b/test/unittest/variables/bvar/tst.epid.d
@@ -0,0 +1,20 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Licensed under the Universal Permissive License v 1.0 as shown at
+ * http://oss.oracle.com/licenses/upl.
+ */
+/* @@xfail: dtv2 */
+
+/*
+ * ASSERTION: The 'epid' variable can be accessed and is not -1.
+ *
+ * SECTION: Variables/Built-in Variables/epid
+ */
+
+#pragma D option quiet
+
+BEGIN {
+	trace(epid);
+	exit(epid != -1 ? 0 : 1);
+}
diff --git a/test/unittest/variables/bvar/tst.errno.d b/test/unittest/variables/bvar/tst.errno.d
new file mode 100644
index 00000000..f7a08071
--- /dev/null
+++ b/test/unittest/variables/bvar/tst.errno.d
@@ -0,0 +1,20 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Licensed under the Universal Permissive License v 1.0 as shown at
+ * http://oss.oracle.com/licenses/upl.
+ */
+/* @@xfail: dtv2 */
+
+/*
+ * ASSERTION: The 'errno' variable can be accessed and is not -1.
+ *
+ * SECTION: Variables/Built-in Variables/errno
+ */
+
+#pragma D option quiet
+
+BEGIN {
+	trace(errno);
+	exit(errno != -1 ? 0 : 1);
+}
diff --git a/test/unittest/variables/bvar/tst.execname.d b/test/unittest/variables/bvar/tst.execname.d
new file mode 100644
index 00000000..4852c073
--- /dev/null
+++ b/test/unittest/variables/bvar/tst.execname.d
@@ -0,0 +1,20 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Licensed under the Universal Permissive License v 1.0 as shown at
+ * http://oss.oracle.com/licenses/upl.
+ */
+/* @@xfail: dtv2 */
+
+/*
+ * ASSERTION: The 'execname' variable can be accessed and is not -1.
+ *
+ * SECTION: Variables/Built-in Variables/execname
+ */
+
+#pragma D option quiet
+
+BEGIN {
+	trace(execname);
+	exit(execname != -1 ? 0 : 1);
+}
diff --git a/test/unittest/variables/bvar/tst.gid.d b/test/unittest/variables/bvar/tst.gid.d
new file mode 100644
index 00000000..40188e61
--- /dev/null
+++ b/test/unittest/variables/bvar/tst.gid.d
@@ -0,0 +1,20 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Licensed under the Universal Permissive License v 1.0 as shown at
+ * http://oss.oracle.com/licenses/upl.
+ */
+/* @@xfail: dtv2 */
+
+/*
+ * ASSERTION: The 'gid' variable can be accessed and is not -1.
+ *
+ * SECTION: Variables/Built-in Variables/gid
+ */
+
+#pragma D option quiet
+
+BEGIN {
+	trace(gid);
+	exit(gid != -1 ? 0 : 1);
+}
diff --git a/test/unittest/variables/bvar/tst.id.d b/test/unittest/variables/bvar/tst.id.d
new file mode 100644
index 00000000..2a78449f
--- /dev/null
+++ b/test/unittest/variables/bvar/tst.id.d
@@ -0,0 +1,20 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Licensed under the Universal Permissive License v 1.0 as shown at
+ * http://oss.oracle.com/licenses/upl.
+ */
+/* @@xfail: dtv2 */
+
+/*
+ * ASSERTION: The 'id' variable can be accessed and is not -1.
+ *
+ * SECTION: Variables/Built-in Variables/id
+ */
+
+#pragma D option quiet
+
+BEGIN {
+	trace(id);
+	exit(id != -1 ? 0 : 1);
+}
diff --git a/test/unittest/variables/bvar/tst.ipl.d b/test/unittest/variables/bvar/tst.ipl.d
new file mode 100644
index 00000000..417f464b
--- /dev/null
+++ b/test/unittest/variables/bvar/tst.ipl.d
@@ -0,0 +1,20 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Licensed under the Universal Permissive License v 1.0 as shown at
+ * http://oss.oracle.com/licenses/upl.
+ */
+/* @@xfail: dtv2 */
+
+/*
+ * ASSERTION: The 'ipl' variable can be accessed and is not -1.
+ *
+ * SECTION: Variables/Built-in Variables/ipl
+ */
+
+#pragma D option quiet
+
+BEGIN {
+	trace(ipl);
+	exit(ipl != -1 ? 0 : 1);
+}
diff --git a/test/unittest/variables/bvar/tst.pid.d b/test/unittest/variables/bvar/tst.pid.d
new file mode 100644
index 00000000..c5819398
--- /dev/null
+++ b/test/unittest/variables/bvar/tst.pid.d
@@ -0,0 +1,20 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Licensed under the Universal Permissive License v 1.0 as shown at
+ * http://oss.oracle.com/licenses/upl.
+ */
+/* @@xfail: dtv2 */
+
+/*
+ * ASSERTION: The 'pid' variable can be accessed and is not -1.
+ *
+ * SECTION: Variables/Built-in Variables/pid
+ */
+
+#pragma D option quiet
+
+BEGIN {
+	trace(pid);
+	exit(pid != -1 ? 0 : 1);
+}
diff --git a/test/unittest/variables/bvar/tst.ppid.d b/test/unittest/variables/bvar/tst.ppid.d
new file mode 100644
index 00000000..e406b36f
--- /dev/null
+++ b/test/unittest/variables/bvar/tst.ppid.d
@@ -0,0 +1,20 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Licensed under the Universal Permissive License v 1.0 as shown at
+ * http://oss.oracle.com/licenses/upl.
+ */
+/* @@xfail: dtv2 */
+
+/*
+ * ASSERTION: The 'ppid' variable can be accessed and is not -1.
+ *
+ * SECTION: Variables/Built-in Variables/ppid
+ */
+
+#pragma D option quiet
+
+BEGIN {
+	trace(ppid);
+	exit(ppid != -1 ? 0 : 1);
+}
diff --git a/test/unittest/variables/bvar/tst.probefunc.d b/test/unittest/variables/bvar/tst.probefunc.d
new file mode 100644
index 00000000..b6c1b5ab
--- /dev/null
+++ b/test/unittest/variables/bvar/tst.probefunc.d
@@ -0,0 +1,20 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Licensed under the Universal Permissive License v 1.0 as shown at
+ * http://oss.oracle.com/licenses/upl.
+ */
+/* @@xfail: dtv2 */
+
+/*
+ * ASSERTION: The 'probefunc' variable can be accessed and is not -1.
+ *
+ * SECTION: Variables/Built-in Variables/probefunc
+ */
+
+#pragma D option quiet
+
+BEGIN {
+	trace(probefunc);
+	exit(probefunc != -1 ? 0 : 1);
+}
diff --git a/test/unittest/variables/bvar/tst.probemod.d b/test/unittest/variables/bvar/tst.probemod.d
new file mode 100644
index 00000000..d7146b45
--- /dev/null
+++ b/test/unittest/variables/bvar/tst.probemod.d
@@ -0,0 +1,20 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Licensed under the Universal Permissive License v 1.0 as shown at
+ * http://oss.oracle.com/licenses/upl.
+ */
+/* @@xfail: dtv2 */
+
+/*
+ * ASSERTION: The 'probemod' variable can be accessed and is not -1.
+ *
+ * SECTION: Variables/Built-in Variables/probemod
+ */
+
+#pragma D option quiet
+
+BEGIN {
+	trace(probemod);
+	exit(probemod != -1 ? 0 : 1);
+}
diff --git a/test/unittest/variables/bvar/tst.probename.d b/test/unittest/variables/bvar/tst.probename.d
new file mode 100644
index 00000000..c29cd2ee
--- /dev/null
+++ b/test/unittest/variables/bvar/tst.probename.d
@@ -0,0 +1,20 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Licensed under the Universal Permissive License v 1.0 as shown at
+ * http://oss.oracle.com/licenses/upl.
+ */
+/* @@xfail: dtv2 */
+
+/*
+ * ASSERTION: The 'probename' variable can be accessed and is not -1.
+ *
+ * SECTION: Variables/Built-in Variables/probename
+ */
+
+#pragma D option quiet
+
+BEGIN {
+	trace(probename);
+	exit(probename != -1 ? 0 : 1);
+}
diff --git a/test/unittest/variables/bvar/tst.probeprov.d b/test/unittest/variables/bvar/tst.probeprov.d
new file mode 100644
index 00000000..1527dc9e
--- /dev/null
+++ b/test/unittest/variables/bvar/tst.probeprov.d
@@ -0,0 +1,20 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Licensed under the Universal Permissive License v 1.0 as shown at
+ * http://oss.oracle.com/licenses/upl.
+ */
+/* @@xfail: dtv2 */
+
+/*
+ * ASSERTION: The 'probeprov' variable can be accessed and is not -1.
+ *
+ * SECTION: Variables/Built-in Variables/probeprov
+ */
+
+#pragma D option quiet
+
+BEGIN {
+	trace(probeprov);
+	exit(probeprov != -1 ? 0 : 1);
+}
diff --git a/test/unittest/variables/bvar/tst.stackdepth.d b/test/unittest/variables/bvar/tst.stackdepth.d
new file mode 100644
index 00000000..0e899869
--- /dev/null
+++ b/test/unittest/variables/bvar/tst.stackdepth.d
@@ -0,0 +1,20 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Licensed under the Universal Permissive License v 1.0 as shown at
+ * http://oss.oracle.com/licenses/upl.
+ */
+/* @@xfail: dtv2 */
+
+/*
+ * ASSERTION: The 'stackdepth' variable can be accessed and is not -1.
+ *
+ * SECTION: Variables/Built-in Variables/stackdepth
+ */
+
+#pragma D option quiet
+
+BEGIN {
+	trace(stackdepth);
+	exit(stackdepth != -1 ? 0 : 1);
+}
diff --git a/test/unittest/variables/bvar/tst.tid.d b/test/unittest/variables/bvar/tst.tid.d
new file mode 100644
index 00000000..2359db1c
--- /dev/null
+++ b/test/unittest/variables/bvar/tst.tid.d
@@ -0,0 +1,20 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Licensed under the Universal Permissive License v 1.0 as shown at
+ * http://oss.oracle.com/licenses/upl.
+ */
+/* @@xfail: dtv2 */
+
+/*
+ * ASSERTION: The 'tid' variable can be accessed and is not -1.
+ *
+ * SECTION: Variables/Built-in Variables/tid
+ */
+
+#pragma D option quiet
+
+BEGIN {
+	trace(tid);
+	exit(tid != -1 ? 0 : 1);
+}
diff --git a/test/unittest/variables/bvar/tst.timestamp.d b/test/unittest/variables/bvar/tst.timestamp.d
new file mode 100644
index 00000000..04601ba0
--- /dev/null
+++ b/test/unittest/variables/bvar/tst.timestamp.d
@@ -0,0 +1,20 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Licensed under the Universal Permissive License v 1.0 as shown at
+ * http://oss.oracle.com/licenses/upl.
+ */
+/* @@xfail: dtv2 */
+
+/*
+ * ASSERTION: The 'timestamp' variable can be accessed and is not -1.
+ *
+ * SECTION: Variables/Built-in Variables/timestamp
+ */
+
+#pragma D option quiet
+
+BEGIN {
+	trace(timestamp);
+	exit(timestamp != -1 ? 0 : 1);
+}
diff --git a/test/unittest/variables/bvar/tst.ucaller.d b/test/unittest/variables/bvar/tst.ucaller.d
new file mode 100644
index 00000000..ca2c9229
--- /dev/null
+++ b/test/unittest/variables/bvar/tst.ucaller.d
@@ -0,0 +1,20 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ *
+ * SECTION: Variables/Built-in Variables/ucaller
+ */
+
+#pragma D option quiet
+
+BEGIN {
+	trace(ucaller);
+	exit(ucaller != -1 ? 0 : 1);
+}
diff --git a/test/unittest/variables/bvar/tst.uid.d b/test/unittest/variables/bvar/tst.uid.d
new file mode 100644
index 00000000..1892f8b9
--- /dev/null
+++ b/test/unittest/variables/bvar/tst.uid.d
@@ -0,0 +1,20 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Licensed under the Universal Permissive License v 1.0 as shown at
+ * http://oss.oracle.com/licenses/upl.
+ */
+/* @@xfail: dtv2 */
+
+/*
+ * ASSERTION: The 'uid' variable can be accessed and is not -1.
+ *
+ * SECTION: Variables/Built-in Variables/uid
+ */
+
+#pragma D option quiet
+
+BEGIN {
+	trace(uid);
+	exit(uid != -1 ? 0 : 1);
+}
diff --git a/test/unittest/variables/bvar/tst.uregs.d b/test/unittest/variables/bvar/tst.uregs.d
new file mode 100644
index 00000000..dc253c53
--- /dev/null
+++ b/test/unittest/variables/bvar/tst.uregs.d
@@ -0,0 +1,20 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Licensed under the Universal Permissive License v 1.0 as shown at
+ * http://oss.oracle.com/licenses/upl.
+ */
+/* @@xfail: dtv2 */
+
+/*
+ * ASSERTION: The 'uregs' variable can be accessed and is not -1.
+ *
+ * SECTION: Variables/Built-in Variables/uregs
+ */
+
+#pragma D option quiet
+
+BEGIN {
+	trace(uregs);
+	exit(uregs != -1 ? 0 : 1);
+}
diff --git a/test/unittest/variables/bvar/tst.ustackdepth.d b/test/unittest/variables/bvar/tst.ustackdepth.d
new file mode 100644
index 00000000..85b5604f
--- /dev/null
+++ b/test/unittest/variables/bvar/tst.ustackdepth.d
@@ -0,0 +1,20 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Licensed under the Universal Permissive License v 1.0 as shown at
+ * http://oss.oracle.com/licenses/upl.
+ */
+/* @@xfail: dtv2 */
+
+/*
+ * ASSERTION: The 'ustackdepth' variable can be accessed and is not -1.
+ *
+ * SECTION: Variables/Built-in Variables/ustackdepth
+ */
+
+#pragma D option quiet
+
+BEGIN {
+	trace(ustackdepth);
+	exit(ustackdepth != -1 ? 0 : 1);
+}
diff --git a/test/unittest/variables/bvar/tst.vtimestamp.d b/test/unittest/variables/bvar/tst.vtimestamp.d
new file mode 100644
index 00000000..86cf5d19
--- /dev/null
+++ b/test/unittest/variables/bvar/tst.vtimestamp.d
@@ -0,0 +1,20 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Licensed under the Universal Permissive License v 1.0 as shown at
+ * http://oss.oracle.com/licenses/upl.
+ */
+/* @@xfail: dtv2 */
+
+/*
+ * ASSERTION: The 'vtimestamp' variable can be accessed and is not -1.
+ *
+ * SECTION: Variables/Built-in Variables/vtimestamp
+ */
+
+#pragma D option quiet
+
+BEGIN {
+	trace(vtimestamp);
+	exit(vtimestamp != -1 ? 0 : 1);
+}
diff --git a/test/unittest/variables/bvar/tst.walltimestamp.d b/test/unittest/variables/bvar/tst.walltimestamp.d
new file mode 100644
index 00000000..9e3291c4
--- /dev/null
+++ b/test/unittest/variables/bvar/tst.walltimestamp.d
@@ -0,0 +1,20 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Licensed under the Universal Permissive License v 1.0 as shown at
+ * http://oss.oracle.com/licenses/upl.
+ */
+/* @@xfail: dtv2 */
+
+/*
+ * ASSERTION: The 'walltimestamp' variable can be accessed and is not -1.
+ *
+ * SECTION: Variables/Built-in Variables/walltimestamp
+ */
+
+#pragma D option quiet
+
+BEGIN {
+	trace(walltimestamp);
+	exit(walltimestamp != -1 ? 0 : 1);
+}
-- 
2.26.0




More information about the DTrace-devel mailing list