]> granicus.if.org Git - zfs/commitdiff
8659 static dtrace probes unavailable on non-GPL modules
authorBrad Lewis <brad.lewis@delphix.com>
Mon, 8 Jul 2019 18:20:53 +0000 (12:20 -0600)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 8 Jul 2019 18:20:53 +0000 (11:20 -0700)
ZFS tracing efforts are hampered by the inability to access zfs static
probes(probes using DTRACE_PROBE macros). The probes are available via
tracepoints for GPL modules only.  The build could be modified to
generate a function for each unique DTRACE_PROBE invocation. These could
be then accessed via kprobes.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Matt Ahrens <matt@delphix.com>
Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Signed-off-by: Brad Lewis <brad.lewis@delphix.com>
Closes #8659
Closes #8663

18 files changed:
include/spl/sys/sysmacros.h
include/sys/Makefile.am
include/sys/trace.h
include/sys/trace_acl.h
include/sys/trace_arc.h
include/sys/trace_dbgmsg.h
include/sys/trace_dbuf.h
include/sys/trace_dmu.h
include/sys/trace_dnode.h
include/sys/trace_multilist.h
include/sys/trace_rrwlock.h [new file with mode: 0644]
include/sys/trace_txg.h
include/sys/trace_vdev.h
include/sys/trace_zil.h
include/sys/trace_zio.h
include/sys/trace_zrlock.h
module/zfs/rrwlock.c
module/zfs/trace.c

index e11eaece5c9ffd13ba510f5104e1e7418c8d2375..0753864d18c6877df92d60a5c770f8bbe21139cb 100644 (file)
 #define        PAGESHIFT                       PAGE_SHIFT
 #endif
 
-/* Dtrace probes do not exist in the linux kernel */
-#ifdef DTRACE_PROBE
-#undef  DTRACE_PROBE
-#endif  /* DTRACE_PROBE */
-#define        DTRACE_PROBE(a)                                 ((void)0)
-
-#ifdef DTRACE_PROBE1
-#undef  DTRACE_PROBE1
-#endif  /* DTRACE_PROBE1 */
-#define        DTRACE_PROBE1(a, b, c)                          ((void)0)
-
-#ifdef DTRACE_PROBE2
-#undef  DTRACE_PROBE2
-#endif  /* DTRACE_PROBE2 */
-#define        DTRACE_PROBE2(a, b, c, d, e)                    ((void)0)
-
-#ifdef DTRACE_PROBE3
-#undef  DTRACE_PROBE3
-#endif  /* DTRACE_PROBE3 */
-#define        DTRACE_PROBE3(a, b, c, d, e, f, g)              ((void)0)
-
-#ifdef DTRACE_PROBE4
-#undef  DTRACE_PROBE4
-#endif  /* DTRACE_PROBE4 */
-#define        DTRACE_PROBE4(a, b, c, d, e, f, g, h, i)        ((void)0)
-
 /* Missing globals */
 extern char spl_gitrev[64];
 extern unsigned long spl_hostid;
index 368f3fb2afdf8df4d91f0f3e513241e37e08247c..af45eb3bcd6fb6aebb4d04768eea4e5d4659f73e 100644 (file)
@@ -78,6 +78,7 @@ COMMON_H = \
        $(top_srcdir)/include/sys/trace_dmu.h \
        $(top_srcdir)/include/sys/trace_dnode.h \
        $(top_srcdir)/include/sys/trace_multilist.h \
+       $(top_srcdir)/include/sys/trace_rrwlock.h \
        $(top_srcdir)/include/sys/trace_txg.h \
        $(top_srcdir)/include/sys/trace_vdev.h \
        $(top_srcdir)/include/sys/trace_zil.h \
index f32ba529ecd158db8b58e622ddb13920c80c1b50..48497cc35f1e2f87726e7491679563f84005e0a1 100644 (file)
  * CDDL HEADER END
  */
 
