freebsd-dev/sys/cddl/dev
Ryan Stone 9742410797 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
2012-03-27 15:07:43 +00:00
..
cyclic Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs. 2011-11-07 06:44:47 +00:00
dtmalloc
dtrace - For o32 ABI get arguments from the stack 2012-03-26 21:47:06 +00:00
fbt Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs. 2011-11-07 06:44:47 +00:00
lockstat Add device part of DTrace/MIPS code 2012-03-24 05:14:37 +00:00
profile Add device part of DTrace/MIPS code 2012-03-24 05:14:37 +00:00
sdt Instead of only iterating over the set of known SDT probes when sdt.ko is 2012-03-27 15:07:43 +00:00
systrace Correct the types of the arguments to return probes of the syscall 2011-11-11 03:49:42 +00:00
prototype.c