6485955 need more dtrace probes
authorahrens
Wed, 25 Oct 2006 10:43:10 -0700
changeset 2981 b80f5da0b8ed
parent 2980 58e8c2989931
child 2982 fcfff4cfc631
6485955 need more dtrace probes
usr/src/lib/libzpool/common/sys/zfs_context.h
usr/src/uts/common/fs/zfs/dmu_objset.c
usr/src/uts/common/fs/zfs/sys/zio.h
usr/src/uts/common/fs/zfs/zio.c
--- a/usr/src/lib/libzpool/common/sys/zfs_context.h	Wed Oct 25 02:41:04 2006 -0700
+++ b/usr/src/lib/libzpool/common/sys/zfs_context.h	Wed Oct 25 10:43:10 2006 -0700
@@ -169,6 +169,11 @@
 #define	DTRACE_PROBE3(a, b, c, d, e, f, g)	((void)0)
 #endif	/* DTRACE_PROBE3 */
 
+#ifdef DTRACE_PROBE4
+#undef	DTRACE_PROBE4
+#define	DTRACE_PROBE4(a, b, c, d, e, f, g, h, i)	((void)0)
+#endif	/* DTRACE_PROBE4 */
+
 /*
  * Threads
  */
--- a/usr/src/uts/common/fs/zfs/dmu_objset.c	Wed Oct 25 02:41:04 2006 -0700
+++ b/usr/src/uts/common/fs/zfs/dmu_objset.c	Wed Oct 25 10:43:10 2006 -0700
@@ -687,7 +687,12 @@
 			}
 			dn = next;
 		}
+
+		DTRACE_PROBE1(wait__begin, zio_t *, zio);
 		err = zio_wait(zio);
+		DTRACE_PROBE4(wait__end, zio_t *, zio,
+		    uint64_t, tx->tx_txg, objset_impl_t *, os, int, level);
+
 		ASSERT(err == 0);
 	}
 }
--- a/usr/src/uts/common/fs/zfs/sys/zio.h	Wed Oct 25 02:41:04 2006 -0700
+++ b/usr/src/uts/common/fs/zfs/sys/zio.h	Wed Oct 25 10:43:10 2006 -0700
@@ -129,6 +129,7 @@
 #define	ZIO_FLAG_SUBBLOCK		0x08000
 
 #define	ZIO_FLAG_NOBOOKMARK		0x10000
+#define	ZIO_FLAG_USER			0x20000
 
 #define	ZIO_FLAG_GANG_INHERIT		\
 	(ZIO_FLAG_CANFAIL |		\
--- a/usr/src/uts/common/fs/zfs/zio.c	Wed Oct 25 02:41:04 2006 -0700
+++ b/usr/src/uts/common/fs/zfs/zio.c	Wed Oct 25 10:43:10 2006 -0700
@@ -314,7 +314,8 @@
 	ASSERT3U(size, ==, BP_GET_LSIZE(bp));
 
 	zio = zio_create(pio, spa, bp->blk_birth, bp, data, size, done, private,
-	    ZIO_TYPE_READ, priority, flags, ZIO_STAGE_OPEN, ZIO_READ_PIPELINE);
+	    ZIO_TYPE_READ, priority, flags | ZIO_FLAG_USER,
+	    ZIO_STAGE_OPEN, ZIO_READ_PIPELINE);
 	zio->io_bookmark = *zb;
 
 	zio->io_logical = zio;
@@ -358,7 +359,7 @@
 	    compress < ZIO_COMPRESS_FUNCTIONS);
 
 	zio = zio_create(pio, spa, txg, bp, data, size, done, private,
-	    ZIO_TYPE_WRITE, priority, flags,
+	    ZIO_TYPE_WRITE, priority, flags | ZIO_FLAG_USER,
 	    ZIO_STAGE_OPEN, ZIO_WRITE_PIPELINE);
 
 	zio->io_bookmark = *zb;
@@ -395,7 +396,7 @@
 	zio_t *zio;
 
 	zio = zio_create(pio, spa, txg, bp, data, size, done, private,
-	    ZIO_TYPE_WRITE, priority, flags,
+	    ZIO_TYPE_WRITE, priority, flags | ZIO_FLAG_USER,
 	    ZIO_STAGE_OPEN, ZIO_REWRITE_PIPELINE);
 
 	zio->io_bookmark = *zb;
@@ -445,7 +446,7 @@
 	}
 
 	zio = zio_create(pio, spa, txg, bp, NULL, 0, done, private,
-	    ZIO_TYPE_FREE, ZIO_PRIORITY_FREE, 0,
+	    ZIO_TYPE_FREE, ZIO_PRIORITY_FREE, ZIO_FLAG_USER,
 	    ZIO_STAGE_OPEN, ZIO_FREE_PIPELINE);
 
 	zio->io_bp = &zio->io_bp_copy;