fibre channel Provider

Skip to end of metadata
Go to start of metadata

fc Provider

Under Development
This DTrace provider is in development and is not available as of April 29, 2009.

The fc provider provides probes for tracing fibre channel port provider activity.

This is a kernel provider built into the COMSTAR fc target port provider.

Probes

Probes Overview

Fibre Channel Event Probes
Link events fc:::link-up, fc:::link-down
Remote Port login/logout fc:::rport-login-start, fc:::rport-login-end, fc:::rport-logout-start, fc:::rport-logout-end
Fabric login fc:::fabric-login-start, fc:::fabric-login-end
SCSI command/response fc:::scsi-command, fc:::scsi-response
Data transfer fc:::xfer-start, fc:::xfer-done
RSCN receive fc:::rscn-receive
ABTS receive fc:::abts-receive

For all of the providers below, string fields which are not known contain the string "<unknown>". Integer fields which are not known contain 0.

Top

Link Event Probes

fc:::link-up and fc:::link-down trace Fibre Channel link-up and link-down events.
Remote port information (ci_remote) is unavailable for both probes.

Probes Variable Type Description
fc:::link-up
fc:::link-down
args[0] conninfo_t * connection info

Remote Port Login/Logout Event Probes

Probes Variable Type Description
fc:::rport-login-start
fc:::rport-login-end
fc:::rport-logout-start
fc:::rport-logout-end
args[0] conninfo_t * connection info
fc:::rport-login-start
fc:::rport-login-end
fc:::rport-logout-start
fc:::rport-logout-end
args[1] fc_port_info_t * local port information
fc:::rport-login-start
fc:::rport-login-end
fc:::rport-logout-start
fc:::rport-logout-end
args[2] fc_port_info_t * remote port information
fc:::rport-login-start
fc:::rport-login-end
fc:::rport-logout-start
fc:::rport-logout-end
args[3] int Solicited login flag:
0 if unsolicited (inbound), non-zero if solicited (outbound).

Top

Fabric Login Event Probes

Probes Variable Type Description
fc:::fabric-login-start
fc:::fabric-login-end
args[0] conninfo_t * connection info
fc:::fabric-login-end args[1] fc_port_info_t * local port information info

Fabric login applies only to the local port, since that's the entity that logs into the fabric. Note that there's no explicit fabric logout. Detailed local port information is only known at the end of fabric login.

Top

SCSI Command Event Probes

Probes Variable Type Description
fc:::scsi-command
fc:::scsi-response
args[0] conninfo_t * connection info
fc:::scsi-command
fc:::scsi-response
args[1] fc_port_info_t * local port information
fc:::scsi-command
fc:::scsi-response
args[2] scsicmd_t * SCSI command block (cdb)
fc:::scsi-command
fc:::scsi-response
args[3] fc_port_info_t * remote port information

Top

Data Transfer Probes

Probes Variable Type Description
fc:::xfer-start
fc:::xfer-done
args[0] conninfo_t * connection info
fc:::xfer-start
fc:::xfer-done
args[1] fc_port_info_t * local port information
fc:::xfer-start
fc:::xfer-done
args[2] scsicmd_t * SCSI command block (cdb)
fc:::xfer-start
fc:::xfer-done
args[3] fc_port_info_t * remote port information
fc:::xfer-start
fc:::xfer-done
args[4] fc_xferinfo_t * data transfer information

RSCN Receive Event Probes

Probes Variable Type Description
fc:::rscn-receive args[0] conninfo_t * connection info
fc:::rscn-receive args[1] fc_port_info_t * local port info
fc:::rscn-receive args[2] int port id

ABTS Receive Event Probes

Probes Variable Type Description
fc:::abts-receive args[0] conninfo_t * connection info
fc:::abts-receive args[1] fc_port_info_t * local port info
fc:::abts-receive args[2] fc_port_info_t * remote port info

Top

Types

Common types
scsicmd_t and conninfo_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;        /* local port WWN */
        string ci_remote;       /* remote port WWN */
        string ci_protocol;     /* protocol ("fc") */
} conninfo_t;

fc_port_info_t

typedef struct fc_port_info {
	string fcp_node_wwn;		/* node WWN */
	string fcp_sym_node_name;	/* node symbolic name */
	string fcp_sym_port_name;	/* port symbolic name */
	uint32_t fcp_port_hard_address;	/* port hard address */
} fc_port_info_t;

fc_xferinfo_t

typedef struct fc_xferinfo {
	uint32_t fcx_len;	/* transfer length */
	uint32_t fcx_offset;	/* transfer offset */
	uint16_t fcx_flags;	/* db_flags as defined in sys/stmf.h */
} fc_xferinfo_t;

Top

Examples

One-liners

Frequency of fc SCSI command types:

# dtrace -n 'fc:::scsi-command { @[args[2]->ic_cdb[0]] = count(); }'

Payload bytes by fc SCSI command type:

# dtrace -n 'fc:::xfer-start { @[args[2]->ic_cdb[0]] = sum(args[4]->fcx_len); }'

Frequency of fc port related RSCN:

# dtrace -n 'fc:::rscn-receive  { @[arg2] = count(); }' 
fcwho.d

This is a simple script to produce a report of the remote port WWN and a count of fc events. This is intended to provide a quick summary of fc activity when run on the iSCSI target server:

#!/usr/sbin/dtrace -s

#pragma D option quiet

dtrace:::BEGIN
{
        printf("Tracing... Hit Ctrl-C to end.\n");
}

fc:::scsi-command
{
        @events[args[0]->ci_remote, probename] = count();
}

fc:::scsi-response
{
        @events[args[0]->ci_remote, probename] = count();
}

fc:::xfer-start
{
        @events[args[0]->ci_remote, probename] = count();
}

fc:::xfer-done
{
        @events[args[0]->ci_remote, probename] = count();
}

fc:::rport-login-start
{
        @events[args[0]->ci_remote, probename] = count();
}

fc:::rport-login-end
{
        @events[args[0]->ci_remote, probename] = count();
}

fc:::rport-logout-start
{
        @events[args[0]->ci_remote, probename] = count();
}

fc:::rport-logout-end
{
        @events[args[0]->ci_remote, probename] = count();
}

fc:::fabric-login-start
{
        @events[args[0]->ci_remote, probename] = count();
}

fc:::fabric-login-end
{
        @events[args[0]->ci_remote, probename] = count();
}

dtrace:::END
{
        printf("   %-26s %14s %8s\n", "REMOTE WWN", "FC EVENT", "COUNT");
        printa("   %-26s %14s %@8d\n", @events);
}

This output shows the host and the number of iSCSI operations:

chelm## dtrace -s ~/src/fcwho.d
Tracing... Hit Ctrl-C to end.
^C 
   REMOTE WWN                       FC EVENT    COUNT
   2100001b3286c264            scsi-response     1863
   2100001b3286c264                xfer-done     3889
   2100001b3286c264               xfer-start     3889
   2100001b3286c264             scsi-command     3945

chelm## 

The fields are:

field description
REMOTE WWN WWN of the client port
FC EVENT fc event type
COUNT Number of events traced
Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

Sign up or Log in to add a comment or watch this page.


The individuals who post here are part of the extended Oracle community and they might not be employed or in any way formally affiliated with Oracle. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Oracle nor any other party necessarily agrees with them.