-#if defined(_KERNEL) && defined(HAVE_DECLARE_EVENT_CLASS)
+#if defined(_KERNEL)
+
+/*
+ * Calls to DTRACE_PROBE* are mapped to standard Linux kernel trace points
+ * when they are available(when HAVE_DECLARE_EVENT_CLASS is defined).  The
+ * tracepoint event class definitions are found in the general tracing
+ * header file: include/sys/trace_*.h.  See include/sys/trace_vdev.h for
+ * a good example.
+ *
+ * If tracepoints are not available, stub functions are generated which can
+ * be traced using kprobes.  In this case, the DEFINE_DTRACE_PROBE* macros
+ * are used to provide the stub functions and also the prototypes for
+ * those functions.  The mechanism to do this relies on DEFINE_DTRACE_PROBE
+ * macros defined in the general tracing headers(see trace_vdev.h) and
+ * CREATE_TRACE_POINTS being defined only in module/zfs/trace.c.  When ZFS
+ * source files include the general tracing headers, e.g.
+ * module/zfs/vdev_removal.c including trace_vdev.h, DTRACE_PROBE calls
+ * are mapped to stub functions calls and prototypes for those calls are
+ * declared via DEFINE_DTRACE_PROBE*.  Only module/zfs/trace.c defines
+ * CREATE_TRACE_POINTS.  That is follwed by includes of all the general
+ * tracing headers thereby defining all stub functions in one place via
+ * the DEFINE_DTRACE_PROBE macros.
+ *
+ * When adding new DTRACE_PROBEs to zfs source, both a tracepoint event
+ * class defintition and a DEFINE_DTRACE_PROBE definition are needed to
+ * avoid undefined function errors.
+ */
+
+#if defined(HAVE_DECLARE_EVENT_CLASS)
 
 #undef TRACE_SYSTEM
 #define        TRACE_SYSTEM zfs
 #undef _SYS_TRACE_DBGMSG_INDIRECT
 
 /*
- * Redefine the DTRACE_PROBE* functions to use Linux tracepoints
+ * DTRACE_PROBE with 0 arguments is not currently available with
+ *  tracepoint events
  */
-#undef DTRACE_PROBE1
+#define        DTRACE_PROBE(name) \
+       ((void)0)
+
 #define        DTRACE_PROBE1(name, t1, arg1) \
        trace_zfs_##name((arg1))
 
-#undef DTRACE_PROBE2
 #define        DTRACE_PROBE2(name, t1, arg1, t2, arg2) \
        trace_zfs_##name((arg1), (arg2))
 
-#undef DTRACE_PROBE3
 #define        DTRACE_PROBE3(name, t1, arg1, t2, arg2, t3, arg3) \
        trace_zfs_##name((arg1), (arg2), (arg3))
 
-#undef DTRACE_PROBE4
 #define        DTRACE_PROBE4(name, t1, arg1, t2, arg2, t3, arg3, t4, arg4) \
        trace_zfs_##name((arg1), (arg2), (arg3), (arg4))
 
 #define        TRACE_INCLUDE_FILE trace
 #include <trace/define_trace.h>
 
