Skip to content

Per-thread diagnostics

include/thread/thread_diag.h View source View on GitHub
struct thread_wait_arm (11 fields) source
§ const char *site

which arming path

§ void *ra

caller of arm

§ void *object

first registered object (NULL for park)

§ uint64_t first_epoch

wait epoch when this descriptor was installed

§ uint64_t last_epoch

wait epoch of the most recent identical arm

§ uint64_t repeats

consecutive arms carrying this descriptor

§ time_ms_t last_ms
§ uint8_t state

enum thread_state armed into

§ uint8_t wait_type

enum thread_wait_type armed with

block/sleep reason byte

§ uint16_t block_count
struct thread_diag (6 fields) source
§ uint64_t wait_arm_count
§ uint64_t wait_arm_total
§ uint64_t apc_deliver_entries
§ uint64_t apc_deliver_max

most APCs drained by a single call

§ void *apc_last_deliver_ra
bool thread_diag_attach(struct thread *t, struct thread_diag *d)
source
void thread_diag_detach(struct thread *t)
source
struct thread_diag * thread_diag(struct thread *t)
source
void thread_diag_record_arm(
    struct thread *t,
    const char *site,
    void *ra,
    void *object,
    enum thread_state state,
    enum thread_wait_type type,
    uint8_t reason
)
source
void thread_diag_apc_deliver_enter(struct thread *t, void *ra)
source
void thread_diag_apc_deliver_batch(struct thread *t, uint64_t drained)
source
void thread_dump_wait_trace(
    struct thread *t,
    const char *role,
    size_t idx,
    uint64_t max_arms
)
source
#define THREAD_WAIT_TRACE_DEPTH UINT64_C(16)
source