Process name instrumentation infrastructure
This is special feature that changes the process name of the running puppet
entity to display its current activity.
It is disabled by default, and can be enabled by sending the QUIT signal
to the process in question (or calling enable through the code).
This system can work only if some "probes" are integrated in the core puppet
codebase. Since tools to visualize process names have a large refresh time
(ie more than 1s) it only makes sense to track long activities (like compilation,
transaction or file serving).
Those probes are the subject of a subsequent patch.
This system tracks every thread activity and form a strings which will
be used as the process name. Due to the way it is implemented it is
possible that it doesn't work on all platforms (I tested successfully
on osx and linux). On some systems the space available is dependent on
the original size of the full command. That's why if this string is longer
than a 50 characters, the string is scrolled (like stock market tickers).
Note: This is not intended to be a generic instrumentation system. Also, being
block based means that it can reduce performance if the instrumentation
probes are used in tight inner loops.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>