Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Jan 2014 10:50:46 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r260816 - in stable/9/sys: kern modules/dtrace/dtio modules/dtrace/dtraceall
Message-ID:  <201401171050.s0HAokPv028282@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Fri Jan 17 10:50:46 2014
New Revision: 260816
URL: http://svnweb.freebsd.org/changeset/base/260816

Log:
  MFC r257037: Redefine the io provider using the SDT(9) macros
  
  MFC slacker:	markj

Deleted:
  stable/9/sys/kern/dtio_kdtrace.c
  stable/9/sys/modules/dtrace/dtio/
Modified:
  stable/9/sys/kern/subr_devstat.c
  stable/9/sys/modules/dtrace/dtraceall/dtraceall.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/modules/   (props changed)

Modified: stable/9/sys/kern/subr_devstat.c
==============================================================================
--- stable/9/sys/kern/subr_devstat.c	Fri Jan 17 10:48:44 2014	(r260815)
+++ stable/9/sys/kern/subr_devstat.c	Fri Jan 17 10:50:46 2014	(r260816)
@@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/systm.h>
 #include <sys/bio.h>
 #include <sys/devicestat.h>
+#include <sys/sdt.h>
 #include <sys/sysctl.h>
 #include <sys/malloc.h>
 #include <sys/lock.h>
@@ -46,57 +47,21 @@ __FBSDID("$FreeBSD$");
 
 #include <machine/atomic.h>
 
-#ifdef KDTRACE_HOOKS
-#include <sys/dtrace_bsd.h>
+SDT_PROVIDER_DEFINE(io);
 
-dtrace_io_start_probe_func_t dtrace_io_start_probe;
-dtrace_io_done_probe_func_t dtrace_io_done_probe;
-dtrace_io_wait_start_probe_func_t dtrace_io_wait_start_probe;
-dtrace_io_wait_done_probe_func_t dtrace_io_wait_done_probe;
-
-uint32_t	dtio_start_id;
-uint32_t	dtio_done_id;
-uint32_t	dtio_wait_start_id;
-uint32_t	dtio_wait_done_id;
-
-#define DTRACE_DEVSTAT_START() \
-	if (dtrace_io_start_probe != NULL) \
-		(*dtrace_io_start_probe)(dtio_start_id, NULL, ds);
-
-#define DTRACE_DEVSTAT_BIO_START() \
-	if (dtrace_io_start_probe != NULL) \
-		(*dtrace_io_start_probe)(dtio_start_id, bp, ds);
-
-#define DTRACE_DEVSTAT_DONE() \
-	if (dtrace_io_done_probe != NULL) \
-		(*dtrace_io_done_probe)(dtio_done_id, NULL, ds);
-
-#define DTRACE_DEVSTAT_BIO_DONE() \
-	if (dtrace_io_done_probe != NULL) \
-		(*dtrace_io_done_probe)(dtio_done_id, bp, ds);
-
-#define DTRACE_DEVSTAT_WAIT_START() \
-	if (dtrace_io_wait_start_probe != NULL) \
-		(*dtrace_io_wait_start_probe)(dtio_wait_start_id, NULL, ds);
-
-#define DTRACE_DEVSTAT_WAIT_DONE() \
-	if (dtrace_io_wait_done_probe != NULL) \
-		(*dtrace_io_wait_done_probe)(dtio_wait_done_id, NULL, ds);
-
-#else /* ! KDTRACE_HOOKS */
-
-#define DTRACE_DEVSTAT_START()
-
-#define DTRACE_DEVSTAT_BIO_START()
-
-#define DTRACE_DEVSTAT_DONE()
-
-#define DTRACE_DEVSTAT_BIO_DONE()
-
-#define DTRACE_DEVSTAT_WAIT_START()
-
-#define DTRACE_DEVSTAT_WAIT_DONE()
-#endif /* KDTRACE_HOOKS */
+SDT_PROBE_DEFINE2(io, , , start, start, "struct bio *", "struct devstat *");
+SDT_PROBE_DEFINE2(io, , , done, done, "struct bio *", "struct devstat *");
+SDT_PROBE_DEFINE2(io, , , wait_start, wait-start, "struct bio *",
+    "struct devstat *");
+SDT_PROBE_DEFINE2(io, , , wait_done, wait-done, "struct bio *",
+    "struct devstat *");
+
+#define	DTRACE_DEVSTAT_START()		SDT_PROBE2(io, , , start, NULL, ds)
+#define	DTRACE_DEVSTAT_BIO_START()	SDT_PROBE2(io, , , start, bp, ds)
+#define	DTRACE_DEVSTAT_DONE()		SDT_PROBE2(io, , , done, NULL, ds)
+#define	DTRACE_DEVSTAT_BIO_DONE()	SDT_PROBE2(io, , , done, bp, ds)
+#define	DTRACE_DEVSTAT_WAIT_START()	SDT_PROBE2(io, , , wait_start, NULL, ds)
+#define	DTRACE_DEVSTAT_WAIT_DONE()	SDT_PROBE2(io, , , wait_done, NULL, ds)
 
 static int devstat_num_devs;
 static long devstat_generation = 1;

Modified: stable/9/sys/modules/dtrace/dtraceall/dtraceall.c
==============================================================================
--- stable/9/sys/modules/dtrace/dtraceall/dtraceall.c	Fri Jan 17 10:48:44 2014	(r260815)
+++ stable/9/sys/modules/dtrace/dtraceall/dtraceall.c	Fri Jan 17 10:50:46 2014	(r260816)
@@ -65,7 +65,6 @@ MODULE_VERSION(dtraceall, 1);
 MODULE_DEPEND(dtraceall, cyclic, 1, 1, 1);
 MODULE_DEPEND(dtraceall, opensolaris, 1, 1, 1);
 MODULE_DEPEND(dtraceall, dtrace, 1, 1, 1);
-MODULE_DEPEND(dtraceall, dtio, 1, 1, 1);
 MODULE_DEPEND(dtraceall, dtmalloc, 1, 1, 1);
 MODULE_DEPEND(dtraceall, dtnfscl, 1, 1, 1);
 MODULE_DEPEND(dtraceall, dtnfsclient, 1, 1, 1);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201401171050.s0HAokPv028282>