| 1 |
#! /bin/sh |
| 2 |
|
| 3 |
# This test should only be run when the scsi module is loaded (or scsi |
| 4 |
# functionality is built into the kernel). |
| 5 |
|
| 6 |
# We test for scsi functionality by grepping in /proc/kallsyms for |
| 7 |
# 'scsi_dispatch_cmd', which is what 'scsi.iodispatching' maps to. |
| 8 |
# If that mapping changes this grep command will also need changing. |
| 9 |
if ! grep scsi_dispatch_cmd /proc/kallsyms >/dev/null 2>&1 ; then |
| 10 |
echo "scsi funtionality not present - not running test"; |
| 11 |
exit 0; |
| 12 |
fi |
| 13 |
|
| 14 |
|
| 15 |
stap $@ -p4 - << EOF |
| 16 |
probe scsi.ioentry |
| 17 |
{ |
| 18 |
printf("%20s, disk_major=%d, disk_minor=%d, device_state=%s, req_addr=%p\n", |
| 19 |
probefunc(), disk_major, disk_minor, device_state_str, req_addr) |
| 20 |
} |
| 21 |
|
| 22 |
probe scsi.iodispatching |
| 23 |
{ |
| 24 |
printf("%20s, host_no=%d, channel=%d, lun=%d, dev_id=%d, device_state=%s, data_direction=%s, request_buffer=%p, request_bufflen=%d, req_addr=%p\n", |
| 25 |
probefunc(), host_no, channel, lun, dev_id, device_state_str, |
| 26 |
data_direction_str, request_buffer, request_bufflen, req_addr) |
| 27 |
} |
| 28 |
|
| 29 |
probe scsi.iodone |
| 30 |
{ |
| 31 |
printf("%20s, host_no=%d, channel=%d, lun=%d, dev_id=%d, device_state=%s, data_direction=%s, scsi_timer_pending=%d, req_addr=%p\n", |
| 32 |
probefunc(), host_no, channel, lun, dev_id, device_state_str, |
| 33 |
data_direction_str, scsi_timer_pending, req_addr) |
| 34 |
} |
| 35 |
|
| 36 |
probe scsi.iocompleted |
| 37 |
{ |
| 38 |
printf("%20s, host_no=%d, channel=%d, lun=%d, dev_id=%d, device_state=%s, data_direction=%s, goodbytes=%d, req_addr=%p\n", |
| 39 |
probefunc(), host_no, channel, lun, dev_id, device_state_str, |
| 40 |
data_direction_str, goodbytes, req_addr) |
| 41 |
} |
| 42 |
|
| 43 |
probe scsi.ioexecute |
| 44 |
{ |
| 45 |
printf("%20s, host_no=%d, channel=%d, lun=%d, dev_id=%d, device_state=%s, data_direction=%s, request_buffer=%p, request_bufflen=%d retries=%d, timeout=%d\n", |
| 46 |
probefunc(), host_no, channel, lun, dev_id, device_state_str, |
| 47 |
data_direction_str, request_buffer, request_bufflen, retries, timeout) |
| 48 |
} |
| 49 |
|
| 50 |
probe scsi.set_state |
| 51 |
{ |
| 52 |
printf("%20s, host_no=%d, channel=%d, lun=%d, dev_id=%d, old_state=%s, state=%s\n", |
| 53 |
probefunc(), host_no, channel, lun, dev_id, old_state_str, state_str) |
| 54 |
} |
| 55 |
EOF |