This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug translator/13009] New: Allow @defined($foo) in probe predicates


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]