-#endif /* _KERNEL && HAVE_DECLARE_EVENT_CLASS */
+#else /* HAVE_DECLARE_EVENT_CLASS */
+
+#define        DTRACE_PROBE(name) \
+       trace_zfs_##name()
+
+#define        DTRACE_PROBE1(name, t1, arg1) \
+       trace_zfs_##name((uintptr_t)(arg1))
+
+#define        DTRACE_PROBE2(name, t1, arg1, t2, arg2) \
+       trace_zfs_##name((uintptr_t)(arg1), (uintptr_t)(arg2))
+
+#define        DTRACE_PROBE3(name, t1, arg1, t2, arg2, t3, arg3) \
+       trace_zfs_##name((uintptr_t)(arg1), (uintptr_t)(arg2), \
+       (uintptr_t)(arg3))
+
+#define        DTRACE_PROBE4(name, t1, arg1, t2, arg2, t3, arg3, t4, arg4) \
+       trace_zfs_##name((uintptr_t)(arg1), (uintptr_t)(arg2), \
+       (uintptr_t)(arg3), (uintptr_t)(arg4))
+
+#if defined(CREATE_TRACE_POINTS)
+
+#define        FUNC_DTRACE_PROBE(name)                                 \
+noinline void trace_zfs_##name(void) { }                       \
+EXPORT_SYMBOL(trace_zfs_##name)
+
+#define        FUNC_DTRACE_PROBE1(name)                                \
+noinline void trace_zfs_##name(uintptr_t arg1) { }             \
+EXPORT_SYMBOL(trace_zfs_##name)
+
+#define        FUNC_DTRACE_PROBE2(name)                                \
+noinline void trace_zfs_##name(uintptr_t arg1,                 \
+    uintptr_t arg2) { }                                                \
+EXPORT_SYMBOL(trace_zfs_##name)
+
+#define        FUNC_DTRACE_PROBE3(name)                                \
+noinline void trace_zfs_##name(uintptr_t arg1,                 \
+    uintptr_t arg2, uintptr_t arg3) { }                                \
+EXPORT_SYMBOL(trace_zfs_##name)
+
+#define        FUNC_DTRACE_PROBE4(name)                                \
+noinline void trace_zfs_##name(uintptr_t arg1,                 \
+    uintptr_t arg2, uintptr_t arg3, uintptr_t arg4) { }                \
+EXPORT_SYMBOL(trace_zfs_##name)
+
+#undef DEFINE_DTRACE_PROBE
+#define        DEFINE_DTRACE_PROBE(name)       FUNC_DTRACE_PROBE(name)
+
+#undef DEFINE_DTRACE_PROBE1
+#define        DEFINE_DTRACE_PROBE1(name)      FUNC_DTRACE_PROBE1(name)
+
+#undef DEFINE_DTRACE_PROBE2
+#define        DEFINE_DTRACE_PROBE2(name)      FUNC_DTRACE_PROBE2(name)
+
+#undef DEFINE_DTRACE_PROBE3
+#define        DEFINE_DTRACE_PROBE3(name)      FUNC_DTRACE_PROBE3(name)
+
+#undef DEFINE_DTRACE_PROBE4
+#define        DEFINE_DTRACE_PROBE4(name)      FUNC_DTRACE_PROBE4(name)
+
+#else /* CREATE_TRACE_POINTS */
+
+#define        PROTO_DTRACE_PROBE(name)                                \
+       noinline void trace_zfs_##name(void)
+#define        PROTO_DTRACE_PROBE1(name)                               \
+       noinline void trace_zfs_##name(uintptr_t)
+#define        PROTO_DTRACE_PROBE2(name)                               \
+       noinline void trace_zfs_##name(uintptr_t, uintptr_t)
+#define        PROTO_DTRACE_PROBE3(name)                               \
+       noinline void trace_zfs_##name(uintptr_t, uintptr_t,    \
+       uintptr_t)
+#define        PROTO_DTRACE_PROBE4(name)                               \
+       noinline void trace_zfs_##name(uintptr_t, uintptr_t,    \
+       uintptr_t, uintptr_t)
+
+#define        DEFINE_DTRACE_PROBE(name)       PROTO_DTRACE_PROBE(name)
+#define        DEFINE_DTRACE_PROBE1(name)      PROTO_DTRACE_PROBE1(name)
+#define        DEFINE_DTRACE_PROBE2(name)      PROTO_DTRACE_PROBE2(name)
+#define        DEFINE_DTRACE_PROBE3(name)      PROTO_DTRACE_PROBE3(name)
+#define        DEFINE_DTRACE_PROBE4(name)      PROTO_DTRACE_PROBE4(name)
+
+#endif /* CREATE_TRACE_POINTS */
+
+/*
+ * The sys/trace_dbgmsg.h header defines tracepoint events for
+ * dprintf(), dbgmsg(), and SET_ERROR().
+ */
+#define        _SYS_TRACE_DBGMSG_INDIRECT
+#include <sys/trace_dbgmsg.h>
+#undef _SYS_TRACE_DBGMSG_INDIRECT
+
+#endif /* HAVE_DECLARE_EVENT_CLASS */
+#endif /* _KERNEL */
index 610bbe29c25c19842631dd4720f6be8223d3685f..083560952f0bf16eff80245da77f33cd1d45bda2 100644 (file)
@@ -19,7 +19,8 @@
  * CDDL HEADER END
  */
 
