dtrace: fix leaking psinfo objects
The psinfo objects created from a kmem cache (slab) to hold information
about a task's environment and arguments can leak when a task executes
two consecutive execve() calls. The implementation also made it possible
for tasks to have no psinfo (NULL) after a fork() unless an execve() was
done shortly after. This commit resolved both problems by adding a refc
to the psinfo objects (so one can be shared across task parentage
relations due to fork()), and by ensuring that upon execve() any existing
psinfo gets its refc decremented and a new psinfo object gets installed
to reflect the new execution environment.
This commit also adds the necessary initialization of a psinfo object for
tasks that do not have a mm object associated with them.
Orabug:
18383027
Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
Reviewed-by: Chuck Anderson <chuck.anderson@oracle.com>