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