diff options
author | jistone <jistone> | 2006-05-24 19:17:13 +0000 |
---|---|---|
committer | jistone <jistone> | 2006-05-24 19:17:13 +0000 |
commit | cfe3fd5015c459688c00741de58713445cb5eba9 (patch) | |
tree | 916298838ae0a2cffc08bc1f8bcb1ec3c2de4979 /tapset/context.stp | |
parent | a477f3f17daab73993ce765900e95cddc3463586 (diff) | |
download | systemtap-steved-cfe3fd5015c459688c00741de58713445cb5eba9.tar.gz systemtap-steved-cfe3fd5015c459688c00741de58713445cb5eba9.tar.xz systemtap-steved-cfe3fd5015c459688c00741de58713445cb5eba9.zip |
2006-05-24 Josh Stone <joshua.i.stone@intel.com>
PR 2677
* sym.c (_stp_symbol_sprint_basic): New function that returns
just the symbol name, and doesn't bother with String.
* context.stp (probefunc): Use _stp_symbol_sprint_basic
Diffstat (limited to 'tapset/context.stp')
-rw-r--r-- | tapset/context.stp | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/tapset/context.stp b/tapset/context.stp index 9a46df19..0565d1b7 100644 --- a/tapset/context.stp +++ b/tapset/context.stp @@ -1,5 +1,6 @@ // context tapset // Copyright (C) 2005, 2006 Red Hat Inc. +// Copyright (C) 2006 Intel Corporation. // // This file is part of systemtap, and is free software. You can // redistribute it and/or modify it under the terms of the GNU General @@ -89,9 +90,7 @@ function pp:string () %{ /* pure */ %} function probefunc:string () %{ /* pure */ - char *dst, *ptr, *start; - String str; - int len = MAXSTRINGLEN; + char *ptr, *start; start = strstr(CONTEXT->probe_point, "function(\""); ptr = start + 10; @@ -99,28 +98,21 @@ function probefunc:string () %{ /* pure */ start = strstr(CONTEXT->probe_point, "inline(\""); ptr = start + 8; } + if (start) { - dst = THIS->__retvalue; + int len = MAXSTRINGLEN; + char *dst = THIS->__retvalue; while (*ptr != '@' && --len > 0 && *ptr) *dst++ = *ptr++; *dst = 0; + } else if (CONTEXT->regs) { - str = _stp_string_init (0); - _stp_symbol_sprint(str, REG_IP(CONTEXT->regs)); - start = strstr(_stp_string_ptr(str), " : "); - if (start) { - dst = THIS->__retvalue; - ptr = start+3; - while (*ptr != '+' && --len > 0 && *ptr) - *dst++ = *ptr++; - *dst = 0; - } - else { - strlcpy(THIS->__retvalue, _stp_string_ptr(str),MAXSTRINGLEN); - } + _stp_symbol_sprint_basic(THIS->__retvalue, MAXSTRINGLEN, + REG_IP(CONTEXT->regs)); + } else { - THIS->__retvalue[0] = '\0'; - } + THIS->__retvalue[0] = '\0'; + } %} function is_return:long () %{ /* pure */ |