systemtap script linux scsi timeout

January 19, 2012 at 9:44 AM (Uncategorized)

1 #!/usr/bin/stap
2
3 probe begin{
4         print(“Starting probe, watching for SG_IO with threshold greater than “);
5             print($1 / 1000);
6                 print(” seconds.\nType control-c to stop.\n”);
7 }
8
9 probe kernel.function(“sg_io”)
10 {
11         if ($hdr->timeout > $1) {
12                    printf(“%s(%d) called sg_io with timeout = %d, greater than threshold\n”,
13                                         execname(), pid(), $hdr->timeout);
14         }
15         if ($q->sg_timeout > $1){
16                     printf(“%s(%d) called sg_io with sg_timeout = %d, greater than threshold\n”,
17                     execname(), pid(), $q->sg_timeout);
18         }
19 }
20
21 probe end {
22         print(“End probe\n”);
23 }

 

 281static int sg_io(struct request_queue *q, struct gendisk *bd_disk,
 282                struct sg_io_hdr *hdr, fmode_t mode)
 283{
 284        unsigned long start_time;

 

 

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.