file io script example

Frank Ch. Eigler fche@redhat.com
Tue Sep 13 15:41:00 GMT 2005


jamesd.wi wrote:

> [...too much quoted...]
> > probe kernel.function("sys_close") [...]
> >         print("sysclose: fd = " . string($fd) .
> [...]
> 
> how does fd get set? and/or is there an easy way to access the
> arguments of the kernel functions/syscalls that were sent to the
> functions? [...]

Variables prefixed with the dollar sign are extracted from the context
of the probe point (the sys_close function), and made to refer to the
C variable of the same name, just as a debugger would at that
breakpoint.  So $fd will refer to the sole argument of sys_close().
This is described briefly in the stapprobes(5) man page.


- FChE



More information about the Systemtap mailing list