summaryrefslogtreecommitdiffstats
path: root/sys/sys/sdt.h
diff options
context:
space:
mode:
authorrstone <rstone@FreeBSD.org>2012-03-27 15:07:43 +0000
committerrstone <rstone@FreeBSD.org>2012-03-27 15:07:43 +0000
commit0ee65aa24ed3bff9fc4a2b3f62e35821de1fa15f (patch)
tree3e88342c0b877113ee02c840d3b675a1e232f253 /sys/sys/sdt.h
parent126e29ce5f4fb39d333b4d155af4acb71eeb38e4 (diff)
downloadFreeBSD-src-0ee65aa24ed3bff9fc4a2b3f62e35821de1fa15f.zip
FreeBSD-src-0ee65aa24ed3bff9fc4a2b3f62e35821de1fa15f.tar.gz
Instead of only iterating over the set of known SDT probes when sdt.ko is
loaded and unloaded, also have sdt.ko register callbacks with kern_sdt.c that will be called when a newly loaded KLD module adds more probes or a module with probes is unloaded. This fixes two issues: first, if a module with SDT probes was loaded after sdt.ko was loaded, those new probes would not be available in DTrace. Second, if a module with SDT probes was unloaded while sdt.ko was loaded, the kernel would panic the next time DTrace had cause to try and do anything with the no-longer-existent probes. This makes it possible to create SDT probes in KLD modules, although there are still two caveats: first, any SDT probes in a KLD module must be part of a DTrace provider that is defined in that module. At present DTrace only destroys probes when the provider is destroyed, so you can still panic the system if a KLD module creates new probes in a provider from a different module(including the kernel) and then unload the the first module. Second, the system will panic if you unload a module containing SDT probes while there is an active D script that has enabled those probes. MFC after: 1 month
Diffstat (limited to 'sys/sys/sdt.h')
-rw-r--r--sys/sys/sdt.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/sys/sdt.h b/sys/sys/sdt.h
index 3ee18a8..90d1699 100644
--- a/sys/sys/sdt.h
+++ b/sys/sys/sdt.h
@@ -258,6 +258,10 @@ int sdt_argtype_listall(struct sdt_probe *, sdt_argtype_listall_func_t, void *);
int sdt_probe_listall(struct sdt_provider *, sdt_probe_listall_func_t, void *);
int sdt_provider_listall(sdt_provider_listall_func_t,void *);
+void sdt_register_callbacks(sdt_provider_listall_func_t, void *,
+ sdt_provider_listall_func_t, void *, sdt_probe_listall_func_t, void *);
+void sdt_deregister_callbacks(void);
+
#endif /* KDTRACE_HOOKS */
#endif /* _KERNEL */
OpenPOWER on IntegriCloud