svn commit: r297771 - head/sys/cddl/dev/sdt
Mark Johnston
markj at FreeBSD.org
Sun Apr 10 01:24:29 UTC 2016
Author: markj
Date: Sun Apr 10 01:24:27 2016
New Revision: 297771
URL: https://svnweb.freebsd.org/changeset/base/297771
Log:
Initialize SDT probes during SI_SUB_DTRACE_PROVIDER.
This is consistent with all other DTrace providers and ensures that
SDT probes are available for boot-time tracing.
MFC after: 2 weeks
Modified:
head/sys/cddl/dev/sdt/sdt.c
Modified: head/sys/cddl/dev/sdt/sdt.c
==============================================================================
--- head/sys/cddl/dev/sdt/sdt.c Sun Apr 10 01:23:39 2016 (r297770)
+++ head/sys/cddl/dev/sdt/sdt.c Sun Apr 10 01:24:27 2016 (r297771)
@@ -384,28 +384,20 @@ sdt_unload()
static int
sdt_modevent(module_t mod __unused, int type, void *data __unused)
{
- int error = 0;
switch (type) {
case MOD_LOAD:
- sdt_load();
- break;
-
case MOD_UNLOAD:
- error = sdt_unload();
- break;
-
case MOD_SHUTDOWN:
- break;
-
+ return (0);
default:
- error = EOPNOTSUPP;
- break;
+ return (EOPNOTSUPP);
}
-
- return (error);
}
+SYSINIT(sdt_load, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, sdt_load, NULL);
+SYSUNINIT(sdt_unload, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, sdt_unload, NULL);
+
DEV_MODULE(sdt, sdt_modevent, NULL);
MODULE_VERSION(sdt, 1);
MODULE_DEPEND(sdt, dtrace, 1, 1, 1);
More information about the svn-src-head
mailing list