-#if defined(_KERNEL) && defined(HAVE_DECLARE_EVENT_CLASS)
+#if defined(_KERNEL)
+#if defined(HAVE_DECLARE_EVENT_CLASS)
 
 #undef TRACE_SYSTEM
 #define        TRACE_SYSTEM zfs
@@ -153,4 +154,11 @@ DEFINE_ACE_EVENT(zfs_zfs__ace__allows);
 #define        TRACE_INCLUDE_FILE trace_acl
 #include <trace/define_trace.h>
 
-#endif /* _KERNEL && HAVE_DECLARE_EVENT_CLASS */
+#else
+
+DEFINE_DTRACE_PROBE3(zfs__ace__denies);
+DEFINE_DTRACE_PROBE3(zfs__ace__allows);
+DEFINE_DTRACE_PROBE(zfs__fastpath__execute__access__miss);
+
+#endif /* HAVE_DECLARE_EVENT_CLASS */
+#endif /* _KERNEL */
index c40b58e32d9112d75ba67e5417838f499668abf5..5ce5b38a3ca3f103192de134188954f33b913941 100644 (file)
@@ -21,7 +21,8 @@
 
 #include <sys/list.h>
 
-#if defined(_KERNEL) && defined(HAVE_DECLARE_EVENT_CLASS)
+#if defined(_KERNEL)
+#if defined(HAVE_DECLARE_EVENT_CLASS)
 
 #undef TRACE_SYSTEM
 #define        TRACE_SYSTEM zfs
@@ -361,4 +362,22 @@ DEFINE_L2ARC_EVICT_EVENT(zfs_l2arc__evict);
 #define        TRACE_INCLUDE_FILE trace_arc
 #include <trace/define_trace.h>
 
-#endif /* _KERNEL && HAVE_DECLARE_EVENT_CLASS */
+#else
+
+DEFINE_DTRACE_PROBE1(arc__hit);
+DEFINE_DTRACE_PROBE1(arc__evict);
+DEFINE_DTRACE_PROBE1(arc__delete);
+DEFINE_DTRACE_PROBE1(new_state__mru);
+DEFINE_DTRACE_PROBE1(new_state__mfu);
+DEFINE_DTRACE_PROBE1(arc__async__upgrade__sync);
+DEFINE_DTRACE_PROBE1(arc__demand__hit__predictive__prefetch);
+DEFINE_DTRACE_PROBE1(l2arc__hit);
+DEFINE_DTRACE_PROBE1(l2arc__miss);
+DEFINE_DTRACE_PROBE2(l2arc__read);
+DEFINE_DTRACE_PROBE2(l2arc__write);
+DEFINE_DTRACE_PROBE2(l2arc__iodone);
+DEFINE_DTRACE_PROBE4(arc__miss);
+DEFINE_DTRACE_PROBE4(l2arc__evict);
+
+#endif /* HAVE_DECLARE_EVENT_CLASS */
+#endif /* _KERNEL */
index a4aab1e63f756146f521e5871f34d93cd40dfdda..b2ef529ed6538244c3820afa36674857f0b8b989 100644 (file)
@@ -19,6 +19,9 @@
  * CDDL HEADER END
  */
 
+#if defined(_KERNEL)
+#if defined(HAVE_DECLARE_EVENT_CLASS)
+
 /* Do not include this file directly. Please use <sys/trace.h> instead. */
 #ifndef _SYS_TRACE_DBGMSG_INDIRECT
 #error "trace_dbgmsg.h included directly"
@@ -63,3 +66,10 @@ DEFINE_EVENT(zfs_dprintf_class, name, \
        TP_ARGS(msg))
 /* END CSTYLED */
 DEFINE_DPRINTF_EVENT(zfs_zfs__dprintf);
+
+#else
+
+DEFINE_DTRACE_PROBE1(zfs__dprintf);
+
+#endif /* HAVE_DECLARE_EVENT_CLASS */
+#endif /* _KERNEL */
index e97b61137760eee706ae021b665e39363c343ea6..fb12e28545d12cf6d2b4c31d2a14b5f5cf847eb0 100644 (file)
@@ -19,7 +19,8 @@
  * CDDL HEADER END
  */
 
