Bug 10076 - $return optimization for functions returning void
Summary: $return optimization for functions returning void
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: translator (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
: 10077 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-04-16 16:50 UTC by Ananth Mavinakayanahalli
Modified: 2009-04-16 17:02 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ananth Mavinakayanahalli 2009-04-16 16:50:48 UTC
When wildcard probing function returns, invariably one hits a problem:

[ananth@... ~]$ stap -ve 'probe kernel.function("*@fs/exec.c").return {
printf("%s\n", $return) }'
Pass 1: parsed user script and 51 library script(s) in 520usr/40sys/925real ms.
semantic error: function free_bprm(fs/exec.c) has no return value: identifier
'$return' at <input>:1:62
        source: probe kernel.function("*@fs/exec.c").return { printf("%s\n",
$return) }
                                                                             ^
Pass 2: analyzed script: 29 probe(s), 19 function(s), 0 embed(s), 0 global(s) in
370usr/760sys/1399real ms.
Pass 2: analysis failed.  Try again with another '--vp 01' option.

Would it be possible to emit a warning or a string "no $return in this context"
instead of aborting as above?
Comment 1 Frank Ch. Eigler 2009-04-16 16:53:55 UTC
See $$return.
Comment 2 Ananth Mavinakayanahalli 2009-04-16 17:01:25 UTC
*** Bug 10077 has been marked as a duplicate of this bug. ***
Comment 3 Ananth Mavinakayanahalli 2009-04-16 17:02:30 UTC
Thanks Frank. Works for me.

Guess it needs to be better (visibly) documented. Its currently just in the NEWS
file.