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]

Re: $return in wildcarded void functions


I'd prefer something like the current preprocessing conditionals, only for variables (see example below). This way no probes would be skipped, but the probe body could be different based on whether the variable is present. This could be used in a variety of ways beyond just the $return variable. I have no idea how difficult this would be to implement. I assume it isn't a simple matter of extending the preprocessing code since preprocessing is done before accessing the dwarf info.

Mike

probe module("uhci_hcd").function("*").return
{
%( $return exists %?
   printf ("%s <- %s: %s\n", thread_indent(-2), probefunc(), errno_str($return))
%:
   printf ("%s <- %s: void\n", thread_indent(-2), probefunc())
%)
}





Frank Ch. Eigler wrote:
Mike Mason <mmlnx@us.ibm.com> writes:

[...] Is there any way around this problem short of writing a return
probe for each function?

Not at present. However, one could overload the probe optional flag


probe foo.bar("*") ? { $zoo }

to skip probes where complications such as a bad $zoo cause a probe
to be deemed erroneous.  Nonexistent functions are handled like that;
perhaps nonexistent variables could be too.

Is there any way to treat a variable as conditional?  That would be
a useful feature, especially for wildcarded return probes.

Not at present. One might imagine a "$?variable" syntax for optional values. (This would be an independent facility from the optional probe widgetry above.)

- FChE


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