summaryrefslogtreecommitdiffstats
path: root/tapset/context.stp
diff options
context:
space:
mode:
authoreteo <eteo>2006-08-08 13:11:40 +0000
committereteo <eteo>2006-08-08 13:11:40 +0000
commit81d2346b1c1bd697307467851f55715d36d0892d (patch)
treef2a49ec9ae985f9f17a0554c403468cd25fa9a6c /tapset/context.stp
parent228e305f94316abf45693ecb6cacbba4402aae19 (diff)
downloadsystemtap-steved-81d2346b1c1bd697307467851f55715d36d0892d.tar.gz
systemtap-steved-81d2346b1c1bd697307467851f55715d36d0892d.tar.xz
systemtap-steved-81d2346b1c1bd697307467851f55715d36d0892d.zip
2006-08-08 Eugene Teo <eteo@redhat.com>
* tapset/context.stp (probemod): New function. * stapfuncs.5.in: Document it. * testsuite/buildok/probemod.stp: Test it.
Diffstat (limited to 'tapset/context.stp')
-rw-r--r--tapset/context.stp17
1 files changed, 17 insertions, 0 deletions
diff --git a/tapset/context.stp b/tapset/context.stp
index 16b176af..7c59b0d6 100644
--- a/tapset/context.stp
+++ b/tapset/context.stp
@@ -116,6 +116,23 @@ function probefunc:string () %{ /* pure */
}
%}
+function probemod:string () %{ /* pure */
+ char *ptr, *start;
+
+ start = strstr(CONTEXT->probe_point, "module(\"");
+ ptr = start + 8;
+
+ if (start) {
+ int len = MAXSTRINGLEN;
+ char *dst = THIS->__retvalue;
+ while (*ptr != '"' && --len && *ptr)
+ *dst++ = *ptr++;
+ *dst = 0;
+ } else {
+ THIS->__retvalue[0] = '\0';
+ }
+%}
+
function is_return:long () %{ /* pure */
char *ptr = strrchr(CONTEXT->probe_point, '.');
if (ptr) {