fche changed the topic of #systemtap to: http://sourceware.org/systemtap; email systemtap@sourceware.org if answers here not timely, conversations may be logged
<sfix>
i want to notify a userspace program when my probe is entered so it can translate the functions arguments to human readable strings, is the best way to go about that by parsing stdout from stap?
nkambo has quit [Ping timeout: 252 seconds]
<fche>
sfix, you could pipe stap's stdout into another program. or have stap run system("echo FOO | c+filt")
mbenitez has joined #systemtap
mbenitez has joined #systemtap
mbenitez has quit [Changing host]
pwithnall_ has joined #systemtap
pwithnall_ has quit [Ping timeout: 240 seconds]
sanoj has quit [Ping timeout: 240 seconds]
<drsmith_away>
sfix: You can't run a userspace program from a probe handler and wait on the result, assuming you are using the default linux runtime. Probe handlers are run in atomic context, and can't sleep.
<drsmith_away>
Post-processing the output is one way to go.
<sfix>
fche: drsmith_away: yep, i don't care about the probe getting the result from the userspace program, only that the userspace program received the details from the probe. so i'll go with processing output, thanks!
<drsmith_away>
For instance, that's how you can use c++filt to translate C++ mangled function names into real function names
<drsmith_away>
You can also use the debugging information of the program to translate arguments. For instance, that's how python probing is done.
<fche>
(one could do something desperate and run system("echo FOO | c++filt | /proc/systemtap/MODULE/somefile") and probe procfs("somefile").write { } to get some round-trip data from userspace
<fche>
but that's way out there
<drsmith_away>
sfix: debuginfo can go a long way to help you translate arguments. See tapset/python[23].stp for an example.
<drsmith_away>
Basically you'd write a tapset for your library/program that understood those arguments. The @cast() operator is helpful here.
<sfix>
my userspace program communicates with a netlink socket to translate the values from the probe, so i don't think it'll help there :)
<sfix>
but thanks for the input!
brolley has joined #systemtap
sanoj has joined #systemtap
invano__ has quit [Remote host closed the connection]