diff --git a/stapfuncs.5.in b/stapfuncs.5.in index 6d4546a..d8a1a55 100644 --- a/stapfuncs.5.in +++ b/stapfuncs.5.in @@ -252,6 +252,9 @@ Return the probe point's module name, if known. target:long () Return the pid of the target process. .TP +user_mode:long () +Return 1 if the probe point occurred in user-mode. +.TP is_return:long () Return 1 if the probe point is a return probe. Deprecated. diff --git a/tapset/context.stp b/tapset/context.stp index 45e3be3..d2195f8 100644 --- a/tapset/context.stp +++ b/tapset/context.stp @@ -140,6 +140,11 @@ function registers_valid:long () %{ /* pure */ THIS->__retvalue = (CONTEXT->regs != NULL); %} +function user_mode:long () %{ /* pure */ /* currently a user-mode address? */ + if (CONTEXT->regs) + THIS->__retvalue = (uint64_t) user_mode (CONTEXT->regs); +%} + function is_return:long () %{ /* pure */ if (CONTEXT->pi) THIS->__retvalue = 1;