-#if defined(_KERNEL) && defined(HAVE_DECLARE_EVENT_CLASS)
+#if defined(_KERNEL)
+#if defined(HAVE_DECLARE_EVENT_CLASS)
 
 #undef TRACE_SYSTEM
 #define        TRACE_SYSTEM zfs
@@ -142,4 +143,10 @@ DEFINE_DBUF_EVICT_ONE_EVENT(zfs_dbuf__evict__one);
 #define        TRACE_INCLUDE_FILE trace_dbuf
 #include <trace/define_trace.h>
 
-#endif /* _KERNEL && HAVE_DECLARE_EVENT_CLASS */
+#else
+
+DEFINE_DTRACE_PROBE2(blocked__read);
+DEFINE_DTRACE_PROBE2(dbuf__evict__one);
+
+#endif /* HAVE_DECLARE_EVENT_CLASS */
+#endif /* _KERNEL */
index 24e57f5146a4f11c997dd29734b4ec65e06a98e4..3c64a370f84285cc30b4e810461672f4f028dd7e 100644 (file)
@@ -19,7 +19,8 @@
  * CDDL HEADER END
  */
 
-#if defined(_KERNEL) && defined(HAVE_DECLARE_EVENT_CLASS)
+#if defined(_KERNEL)
+#if defined(HAVE_DECLARE_EVENT_CLASS)
 
 #undef TRACE_SYSTEM
 #define        TRACE_SYSTEM zfs
@@ -126,4 +127,10 @@ DEFINE_FREE_LONG_RANGE_EVENT(zfs_free__long__range);
 #define        TRACE_INCLUDE_FILE trace_dmu
 #include <trace/define_trace.h>
 
-#endif /* _KERNEL && HAVE_DECLARE_EVENT_CLASS */
+#else
+
+DEFINE_DTRACE_PROBE3(delay__mintime);
+DEFINE_DTRACE_PROBE3(free__long__range);
+
+#endif /* HAVE_DECLARE_EVENT_CLASS */
+#endif /* _KERNEL */
index 7196a497d506cfd05c6bf344932352f339885ab2..27ad6cba16d62239d7143603c24984e5ff13b6b3 100644 (file)
@@ -19,7 +19,8 @@
  * CDDL HEADER END
  */
 
-#if defined(_KERNEL) && defined(HAVE_DECLARE_EVENT_CLASS)
+#if defined(_KERNEL)
+#if defined(HAVE_DECLARE_EVENT_CLASS)
 
 #undef TRACE_SYSTEM
 #define        TRACE_SYSTEM zfs
@@ -120,4 +121,9 @@ DEFINE_DNODE_MOVE_EVENT(zfs_dnode__move);
 #define        TRACE_INCLUDE_FILE trace_dnode
 #include <trace/define_trace.h>
 
-#endif /* _KERNEL && HAVE_DECLARE_EVENT_CLASS */
+#else
+
+DEFINE_DTRACE_PROBE3(dnode__move);
+
+#endif /* HAVE_DECLARE_EVENT_CLASS */
+#endif /* _KERNEL */
index ed0b38a3f38f5f1fd703922b2195b201d3c61cad..fe68d5296f73e9c137a69c55a9090e83a7f5e0e1 100644 (file)
@@ -19,7 +19,8 @@
  * CDDL HEADER END
  */
 
-#if defined(_KERNEL) && defined(HAVE_DECLARE_EVENT_CLASS)
+#if defined(_KERNEL)
+#if defined(HAVE_DECLARE_EVENT_CLASS)
 
 #undef TRACE_SYSTEM
 #define        TRACE_SYSTEM zfs
@@ -79,4 +80,10 @@ DEFINE_MULTILIST_INSERT_REMOVE_EVENT(zfs_multilist__remove);
 #define        TRACE_INCLUDE_FILE trace_multilist
 #include <trace/define_trace.h>
 
