How to inject sleep
Bryn M. Reeves
bmr@redhat.com
Wed Apr 18 12:05:00 GMT 2018
On Wed, Apr 18, 2018 at 12:16:17PM +0530, Nayan Gadre wrote:
> probe module("llt").function("llt_send_data"){
> print("LLT_SEND_DATA\n");
> printf("Arguments: [Port: %u, Nid: %u, FragCount: %u,
> Frag_size: %u]\n", $port, $nid, $fcnt, $frags[0]->f_size);
> #printf("local variables %s and arguments %s\n", $$locals, $$vars)
> print_backtrace()
> print("-------------------------------\n")
> }
>
> So would like to inject msleep(10) after entering into this module
> function llt_send_data.
You can't sleep (since that would involve scheduling), but you can
brief busy-waits using the guru-delay tapset.
I wrote this a few years back to allow injecting short pauses into
driver code for fault simulation, and it's proven useful for a few
other situations since.
You should find it in /usr/share/systemtap/tapset/dyninst/guru-delay.stp
or so, and the functions provided are:
mdelay(ms)
udelay(us)
It does require guru-mode (-g) to use, since it can induce quite
dramatic system-wide side effects if used incautiosly.
Regards,
Bryn.
More information about the Systemtap
mailing list