11.5.3 lwpsinfo_t

Several proc probes have arguments of type lwpsinfo_t. The definition of the lwpsinfo_t structure as available to DTrace consumers is as follows:

typedef struct lwpsinfo {
  int pr_flag;                /* flags */
  id_t pr_lwpid;              /* thread id */
  uintptr_t pr_addr;          /* internal address of thread */
  uintptr_t pr_wchan;         /* not supported */
  char pr_stype;              /* not supported */
  char pr_state;              /* numeric thread state */
  char pr_sname;              /* printable character for pr_state */
  int pr_pri;                 /* priority, high value = high priority */
  char pr_name[PRCLSZ];       /* scheduling class name */
  processorid_t pr_onpro;     /* processor which last ran this thread */
} lwpsinfo_t;
Note

Lightweight processes do not exist on Oracle Linux. In Oracle Linux, processes and threads are both represented by process descriptors of type struct task_struct in the task list. DTrace translates the members of lwpsinfo_t from the task_struct for the Oracle Linux process.

pr_flag is set to 1 if the thread is stopped. Otherwise, it is set to 0.

Table 11.5, “pr_state Values” lists the values that pr_state can take, together with the corresponding character values for pr_sname.

Table 11.5 pr_state Values

pr_state Value

pr_sname Value

Description

SRUN (2)

R

The thread is runnable or is currently running on a CPU. The sched:::enqueue probe fires immediately before a thread's state is transitioned to SRUN. The sched:::on-cpu probe will fire a short time after the thread starts to run.

The equivalent Oracle Linux task state is TASK_RUNNING.

SSLEEP (1)

S

The thread is sleeping. The sched:::sleep probe will fire immediately before a thread's state is transitioned to SSLEEP.

The equivalent Oracle Linux task state is TASK_INTERRUPTABLE or TASK_UNINTERRUPTABLE.

SSTOP (4)

T

The thread is stopped, either due to an explicit proc directive or some other stopping mechanism.

The equivalent Oracle Linux task state is __TASK_STOPPED or __TASK_TRACED.

SWAIT (7)

W

The thread is waiting on wait queue. The sched:::cpucaps-sleep probe will fire immediately before the thread's state transitions to SWAIT.

The equivalent Oracle Linux task state is TASK_WAKEKILL or TASK_WAKING.

SZOMB (3)

Z

The thread is a zombie.

The equivalent Oracle Linux task state is EXIT_ZOMBIE, EXIT_DEAD, or TASK_DEAD.