This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to inject sleep


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.
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]