A class of special ``target variables'' allow access to the probe point context. In a symbolic debugger, when you're stopped at a breakpoint, you can print values from the program's context. In systemtap scripts, for those probe points that match with specific executable point (rather than an asynchronous event like a timer), you can do the same. To know which variables are likely to be available, you will need to be familiar with the kernel source you are probing. In addition, you will need to check that the compiler has not optimized those values into unreachable nonexistence.
Let's say that you are trying to trace filesystem reads/writes to a
particular device/inode. From your knowledge of the kernel, you know
that two functions of interest could be vfs_read and
vfs_write. Each takes a struct file * argument, inside
which there is a struct dentry *, a struct inode *, and
so on. Systemtap allows limited dereferencing of such pointer chains.
Two functions, user_string and kernel_string, can copy
char * target variables into systemtap strings.
Figure 5 demonstrates one way to monitor a
particular file (identifed by device number and inode number). This
example also demonstrates pasting numeric command-line arguments
($1 etc.) into scripts.