Merge branch 'markj-kernel-config' into 20130624-sdt-module-info
The aim of this branch is to properly handle module load and unload
events with respect to DTrace probes (FBT and SDT in particular). The
basic requirements are that

1. All FBT and SDT probes defined in a module should be created at
   module load time.
2. Any attempt to unload a module while one of its probes is enabled
   should result in an error.
3. All of a module's probes must become inaccessible after a successful
   unload. That is, attempts to enable such a probe should return an
   error to the user rather than resulting in something unexpected or a
   panic (which I would say is expected behaviour at the moment).

To that end, I'm going to add support for module load/unload callbacks
in DTrace. Then providers can implement the corresponding methods
properly, in such a way that the above requirements are met. Requirement
2 shall be implemented by use of a reference count in the struct
linker_file.

This change adds the beginnings of this work: it changes the SDT
provider/probe definition macros to append to a linker set rather than
registering a SYSINIT function. This way the sdt kernel module can just
loop over the set's contents when the module is loaded and create the
corresponding probes. This change also adds the load/unload callbacks.
It's KDTRACE_HOOKS, not DTRACE_HOOKS.
Start filling out the SDT methods. I think we're going to be able to
drop all the code in kern_sdt.c.

Currently we panic when loading a kernel module containing SDT probes
after sdt.ko has been loaded. Working on that. :)
More progress.
Start working on get argtype description working. Each of the SDT
providers needs to register an argdesc method, so I don't see any way to
avoid the problem I worked around earlier by having dtrace_register()
exit early if the provider ops are all null.

Thus revert that hack and add a new hook into SDT which gets called by
the kernel linker on module load before the generic DTrace hook.
Add a provider ops table for SDT providers.
Start trying to figure out how and when to destroy SDT providers.
Add a module unload hook for SDT; we want to be able to deregister a
provider when all of its probes have gone away as the result of a module
unload. However, we can't do that in the probe destroy method since we
already hold the provider lock.
Make sure that we don't create probes with whitespace in their names.
Merge branch 'markj-kernel-config' into 20130624-sdt-module-info
Add a new malloc type for SDT and get rid of an unsed macro.
Try using dtrace_condense to clean up probes before unloading a module.
* Comment out references to mod_lock. It doesn't make sense to use it on
  FreeBSD, since it has nothing to do with the kernel linker lock.
* Get rid of the SDT lock for now. I don't think it's needed since all
  manipulation of the global SDT provider list is done with the linker
  lock held.

With these (and some other) changes, SDT probe/provider creation and
destruction seems to be working properly.
Merge branch 'markj-kernel-config' into 20130624-sdt-module-info
The dtmalloc provider uses the short description of a malloc type as the
function name of its corresponding DTrace probes. These descriptions may
contain whitespace, but probe names cannot, so just replace any whitespace
with underscores when creating probes.

MFC after:	1 week
Use proper identifers rather than hard-coded limits.
Handle the possibility that the module filename has a '.ko' extension.
 - Add a general purpose resource allocator, vmem, from NetBSD.  It was
   originally inspired by the Solaris vmem detailed in the proceedings
   of usenix 2001.  The NetBSD version was heavily refactored for bugs
   and simplicity.
 - Use this resource allocator to allocate the buffer and transient maps.
   Buffer cache defrags are reduced by 25% when used by filesystems with
   mixed block sizes.  Ultimately this may permit dynamic buffer cache
   sizing on low KVA machines.

Discussed with:	alc, kib, attilio
Tested by:	pho
Sponsored by:	EMC / Isilon Storage Division
Create FBT probes for already-loaded modules and the kernel.