aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/mdioctl.h
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2013-08-13 03:10:39 +0000
committerMark Johnston <markj@FreeBSD.org>2013-08-13 03:10:39 +0000
commit8776669b53777489f705930295036a5eb0c5a37e (patch)
tree46930cccd981ff368016d8ab6113a94632ab865f /sys/sys/mdioctl.h
parent9c6139e411bb55fae4d7449b71bb06059d9ee090 (diff)
downloadsrc-8776669b53777489f705930295036a5eb0c5a37e.tar.gz
src-8776669b53777489f705930295036a5eb0c5a37e.zip
FreeBSD's DTrace implementation has a few problems with respect to handling
probes declared in a kernel module when that module is unloaded. In particular, * Unloading a module with active SDT probes will cause a panic. [1] * A module's (FBT/SDT) probes aren't destroyed when the module is unloaded; trying to use them after the fact will generally cause a panic. This change fixes both problems by porting the DTrace module load/unload handlers from illumos and registering them with the corresponding EVENTHANDLER(9) handlers. This allows the DTrace framework to destroy all probes defined in a module when that module is unloaded, and to prevent a module unload from proceeding if some of its probes are active. The latter problem has already been fixed for FBT probes by checking lf->nenabled in kern_kldunload(), but moving the check into the DTrace framework generalizes it to all kernel providers and also fixes a race in the current implementation (since a probe may be activated between the check and the call to linker_file_unload()). Additionally, the SDT implementation has been reworked to define SDT providers/probes/argtypes in linker sets rather than using SYSINIT/SYSUNINIT to create and destroy SDT probes when a module is loaded or unloaded. This simplifies things quite a bit since it means that pretty much all of the SDT code can live in sdt.ko, and since it becomes easier to integrate SDT with the DTrace framework. Furthermore, this allows FreeBSD to be quite flexible in that SDT providers spanning multiple modules can be created on the fly when a module is loaded; at the moment it looks like illumos' SDT implementation requires all SDT probes to be statically defined in a single kernel table. PR: 166927, 166926, 166928 Reported by: davide [1] Reviewed by: avg, trociny (earlier version) MFC after: 1 month
Notes
Notes: svn path=/head/; revision=254268
Diffstat (limited to 'sys/sys/mdioctl.h')
0 files changed, 0 insertions, 0 deletions