nfsv4 Provider
The nfsv4 provider provides probes for tracing NFS v4 server activity.
This is a place holder. Contribute to the DTrace community by writing this chapter.
Arguments
All NFS operation probes have the first argument in common:
The conninfo_t structure is already used by the iSCSI target provider (iscsi), and is intended for use by all provider which are providing some higher level protocol (e.g. iscsi, nfs, http, ftp).
Operation probes have their second argument in common:
Callback operation probes have their second argument in common:
Top
Probes
Below is a list of the top level operation probes along with the specific argument for each whose type is defined by the NFS v4 specification:
| probe name |
args[2] |
| nfsv4:::compound-op-start |
COMPOUND4args * |
| nfsv4:::compound-op-done |
COMPOUND4res * |
Below is a list of operation probes along with the specific argument for each whose type is defined by the NFS v4 specification:
| probe name |
args[2] |
| nfsv4:::op-access-start |
ACCESS4args * |
| nfsv4:::op-access-done |
ACCESS4res * |
| nfsv4:::op-close-start |
CLOSE4args * |
| nfsv4:::op-close-done |
CLOSE4res * |
| nfsv4:::op-commit-start |
COMMIT4args * |
| nfsv4:::op-commit-done |
COMMIT4res * |
| nfsv4:::op-create-start |
CREATE4args * |
| nfsv4:::op-create-done |
CREATE4res * |
| nfsv4:::op-delegpurge-start |
DELEGPURGE4args * |
| nfsv4:::op-delegpurge-done |
DELEGPURGE4res * |
| nfsv4:::op-delegreturn-start |
DELEGRETURN4args * |
| nfsv4:::op-delegreturn-done |
DELEGRETURN4res * |
| nfsv4:::op-getattr-start |
GETATTR4args * |
| nfsv4:::op-getattr-done |
GETATTR4res * |
| nfsv4:::op-getfh-start |
GETFH4args * |
| nfsv4:::op-getfh-done |
GETFH4res * |
| nfsv4:::op-link-start |
LINK4args * |
| nfsv4:::op-link-done |
LINK4res * |
| nfsv4:::op-lock-start |
LOCK4args * |
| nfsv4:::op-lock-done |
LOCK4res * |
| nfsv4:::op-lockt-start |
LOCKT4args * |
| nfsv4:::op-lockt-done |
LOCKT4res * |
| nfsv4:::op-locku-start |
LOCKU4args * |
| nfsv4:::op-locku-done |
LOCKU4res * |
| nfsv4:::op-lookup-start |
LOOKUP4args * |
| nfsv4:::op-lookup-done |
LOOKUP4res * |
| nfsv4:::op-lookupp-start |
LOOKUPP4args * |
| nfsv4:::op-lookupp-done |
LOOKUPP4res * |
| nfsv4:::op-nverify-start |
NVERIFY4args * |
| nfsv4:::op-nverify-done |
NVERIFY4res * |
| nfsv4:::op-open-start |
OPEN4args * |
| nfsv4:::op-open-done |
OPEN4res * |
| nfsv4:::op-open-confirm-start |
OPEN_CONFIRM4args * |
| nfsv4:::op-open-confirm-done |
OPEN_CONFIRM4res * |
| nfsv4:::op-open-downgrade-start |
OPEN_DOWNGRADE4args * |
| nfsv4:::op-open-downgrade-done |
OPEN_DOWNGRADE4res * |
| nfsv4:::op-openattr-start |
OPENATTR4args * |
| nfsv4:::op-openattr-done |
OPENATTR4res * |
| nfsv4:::op-putfh-start |
PUTFH4args * |
| nfsv4:::op-putfh-done |
PUTFH4res * |
| nfsv4:::op-putpubfh-start |
PUTPUBFH4args * |
| nfsv4:::op-putpubfh-done |
PUTPUBFH4res * |
| nfsv4:::op-putrootfh-start |
PUTROOTFH4args * |
| nfsv4:::op-putrootfh-done |
PUTROOTFH4res * |
| nfsv4:::op-read-start |
READ4args * |
| nfsv4:::op-read-done |
READ4res * |
| nfsv4:::op-readdir-start |
READDIR4args * |
| nfsv4:::op-readdir-done |
READDIR4res * |
| nfsv4:::op-readlink-start |
READLINK4args * |
| nfsv4:::op-readlink-done |
READLINK4res * |
| nfsv4:::op-release-lockowner-start |
RELEASE_LOCKOWNER4args * |
| nfsv4:::op-release-lockowner-done |
RELEASE_LOCKOWNER4res * |
| nfsv4:::op-remove-start |
REMOVE4args * |
| nfsv4:::op-remove-done |
REMOVE4res * |
| nfsv4:::op-rename-start |
RENAME4args * |
| nfsv4:::op-rename-done |
RENAME4res * |
| nfsv4:::op-renew-start |
RENEW4args * |
| nfsv4:::op-renew-done |
RENEW4res * |
| nfsv4:::op-restorefh-start |
<none> |
| nfsv4:::op-restorefh-done |
<none> |
| nfsv4:::op-savefh-start |
SAVEFH4args * |
| nfsv4:::op-savefh-done |
SAVEFH4res * |
| nfsv4:::op-secinfo-start |
SECINFO4args * |
| nfsv4:::op-secinfo-done |
SECINFO4res * |
| nfsv4:::op-setattr-start |
SETATTR4args * |
| nfsv4:::op-setattr-done |
SETATTR4res * |
| nfsv4:::op-setclientid-start |
SETCLIENTID4args * |
| nfsv4:::op-setclientid-done |
SETCLIENTID4res * |
| nfsv4:::op-setclientid-confirm-start |
SETCLIENTID_CONFIRM4args * |
| nfsv4:::op-setclientid-confirm-done |
SETCLIENTID_CONFIRM4res * |
| nfsv4:::op-verify-start |
VERIFY4args * |
| nfsv4:::op-verify-done |
VERIFY4res * |
| nfsv4:::op-write-start |
WRITE4args * |
| nfsv4:::op-write-done |
WRITE4res * |
Callback compound probes have an undefined second argument; this slot isreserved for future use.
Below is a list of the top level callback probes along with the specific argument for each whose type is defined by the NFS v4 specification:
| probe name |
args[2] |
| nfsv4:::compound-cb-start |
CB_COMPOUND4args * |
| nfsv4:::compound-cb-done |
CB_COMPOUND4res * |
Below is a list of callback probes along with the specific argument for each whose type is defined by the NFS v4 specification:
| probe name |
args[2] |
| nfsv4:::cb-getattr-start |
CB_GETATTR4args * |
| nfsv4:::cb-getattr-done |
CB_GETATTR4res * |
| nfsv4:::cb-recall-start |
CB_RECALL4args * |
| nfsv4:::cb-recall-done |
CB_RECALL4res * |
(Note that since the Solaris NFS v4 implementation does not yet use the 'getattr' callback, the probe will not be implemented; it is noted here in anticipation of a future implementation).
Top
Examples
Some simple examples of nfsv4 provider usage follow.
nfsv4rwsnoop.d
This DTrace script traces NFSv4 reads and writes:
This output shows a few files were read, and one was written:
The fields printed are:
| field |
description |
| TIME(us) |
Time of event in microseconds |
| CLIENT |
Remote client IP address |
| OP |
R == read, W == write |
| OFFSET |
File offset of I/O, in Kbytes |
| BYTES |
Bytes of I/O |
| PATHNAME |
Pathname of file, if known |
nfsv4ops.d
This DTrace script counts NFSv4 operations by client, printing a summary every 5 seconds:
The following output shows which client is sending which NFSv4 operations:
The fields printed are:
| field |
description |
| Client |
Remote client IP address |
| Operation |
NFSv4 operation, described using the nfsv4 provider probename |
| Count |
Operations during this interval |
nfsv4fileio.d
This DTrace script prints a summary of file read and write bytes:
This output shows a few files were read, and one was written:
The fields printed are:
| field |
description |
| Rbytes |
Bytes read for this pathname |
| Wbytes |
Bytes written to this pathname |
| Pathname |
Pathname of NFS file |
nfsv4rwtime.d
This DTrace script prints a summary NFSv4 read and write elapsed times (latencies), along with other details:
This output below shows a peak in the read time distribution plot in the 64 to 127 microsecond range, and a second peak between 2 and 8 milliseconds:
Other details are printed, such as total read/write latency by host, and the top 10 files by latency.
The first peak in the read distribution is likely to be NFS operations hitting the memory cache, and the second those that missed and read from disk. The writes were all fast as they are likely to written to the memory cache and returned asynchronously. Further use of DTrace can confirm these theories.
The fields from the distribution plot are:
| field |
description |
| value |
Minimum elapsed time for this event in microseconds |
| count |
Number of events in this time range |
nfsv4io.d
This is a simple DTrace script to provide basic I/O details by host every 5 seconds:
This output shows 192.168.1.109 calling NFSv4 reads and writes:
Other details can be calculated from the output, such as average read and write size (eg, 331(kr/s) / 17(r/s) = 19.5 average kr). These could also be added to the script to be printed as columns.
The fields printed are:
| field |
description |
| Client |
Remote client IP address |
| r/s |
reads per second |
| w/s |
writes per second |
| kr/s |
kilobytes read per second |
| kw/s |
kilobytes written per second |
| ops/s |
total NFSv4 operations per second (including the reads and writes) |