From d83d7b513d38791751e46a05e382b1e6876abefc Mon Sep 17 00:00:00 2001 From: Dave Brolley Date: Wed, 16 Sep 2009 12:18:15 -0400 Subject: Create is_myproc helper function. --- tapset/context.stp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tapset/context.stp') diff --git a/tapset/context.stp b/tapset/context.stp index 5be9f21f..92c325ce 100644 --- a/tapset/context.stp +++ b/tapset/context.stp @@ -147,6 +147,20 @@ function euid:long () %{ /* pure */ #endif %} +/** + * sfunction is_myproc - Determines if the current probe point has occurred in + * the user's own process. + * + * Return 1 if the current probe point has occurred in the user's own process. + */ +function is_myproc:long () %{ /* pure */ /* unprivileged */ +#ifdef STAPCONF_TASK_UID + THIS->__retvalue = (current->euid == _stp_uid); +#else + THIS->__retvalue = (task_euid(current) == _stp_uid); +#endif +%} + // cpuid() is not documented function cpuid:long () %{ /* pure */ THIS->__retvalue = smp_processor_id(); -- cgit