This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: problem about tapset script
On Tue, Mar 20, 2012 at 04:07:22PM +0800, ch huang wrote:
> i read tcp.stp script and see the following code ,this is Embedded C
> code ,i do not know why each function has THIS->xxx and
> CATCH_DEREF_FAULT()
> and i can not find the explain in systemtap language reference
> document ,any one can help?
There is some explanation in the language reference guide:
http://sourceware.org/systemtap/langref/Components_SystemTap_script.html#SECTION00045000000000000000
Some more in the tutorial:
http://sourceware.org/systemtap/tutorial/Tapsets.html#SECTION00053000000000000000
And a tiny bit on Embedded C & Safety in the tapset/DEVGUIDE:
http://sourceware.org/git/?p=systemtap.git;a=blob_plain;f=tapset/DEVGUIDE;hb=HEAD
But mainly follow the examples already in the code and in doubt ask
on the list.
Basically whenever you use kread or kwrite in embedded C code you must
add a DEREF_FAULT at the end (defined in runtime/loc2c-runtime.h) to
make sure a failure is reported and causes the script to error out.
Cheers,
Mark