This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: How to inject sleep
- From: Nayan Gadre <beejoy dot nayan at gmail dot com>
- To: "Bryn M. Reeves" <bmr at redhat dot com>
- Cc: systemtap at sourceware dot org
- Date: Thu, 19 Apr 2018 18:37:39 +0530
- Subject: Re: How to inject sleep
- References: <CABTgHBvg84a7=cHwajDmcn61ksJ0Gq4+sKC+2UiedAFRxtTByg@mail.gmail.com> <20180418120459.GA4131@wlan-5-199.fab.redhat.com>
Hi Bryn,
Thanks, will try that and check.
On Wed, Apr 18, 2018 at 5:34 PM, Bryn M. Reeves <bmr@redhat.com> wrote:
> 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.
>