diff options
author | markj <markj@FreeBSD.org> | 2016-04-10 01:24:27 +0000 |
---|---|---|
committer | markj <markj@FreeBSD.org> | 2016-04-10 01:24:27 +0000 |
commit | 9cabb4498124991a1d317d8d8e111c31966ca609 (patch) | |
tree | 965c2a3c5ac9db93328e0f6e1487e7e50377ab8e | |
parent | 33baaeb76fe6b3a5c254ee1d33e9e923fbecaa26 (diff) | |
download | FreeBSD-src-9cabb4498124991a1d317d8d8e111c31966ca609.zip FreeBSD-src-9cabb4498124991a1d317d8d8e111c31966ca609.tar.gz |
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
-rw-r--r-- | sys/cddl/dev/sdt/sdt.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/sys/cddl/dev/sdt/sdt.c b/sys/cddl/dev/sdt/sdt.c index 4e5dd71..cef816f 100644 --- a/sys/cddl/dev/sdt/sdt.c +++ b/sys/cddl/dev/sdt/sdt.c @@ -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); |