Date: Thu, 24 Oct 2013 02:39:07 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257037 - in head/sys: kern modules/dtrace modules/dtrace/dtio modules/dtrace/dtraceall Message-ID: <201310240239.r9O2d7JA060966@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Thu Oct 24 02:39:07 2013 New Revision: 257037 URL: http://svnweb.freebsd.org/changeset/base/257037 Log: Redefine the io provider using the SDT(9) macros instead of doing everything manually. This change has no functional impact. Discussed with: gnn Deleted: head/sys/kern/dtio_kdtrace.c head/sys/modules/dtrace/dtio/ Modified: head/sys/kern/subr_devstat.c head/sys/modules/dtrace/Makefile head/sys/modules/dtrace/dtraceall/dtraceall.c Modified: head/sys/kern/subr_devstat.c ============================================================================== --- head/sys/kern/subr_devstat.c Thu Oct 24 01:06:44 2013 (r257036) +++ head/sys/kern/subr_devstat.c Thu Oct 24 02:39:07 2013 (r257037) @@ -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: head/sys/modules/dtrace/Makefile ============================================================================== --- head/sys/modules/dtrace/Makefile Thu Oct 24 01:06:44 2013 (r257036) +++ head/sys/modules/dtrace/Makefile Thu Oct 24 02:39:07 2013 (r257037) @@ -9,7 +9,6 @@ SUBDIR= dtmalloc \ dtrace \ dtraceall \ dtrace_test \ - dtio \ lockstat \ profile \ prototype \ Modified: head/sys/modules/dtrace/dtraceall/dtraceall.c ============================================================================== --- head/sys/modules/dtrace/dtraceall/dtraceall.c Thu Oct 24 01:06:44 2013 (r257036) +++ head/sys/modules/dtrace/dtraceall/dtraceall.c Thu Oct 24 02:39:07 2013 (r257037) @@ -66,7 +66,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); #if defined(NFSCLIENT)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310240239.r9O2d7JA060966>