$return in wildcarded void functions
Mike Mason
mmlnx@us.ibm.com
Tue Mar 6 01:31:00 GMT 2007
A co-worker posed this problem... He's debugging code he's not familiar with. He's using wildcarding to probe the entries and exits of all functions in a specific module. The return probe looks something like this:
probe module("uhci_hcd").function("*").return
{
printf ("%s <- %s: %s\n", thread_indent(-2), probefunc(), errno_str($return))
}
The return probe attempts to access $return. For functions defined as void, obviously there is no return value, which causes pass 2 to fail with the following errors:
semantic error: function has no return value: identifier '$return' at usb2:11:85
semantic error: function has no return value: identifier '$return' at usb2:23:85
Is there any way around this problem short of writing a return probe for each function? Is there any way to treat a variable as conditional? That would be a useful feature, especially for wildcarded return probes.
Mike
More information about the Systemtap
mailing list