[DTrace-devel] [PATCH 10/12] Add support for built-in variable ucaller
eugene.loh at oracle.com
eugene.loh at oracle.com
Fri May 28 11:35:14 PDT 2021
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
More information about the DTrace-devel
mailing list