]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/commit
MFC r233552
authorrstone <rstone@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 27 May 2012 14:52:31 +0000 (14:52 +0000)
committerrstone <rstone@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 27 May 2012 14:52:31 +0000 (14:52 +0000)
commite32ee907fd0f5450aad843d7cb7296609f9856ce
treece9a1ab583bb2833bf4a4fad50e5005aafd021f2
parenta2e9f2ada94a42a3373ef11e5c746a841620dff9
MFC r233552

 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.

git-svn-id: svn://svn.freebsd.org/base/stable/8@236153 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/cddl/dev/sdt/sdt.c
sys/kern/kern_sdt.c
sys/sys/sdt.h