HomeFreeBSD

hwpmc: Implement per-thread counters for PMC sampling

Description

hwpmc: Implement per-thread counters for PMC sampling

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: sbruno
Obtained from: jtl
Sponsored by: Juniper Networks, Limelight Networks
Differential Revision: https://reviews.freebsd.org/D15335

Details

Provenance
mmacyAuthored on
Differential Revision
D15335: Implement per-thread counters for PMC sampling --- redux
Parents
rS333689: Fix !netmap build post r333686
Branches
Unknown
Tags
Unknown