Bug fix for scsi.d

Today, well last night, I learned that dtrace clause local variables (this->) unlike thread local variables (self->) are not initialised by default. This is all clearly stated in the documentation had I read it with more care. My thanks to Adam on the OpenSoalris zfs-discuss alias for pointing it out to me. The long and the short of this means that when I changed scsi.d to use clause local variables I needed to also ensure that they were initialised before testing them.

While I was editing it I also added support for Group 6 and 7 SCSI commands. Since these commands are vendor specific it just prints out the first 32 bytes of the CDB, or the whole CDB if it is less than 32 bytes. In the event that you need more than 32 bytes to be printed adding this is trivial. The section of code, with line numbers, that prints out bytes 25 to 32 is listed here:

   554  PRINT_CDB(24)
   555  PRINT_CDB(25)
   556  PRINT_CDB(26)
   557  PRINT_CDB(27)
   558  PRINT_CDB(28)
   559  PRINT_CDB(29)
   560  PRINT_CDB(30)
   561  PRINT_CDB(31)

There are no prizes for working out how to make it print byte 33.

So there is verson 1.11 of scsi.d.

Tags:

Comments:

Post a Comment:
Comments are closed for this entry.
About

This is the old blog of Chris Gerhard. It has mostly moved to http://chrisgerhard.wordpress.com

Search

Archives
« April 2014
MonTueWedThuFriSatSun
 
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
    
       
Today