summaryrefslogtreecommitdiffstats
path: root/tapset/context.stp
diff options
context:
space:
mode:
authorjistone <jistone>2006-05-08 23:04:39 +0000
committerjistone <jistone>2006-05-08 23:04:39 +0000
commitcea8bf5af1a62458bfda18265a526bdef2df824b (patch)
treeb5187ffb51f9c129d0760f1de531351d18590e4e /tapset/context.stp
parentaa6af101e19e0128c461842b4e724a9eae72b753 (diff)
downloadsystemtap-steved-cea8bf5af1a62458bfda18265a526bdef2df824b.tar.gz
systemtap-steved-cea8bf5af1a62458bfda18265a526bdef2df824b.tar.xz
systemtap-steved-cea8bf5af1a62458bfda18265a526bdef2df824b.zip
2006-05-08 Josh Stone <joshua.i.stone@intel.com>
PR 2594 From Thang P Nguyen <thang.p.nguyen@intel.com> * context.stp (probefunc): expands ability to detect the function for different types of probes.
Diffstat (limited to 'tapset/context.stp')
-rw-r--r--tapset/context.stp36
1 files changed, 32 insertions, 4 deletions
diff --git a/tapset/context.stp b/tapset/context.stp
index 48ee423f..c17aa27a 100644
--- a/tapset/context.stp
+++ b/tapset/context.stp
@@ -89,15 +89,43 @@ function pp:string () %{ /* pure */
%}
function probefunc:string () %{ /* pure */
- char *start = strstr(CONTEXT->probe_point, "function(\"");
+ char *dst, *ptr, *start;
+ String str;
+ int len = MAXSTRINGLEN;
+
+ start = strstr(CONTEXT->probe_point, "function(\"");
+ if (start) {
+ ptr = start + 10;
+ } else {
+ start = strstr(CONTEXT->probe_point, "inline(\"");
+ if (start) {
+ ptr = start + 8;
+ }
+ }
if (start) {
- char *ptr = start+10;
- char *dst = THIS->__retvalue;
- int len = MAXSTRINGLEN;
+ dst = THIS->__retvalue;
while (*ptr != '@' && --len > 0 && *ptr)
*dst++ = *ptr++;
*dst = 0;
+ goto out;
+ }
+ 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);
+ }
+ goto out;
}
+ THIS->__retvalue[0] = '\0';
%}
function is_return:long () %{ /* pure */