srp Provider
The srp provider provides probes for tracing srp port
provider activity.
This is a kernel provider built into the COMSTAR srp target port provider.
Probes
Probes Overview
| |
Service up/down
| srp:::service-up, srp:::service-down
|
Remote Port login/logout
| srp:::login-command, srp:::login-response, srp:::logout-command
|
SRP command/response
| srp:::task-command, srp:::task-response
|
SCSI command/response
| srp:::scsi-command, srp:::scsi-response
|
Data transfer
| srp:::xfer-start, srp:::xfer-done
|
|
For all of the providers below, string fields which are not known contain
the string "<unknown>". Integer fields which are not known contain 0.
Service up/down Event Probes
srp:::service-up and srp:::service-down trace
SRP target online and offline events. Remote port information (ci_remote) is unavailable for both probes.
| | | |
srp:::service-up srp:::service-down
| args[0]
| conninfo_t *
| connection information
|
srp:::service-up srp:::service-down
| args[1]
| srp_portinfo_t *
| local and remote port information
|
|
Remote Port Login/Logout Event Probes
| | | |
srp:::login-command srp:::login-response srp:::logout-command
| args[0]
| conninfo_t *
| connection information
|
srp:::login-command srp:::login-response srp:::logout-command
| args[1]
| srp_portinfo_t *
| local and remote port information
|
srp:::login-command srp:::login-response
| args[2]
| srp_logininfo_t *
| login command/response information
|
|
SRP Command Event Probes
| | | |
srp:::task-command srp:::task-response
| args[0]
| conninfo_t *
| connection information
|
srp:::task-command srp:::task-response
| args[1]
| srp_portinfo_t *
| local and remote port information
|
srp:::scsi-response srp:::scsi-command
| args[2]
| srp_taskinfo_t *
| srp task information
|
|
SCSI Command Event Probes
| | | |
srp:::scsi-command srp:::scsi-response
| args[0]
| conninfo_t *
| connection information
|
srp:::scsi-command srp:::scsi-response
| args[1]
| srp_portinfo_t *
| local and remote port information
|
srp:::scsi-command
| args[2]
| scsicmd_t *
| SCSI command block (cdb)
|
srp:::scsi-response
| args[2]
| srp_taskinfo_t *
| srp task information
|
srp:::scsi-command
| args[3]
| srp_taskinfo_t *
| srp task information
|
|
Data Transfer Probes
| | | |
srp:::xfer-start srp:::xfer-done
| args[0]
| conninfo_t *
| connection information
|
srp:::xfer-start srp:::xfer-done
| args[1]
| fc_port_info_t *
| local port information
|
srp:::xfer-start srp:::xfer-done
| args[2]
| xferinfo_t *
| RDMA transfer information
|
srp:::xfer-start srp:::xfer-done
| args[3]
| srp_taskinfo_t *
| srp task information
|
|
Types
scsicmd_t, conninfo_t and xferinfo_t are common types which are used by other providers.
scsicmd_t
typedef struct scsicmd {
uint64_t ic_len; /* CDB length */
uint8_t *ic_cdb; /* CDB data */
} scsicmd_t;
conninfo_t
typedef struct conninfo {
string ci_local; /* GID of the local HCA */
string ci_remote; /* GID of the remote HCA */
string ci_protocol; /* protocol ("ib") */
} conninfo_t;
srp_portinfo_t
typedef struct srp_portinfo {
/* initiator */
string pi_initiator; /* Initiator: eui.xxxxxxxxxxxxxxx */
string pi_i_sid; /* Initiator seiion id */
/* target */
string pi_target; /* Target: eui.xxxxxxxxxxxxxxx */
string pi_t_sid; /* Target session id */
uintptr_t pi_chan_id; /* Channel identifier */
} srp_portinfo_t;
srp_logininfo_t
typedef struct srp_logininfo {
uint64_t li_task_tag; /* SRP task tag */
uint32_t li_max_it_iu_len; /* Maxium iu length that initiator can
send to target */
uint32_t li_max_ti_iu_len; /* Maxium iu length that target can
send to initiator */
uint32_t li_request_limit; /* Maximun number of SRP requests
that initiator can send on a channel */
uint32_t reason_code; /* Reason code */
} srp_logininfo_t;
srp_taskinfo_t
typedef struct srp_taskinfo {
uint64_t ti_task_tag; /* SRP task tag */
uint64_t ti_lun; /* Target logical unit number */
uint8_t ti_function; /* Task management function */
uint32_t ti_req_limit_delta; /* Increment of channel's request limit */
uint8_t ti_flag; /* bit 2:DOOVER 3:DOUNDER 4:DIOVER 5:DIUNDER */
uint32_t ti_do_resid_cnt; /* Data-out residual count */
uint32_t ti_di_resid_cnt; /* Data-in residual count */
uint8_t ti_status; /* Status of this task */
} srp_taskinfo_t;
xferinfo_t
typedef struct xferinfo {
uintptr_t xfer_laddr; /* Local buffer address */
uint32_t xfer_loffset; /* Relative offset from local buffer */
uint32_t xfer_lkey; /* Access control to local memory */
uintptr_t xfer_raddr; /* Remote virtual address */
uint32_t xfer_roffset; /* Offset from the remote address */
uint32_t xfer_rkey; /* Access control to remote address */
uint32_t xfer_len; /* Transfer length */
uint8_t xfer_type; /* 0: read; 1: write; */
} xferinfo_t;
Examples
service.d
This is a simple script to produce a report of target online/offline
events.
#!/usr/sbin/dtrace -s
#pragma D option quiet
dtrace:::BEGIN
{
printf("Tracing... Hit Ctrl-C to end.\n\n");
printf("%-14s %-35s %-20s\n", "SRP EVENT",
\
"LOCAL PORT", "EUI NAME");
};
srp:::service-up
{
printf("%-14s %-35s %-20s\n", probename,
\
args[0]->ci_local, args[1]->pi_target);
}
srp:::service-down
{
printf("%-14s %-35s %-20s\n", probename,
\
args[0]->ci_local, args[1]->pi_target);
}
This output shows the host and the number of iSCSI operations:
thump1## dtrace -s ~/src/service.d
Tracing... Hit Ctrl-C to end.
^C
SRP EVENT LOCAL PORT EUI NAME
service-down fe80000000000000:0003ba0001004d31 eui.0003BA0001004D30
service-down fe80000000000000:0003ba0001004d32 eui.0003BA0001004D30
service-up fe80000000000000:0003ba0001004d31 eui.0003BA0001004D30
service-up fe80000000000000:0003ba0001004d32 eui.0003BA0001004D30
thump1##
The fields are:
| |
SRP EVENT
| srp event type
|
LOCAL PORT
| GID of the local port
|
EUI NAME
| EUI name of the local port
|
|
srpwho.d
This is a simple script to produce a report of the remote HCA port and
a count of srp events. This is intended to provide a quick summary of srp
activity when run on the SRP target server:
#!/usr/sbin/dtrace -s
#pragma D option quiet
dtrace:::BEGIN
{
printf("Tracing... Hit Ctrl-C to end.\n");
}
srp:::login-command,
srp:::login-response,
srp:::task-command,
srp:::task-response,
srp:::scsi-command,
srp:::scsi-response,
srp:::xfer-start,
srp:::xfer-done
{
@events[args[0]->ci_remote, probename] = count();
}
dtrace:::END
{
printf(" %-33s %14s %8s\n", "REMOTE GID", "iSCSI EVENT", "COUNT");
printa(" %-33s %14s %@8d\n", @events);
}
This output shows the host and the number of iSCSI operations:
thump1## dtrace -s ./srpwho.d
Tracing... Hit Ctrl-C to end.
^C
REMOTE GID iSCSI EVENT COUNT
fe80000000000000:0003ba000100386d login-command 1
fe80000000000000:0003ba000100386d login-response 1
fe80000000000000:0003ba0001003851 login-command 2
fe80000000000000:0003ba0001003851 login-response 2
fe80000000000000:0003ba0001003852 login-command 2
fe80000000000000:0003ba0001003852 login-response 2
fe80000000000000:0003ba0001004d32 xfer-done 9
fe80000000000000:0003ba0001004d32 xfer-start 9
fe80000000000000:0003ba0001004d31 xfer-done 18
fe80000000000000:0003ba0001004d31 xfer-start 18
fe80000000000000:0003ba0001004d32 scsi-command 22
fe80000000000000:0003ba0001004d32 scsi-response 22
fe80000000000000:0003ba0001004d32 task-command 22
fe80000000000000:0003ba0001004d32 task-response 22
fe80000000000000:0003ba0001004d31 scsi-command 42
fe80000000000000:0003ba0001004d31 scsi-response 42
fe80000000000000:0003ba0001004d31 task-command 42
fe80000000000000:0003ba0001004d31 task-response 42
The fields are:
| |
REMOTE GID
| GID of the client HCA port
|
SRP EVENT
| srp event type
|
COUNT
| Number of events traced
|
|
srpsnoop.d
This is a simple script to snoop srp events when run on a srp target
server.
#!/usr/sbin/dtrace -s
#pragma D option quiet
#pragma D option switchrate=10
dtrace:::BEGIN
{
printf("%17s %3s %-40s %-14s %6s %10s %6s\n", "TIMESTAMP",
"CPU", "REMOTE GID", "EVENT", "BYTES", "TAG", "SCSIOP");
/*
* SCSI opcode to string translation hash. This is from
* /usrp/include/sys/scsi/generic/commands.h. If you would
* rather all hex, comment this out.
*/
scsiop[0x08] = "read";
scsiop[0x0a] = "write";
scsiop[0x0b] = "seek";
scsiop[0x28] = "read(10)";
scsiop[0x2a] = "write(10)";
scsiop[0x2b] = "seek(10)";
}
srp:::login-*
{
printf("%17d %3d %-40s %-14s %17d -\n", timestamp, cpu,
args[0]->ci_remote,
probename, args[2]->li_task_tag);
}
srp:::task-command,
srp:::task-response,
srp:::scsi-response
{
printf("%17d %3d %-40s %-14s %6d %10d -\n", timestamp, cpu,
args[0]->ci_remote,
probename, 0, args[2]->ti_task_tag);
}
srp:::scsi-command
/scsiop[args[2]->ic_cdb[0]] != NULL/
{
printf("%17d %3d %-40s %-14s %6d %10d %s\n", timestamp, cpu,
args[0]->ci_remote,
probename, 0, args[3]->ti_task_tag, scsiop[args[2]->ic_cdb[0]]);
}
srp:::scsi-command
/scsiop[args[2]->ic_cdb[0]] == NULL/
{
printf("%17d %3d %-40s %-14s %6d %10d 0x%x\n", timestamp, cpu,
args[0]->ci_remote,
probename, 0, args[3]->ti_task_tag, args[2]->ic_cdb[0]);
}
srp:::xfer-start,
srp:::xfer-done
{
printf("%17d %3d %-40s %-14s %6d %10d %s\n", timestamp,
cpu, args[0]->ci_remote,
probename,args[2]->xfer_len, args[3]->ti_task_tag,
args[2]->xfer_type > 0 ? "READ" : "WRITE");
}
This output shows the snoop on dd commands executed
by the initiator.
thump1## dtrace -s ./srpsnoop.d
TIMESTAMP CPU REMOTE GID EVENT BYTES TAG SCSIOP
22644410404019 3 fe80000000000000:0003ba0001004d31 task-command 0 26 -
22644410493068 3 fe80000000000000:0003ba0001004d31 scsi-command 0 26 read(10)
22644410511422 3 fe80000000000000:0003ba0001004d31 task-command 0 30 -
22644410541494 3 fe80000000000000:0003ba0001004d31 scsi-command 0 30 read(10)
22644410621049 0 fe80000000000000:0003ba0001004d31 xfer-start 2048 26 READ
22644410720486 1 fe80000000000000:0003ba0001004d31 xfer-start 49152 30 READ
22644410681390 3 fe80000000000000:0003ba0001004d31 xfer-done 2048 26 READ
22644410694719 3 fe80000000000000:0003ba0001004d31 scsi-response 0 26 -
22644410703358 3 fe80000000000000:0003ba0001004d31 task-response 0 26 -
22644410895424 3 fe80000000000000:0003ba0001004d31 xfer-done 49152 30 READ
22644410901576 3 fe80000000000000:0003ba0001004d31 scsi-response 0 30 -
22644410905717 3 fe80000000000000:0003ba0001004d31 task-response 0 30 -
22727363721107 3 fe80000000000000:0003ba0001004d31 task-command 0 59 -
22727363919179 0 fe80000000000000:0003ba0001004d31 xfer-start 10240 59 WRITE
22727364095164 0 fe80000000000000:0003ba0001004d31 scsi-response 0 59 -
22727364105406 0 fe80000000000000:0003ba0001004d31 task-response 0 59 -
22727363812953 3 fe80000000000000:0003ba0001004d31 scsi-command 0 59 write(10)
22727363986185 3 fe80000000000000:0003ba0001004d31 xfer-done 10240 59 WRITE
The fields are:
| |
CPU
| CPU event occurred on
|
REMOTE GID
| GID of the client HCA port
|
EVENT
| srp event type
|
BYTES
| Data bytes
|
TAG
| Initiator task tag
|
SCSIOP
| SCSI opcode as a description, as hex, or '-'
|
|