-#endif /* _KERNEL && HAVE_DECLARE_EVENT_CLASS */
+#else
+
+DEFINE_DTRACE_PROBE3(multilist__insert);
+DEFINE_DTRACE_PROBE3(multilist__remove);
+
+#endif /* HAVE_DECLARE_EVENT_CLASS */
+#endif /* _KERNEL */
diff --git a/include/sys/trace_rrwlock.h b/include/sys/trace_rrwlock.h
new file mode 100644 (file)
index 0000000..4c74d62
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+#if defined(_KERNEL)
+#if defined(HAVE_DECLARE_EVENT_CLASS)
+
+#else
+
+DEFINE_DTRACE_PROBE(zfs__rrwfastpath__rdmiss);
+DEFINE_DTRACE_PROBE(zfs__rrwfastpath__exitmiss);
+
+#endif /* HAVE_DECLARE_EVENT_CLASS */
+#endif /* _KERNEL */
index f85c3f9ef7e1ed804a5e06e767e38945676a9ecd..23d5d358bc42b84fb1a828337fa69a6b2365439f 100644 (file)
@@ -19,7 +19,8 @@
  * CDDL HEADER END
  */
 
-#if defined(_KERNEL) && defined(HAVE_DECLARE_EVENT_CLASS)
+#if defined(_KERNEL)
+#if defined(HAVE_DECLARE_EVENT_CLASS)
 
 #undef TRACE_SYSTEM
 #define        TRACE_SYSTEM zfs
@@ -75,4 +76,14 @@ DEFINE_TXG_EVENT(zfs_txg__quiesced);
 #define        TRACE_INCLUDE_FILE trace_txg
 #include <trace/define_trace.h>
 
-#endif /* _KERNEL && HAVE_DECLARE_EVENT_CLASS */
+#else
+
+DEFINE_DTRACE_PROBE2(dsl_pool_sync__done);
+DEFINE_DTRACE_PROBE2(txg__quiescing);
+DEFINE_DTRACE_PROBE2(txg__opened);
+DEFINE_DTRACE_PROBE2(txg__syncing);
+DEFINE_DTRACE_PROBE2(txg__synced);
+DEFINE_DTRACE_PROBE2(txg__quiesced);
+
+#endif /* HAVE_DECLARE_EVENT_CLASS */
+#endif /* _KERNEL */
index d7af44c2539719fb4838058ff153b1982ce7f108..289aca69eb7cdd438e44b2bdb4c46b3aa1220d95 100644 (file)
  * CDDL HEADER END
  */
 
-#if defined(_KERNEL) && defined(HAVE_DECLARE_EVENT_CLASS)
+#if defined(_KERNEL)
+#if defined(HAVE_DECLARE_EVENT_CLASS)
+
+/*
+ * If tracepoints are available define dtrace_probe events for vdev
+ * related probes.  Definitions in usr/include/trace.h will map
+ * DTRACE_PROBE* calls to tracepoints.
+ */
 
 #undef TRACE_SYSTEM
 #define        TRACE_SYSTEM zfs
@@ -116,4 +123,18 @@ DEFINE_REMOVE_FREE_EVENT_TXG(zfs_remove__free__inflight);
 #define        TRACE_INCLUDE_FILE trace_vdev
 #include <trace/define_trace.h>
 
-#endif /* _KERNEL && HAVE_DECLARE_EVENT_CLASS */
+#else
+
+/*
+ * When tracepoints are not available, a DEFINE_DTRACE_PROBE* macro is
+ * needed for each DTRACE_PROBE.  These will be used to generate stub
+ * tracing functions and protoypes for those functions.  See
+ * include/sys/trace.h.
+ */
+
+DEFINE_DTRACE_PROBE3(remove__free__synced);
+DEFINE_DTRACE_PROBE3(remove__free__unvisited);
+DEFINE_DTRACE_PROBE4(remove__free__inflight);
+
+#endif /* HAVE_DECLARE_EVENT_CLASS */
+#endif /* _KERNEL */
index ff16c8686cc4529e56d9ae13aff5749bbfbd268a..526846e664b2004ae07a04d102b7346d8ebda6f3 100644 (file)
@@ -19,7 +19,8 @@
  * CDDL HEADER END
  */
 
-#if defined(_KERNEL) && defined(HAVE_DECLARE_EVENT_CLASS)
+#if defined(_KERNEL)
+#if defined(HAVE_DECLARE_EVENT_CLASS)
 
 #undef TRACE_SYSTEM
 #define        TRACE_SYSTEM zfs
