summaryrefslogtreecommitdiffstats
path: root/testsuite/buildok/scsi.stp
blob: dfe855de2897a493bf4a9ba5643f5cb751dfa616 (plain)
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
#! /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("ppname: %s, %d, %d, %d\n", probefunc(),
		disk_major, disk_minor, device_state)
}

probe scsi.iodispatching
{
	printf("ppname: %s, %d, %d, %d, %d, %d, %d, %p, %d\n", probefunc(), 
		host_no, channel, lun, dev_id, device_state, data_direction, 
		request_buffer, request_bufflen)
}


probe scsi.iodone
{
	printf("ppname: %s, %d, %d, %d, %d, %d, %d, %d\n", probefunc(), 
		host_no, channel, lun, dev_id, device_state, data_direction, 
		scsi_timer_pending)
}

probe scsi.iocompleted
{
	printf("ppname: %s, %d, %d, %d, %d, %d, %d, %d\n", probefunc(), 
		host_no, channel, lun, dev_id, device_state, data_direction, 
		goodbytes)
}
EOF