As a followup to r290930 (D4122), this implements per-thread counters for
PMC sampling. The thread descriptors are stored in a list attached to the
process descriptor. These thread descriptors can store any per-thread
information necessary for current or future features. For the moment, they
just store the counters for sampling.
The thread descriptors are created when the process descriptor is created.
Additionally, thread descriptors are created or freed when threads
are started or stopped. Because the thread exit function is called in a
critical section, we can't directly free the thread descriptors. Hence,
they are freed to a cache, which is also used as a source of allocations
when needed for new threads.
Approved by: gnn (mentor) [Assuming...]
MFC after: 1 month
Sponsored by: Juniper Networks