I've had a play with 'Target Portal Group' on my test system,
which is a circa December 2008 build of OpenSolaris.
# iscsitadm create tpgt 20
# iscsitadm modify tpgt -i 172.16.8.196
# iscsitadm list tpgt -v 20
TPGT: 20
IP Address: 172.16.8.196
# iscsitadm modify target -p 20 rz2pool/iscsi_lun0
# iscsitadm list target -v
Target: rz2pool/iscsi_lun0
iSCSI Name: iqn.1986-03.com.sun:02:8d8294cf-d924-e1c9-978b-bc70c056982f
Alias: rz2pool/iscsi_lun0
Connections: 0
ACL list:
TPGT list:
TPGT: 20
LUN information:
LUN: 0
GUID: 600144f04992033a00001a4d5eb9ba00
VID: SUN
PID: SOLARIS
Type: disk
Size: 4.0G
Backing store: /dev/zvol/rdsk/rz2pool/iscsi_lun0
Status: online
Ok, now for some more DTrace magic:
# dtrace -n 'pid$target::convert_local_tpgt:entry {
printf("%S",copyinstr(arg2)); }' -p `pgrep -o iscsitgtd`
dtrace: description 'pid$target::convert_local_tpgt:entry ' matched 1 probe
CPU ID FUNCTION:NAME
0 81791 convert_local_tpgt:entry 20\0
^C
.. so basically that intercepts the call into function 'convert_local_tpgt()'
and prints out the third arg, which is value of the tpgt,
in this case "20\0", where the "\0" is the null terminator of the string.
The function argument needs to be a '*' pointer to a 'char' array for this to
work.
(Using the Microsoft Initiator, I went to the 'Targets' tab,
and clicked the 'refresh' button, to trigger this function call
in the Solaris iscsi target.)
So this is basically just a demonstration of how you can use DTrace
to examine the arguments passed to a function, which could
be really useful fir debugging, and is, I think, really neat!
Not many Operating System can do that!
Best Regards
Nigel Smith
--
This message posted from opensolaris.org
_______________________________________________
storage-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/storage-discuss