@@ -218,4 +219,11 @@ DEFINE_ZIL_COMMIT_IO_ERROR_EVENT(zfs_zil__commit__io__error);
 #define        TRACE_INCLUDE_FILE trace_zil
 #include <trace/define_trace.h>
 
-#endif /* _KERNEL && HAVE_DECLARE_EVENT_CLASS */
+#else
+
+DEFINE_DTRACE_PROBE2(zil__process__commit__itx);
+DEFINE_DTRACE_PROBE2(zil__process__normal__itx);
+DEFINE_DTRACE_PROBE2(zil__commit__io__error);
+
+#endif /* HAVE_DECLARE_EVENT_CLASS */
+#endif /* _KERNEL */
index af589b9dfa6db236b2d791231b230d8e1425c56d..8655e245c0436c70381a2a991aa3edf25107e189 100644 (file)
@@ -21,7 +21,8 @@
 
 #include <sys/list.h>
 
-#if defined(_KERNEL) && defined(HAVE_DECLARE_EVENT_CLASS)
+#if defined(_KERNEL)
+#if defined(HAVE_DECLARE_EVENT_CLASS)
 
 #undef TRACE_SYSTEM
 #define        TRACE_SYSTEM zfs
@@ -86,4 +87,11 @@ TRACE_EVENT(zfs_zio__delay__skip,
 #define        TRACE_INCLUDE_FILE trace_zio
 #include <trace/define_trace.h>
 
-#endif /* _KERNEL && HAVE_DECLARE_EVENT_CLASS */
+#else
+
+DEFINE_DTRACE_PROBE2(zio__delay__miss);
+DEFINE_DTRACE_PROBE3(zio__delay__hit);
+DEFINE_DTRACE_PROBE1(zio__delay__skip);
+
+#endif /* HAVE_DECLARE_EVENT_CLASS */
+#endif /* _KERNEL */
index fa330f2c19aa02b8f15c92072854065e7a0472a3..23f9577ba15f1e5d2bc4a3f5443ee868067b89da 100644 (file)
@@ -19,7 +19,8 @@
  * CDDL HEADER END
  */
 
-#if defined(_KERNEL) && defined(HAVE_DECLARE_EVENT_CLASS)
+#if defined(_KERNEL)
+#if defined(HAVE_DECLARE_EVENT_CLASS)
 
 #undef TRACE_SYSTEM
 #define        TRACE_SYSTEM zfs
@@ -85,4 +86,9 @@ DEFINE_ZRLOCK_EVENT(zfs_zrlock__reentry);
 #define        TRACE_INCLUDE_FILE trace_zrlock
 #include <trace/define_trace.h>
 
-#endif /* _KERNEL && HAVE_DECLARE_EVENT_CLASS */
+#else
+
+DEFINE_DTRACE_PROBE3(zrlock__reentry);
+
+#endif /* HAVE_DECLARE_EVENT_CLASS */
+#endif /* _KERNEL */
index 582b40a583fb0f459963417a0734343617fb350e..32d45f674ac47dd17ffd6a204c26893d2d2f16ad 100644 (file)
@@ -28,6 +28,7 @@
 
 #include <sys/refcount.h>
 #include <sys/rrwlock.h>
+#include <sys/trace_rrwlock.h>
 
 /*
  * This file contains the implementation of a re-entrant read
index eb6efe841cbd2971536f8a2791663c27e2b08f46..fe503776b4d9aa602c6935e72c5afa77b44e2a02 100644 (file)
  *
  * CDDL HEADER END
  */
+
 /*
- * Each Linux tracepoints subsystem must define CREATE_TRACE_POINTS in one
- * (and only one) C file, so this dummy file exists for that purpose.
+ * Each DTRACE_PROBE must define its trace point in one (and only one)
+ * source file, so this dummy file exists for that purpose.
  */
 
 #include <sys/multilist.h>
@@ -45,6 +46,7 @@
 #include <sys/trace_dmu.h>
 #include <sys/trace_dnode.h>
 #include <sys/trace_multilist.h>
+#include <sys/trace_rrwlock.h>
 #include <sys/trace_txg.h>
 #include <sys/trace_vdev.h>
 #include <sys/trace_zil.h>