This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug translator/13009] New: Allow @defined($foo) in probe predicates
- From: "jistone at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sourceware dot org
- Date: Wed, 20 Jul 2011 21:20:32 +0000
- Subject: [Bug translator/13009] New: Allow @defined($foo) in probe predicates
- Auto-submitted: auto-generated
http://sourceware.org/bugzilla/show_bug.cgi?id=13009
Summary: Allow @defined($foo) in probe predicates
Product: systemtap
Version: unspecified
Status: NEW
Severity: enhancement
Priority: P2
Component: translator
AssignedTo: systemtap@sourceware.org
ReportedBy: jistone@redhat.com
The @defined() test is statically resolved to either 0 or 1, depending on the
presence of the argument. It would be nice if you could use this to statically
filter probes that have a particular variable. For example, when some
functions don't have a return value:
probe module("jsm").function("*").return if (@defined($return)) {
if ($return < 0)
printf("%s returned %d\n", probefunc(), $return)
}
But this gives "semantic error: unexpected @defined". You could move the
@defined check into the probe body for approximately the same effect, though
still incurring probe hits.
Once @defined is allowed in the predicate, we can further optimize that
predicate == 0 throws the whole body away, and probes with empty bodies are
discarded entirely.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.