syscalltimes in examples

Frank Ch. Eigler fche@redhat.com
Thu Feb 23 16:34:00 GMT 2012


linxz02@ovi.com writes:

> [...]
> It looked that syscalltimes from 1.7 eliminates most similar bugs but not all:
> [...]

Good point.  I am going to merge a version of your suggested patch,
thanks!

But it seems like this script could be improved further.  Instead of
generating all the script code anew with various values of the F_*
strings, it could just pass those strings as overrides to the globals,
as in:

#  global f_exec_str, f_pid_str, f_uid_str
#  global filter_str
#  
#  probe begin { 
#        /* don't   if ('$F_EXEC') f_exec_str = ... */
#        /* tokenize f_exec_str */
#  }

In other words, don't include any '$FOO' substitutions inside the script
body.  Instead, pass them at run time like this:

#  stap -G f_exec_str='$F_EXECSTR' -G f_pid_str='$F_PIDSTR' ... the_script.stp

The resulting module would be fully cachable.

- FChE



More information about the Systemtap mailing list