summaryrefslogtreecommitdiffstats
path: root/sys/sys/dtrace_bsd.h
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2009-03-22 22:07:52 +0000
committerrwatson <rwatson@FreeBSD.org>2009-03-22 22:07:52 +0000
commitc0055de89181126603fb1cf69920319d621e0222 (patch)
tree4e2583e975c3114655c0b70a3e8cdbdf47cbdd3a /sys/sys/dtrace_bsd.h
parent39c3581548e72eef83948af293077d0aadbc6f7b (diff)
downloadFreeBSD-src-c0055de89181126603fb1cf69920319d621e0222.zip
FreeBSD-src-c0055de89181126603fb1cf69920319d621e0222.tar.gz
Add dtnfsclient, a first cut at an NFSv2/v3 client reuest DTrace
provider. The NFS client exposes 'start' and 'done' probes for NFSv2 and NFSv3 RPCs when using the new RPC implementation, passing in the vnode, mbuf chain, credential, and NFSv2 or NFSv3 procedure number. For 'done' probes, the error number is also available. Probes are named in the following way: ... nfsclient:nfs2:write:start nfsclient:nfs2:write:done ... nfsclient:nfs3:access:start nfsclient:nfs3:access:done ... Access to the unmarshalled arguments is not easily available at this point in the stack, but the passed probe arguments are sufficient to to a lot of interesting things in practice. Technically, these probes may cover multiple RPC retransmits, and even transactions if the transaction ID change as a result of authentication failure or a jukebox error from the server, but usefully capture the intent of a single NFS request, such as access, getattr, write, etc. Typical use might involve profiling RPC latency by system call, number of RPCs, how often a getattr leads to a call to access, when failed access control checks occur, etc. More detailed RPC information might best be provided by adding a krpc provider. It would also be useful to add NFS client probes for events such as the access cache or attribute cache satisfying requests without an RPC. Sponsored by: Google, Inc. MFC after: 1 month
Diffstat (limited to 'sys/sys/dtrace_bsd.h')
-rw-r--r--sys/sys/dtrace_bsd.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/sys/dtrace_bsd.h b/sys/sys/dtrace_bsd.h
index e0adbe6..737a47a 100644
--- a/sys/sys/dtrace_bsd.h
+++ b/sys/sys/dtrace_bsd.h
@@ -32,6 +32,7 @@
#define _SYS_DTRACE_BSD_H
/* Forward definitions: */
+struct mbuf;
struct trapframe;
struct thread;
@@ -93,6 +94,17 @@ typedef void (*dtrace_malloc_probe_func_t)(u_int32_t, uintptr_t arg0,
extern dtrace_malloc_probe_func_t dtrace_malloc_probe;
+/* The dtnfsclient provider hooks into the NFS[23] client. */
+typedef void (*dtrace_nfsclient_nfs23_start_probe_func_t)(u_int32_t,
+ struct vnode *, struct mbuf *, struct ucred *, int);
+typedef void (*dtrace_nfsclient_nfs23_done_probe_func_t)(u_int32_t,
+ struct vnode *, struct mbuf *, struct ucred *, int, int);
+
+extern dtrace_nfsclient_nfs23_start_probe_func_t
+ dtrace_nfsclient_nfs23_start_probe;
+extern dtrace_nfsclient_nfs23_done_probe_func_t
+ dtrace_nfsclient_nfs23_done_probe;
+
/*
* Functions which allow the dtrace module to check that the kernel
* hooks have been compiled with sufficient space for it's private
OpenPOWER on IntegriCloud