This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: file io script example
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