thread subcommand

The thread subcommand (alias th) displays data from the kernel thread table.

Format

thread

thread ?

thread *

thread -

thread @wpar_id

thread address

thread -c wlm_class

thread -j

thread -lk

thread -hrq hrq_address

thread -n substring

thread -nw

thread -pr projid

thread p proc_slot

thread -r

thread -rq run_queque_addr

thread -s thread_state

thread slot

thread symbol

thread tpid [pid]

thread ttid [pid]

thread -w wait_type

Parameters

The following list of parameter provides the summary output for all or a selected subset of threads.
Item Description
? Prints usage.
* Prints thread table.
@ wpar_id Sorts threads by corral ID.
-c wlm_class Sorts threads by Workload Manager (WLM) class.
-hrq home run queue addr Select threads by home run queue.
-j Print thread table with jitter control information.
-lk Print threads holding locks.
-n substring Sorts threads by name.
-nw Prints thread table after skipping the waitproc option.
-pr projid Sorts threads by the projid parameter.
-p proc_slot Sorts threads by the proc_slot parameter.
-r Prints a running thread.
-rq run_queue_addr Select threads that belong to the specified scheduling run queue.
-s thd_state Sorts threads in the specified state. The valid thread state values follow:
  • NONE
  • IDL
  • RUN
  • SLEEP
  • SWAP
  • STOP
  • ZOMB
tpid [pid] Selects threads by process ID.
ttid [tid] Selects thread by thread ID.
-w wait_types Sorts threads that are waiting on a type of events. The valid wait types follow:
  • NOWAIT
  • WEVENT
  • WLOCK
  • WTIMER
  • WCPU
  • WPGIN
  • WPGOUT
  • WPLOCK
  • WFREEF
  • WMEM
  • WLOCKREAD
  • WUEXCEPT
  • WZOMB,
  • WLOCK_WX
  • VMMWAIT, WSLOCK
Note: These wait types mirror the definitions for the tv_wtype in the <sys/thread.h> file.
The following table provides detailed output for all or selected subset of threads.
Item Description
th Prints the current thread.
- Prints all threads that are in the none or zombie state in the long format.
address Prints threads at an address parameter where an address parameter is the effective address of the corresponding thread or pvtthread slot.
slot Prints threads in the slot parameter where slot is the value from the SLOT column of the summary output.
symbol Prints threads that match the symbol parameter.

Examples

The thread subcommand displays the following output formats:
Thread table summary
This format displays a list of processes with limited information for each process. The following example shows the process table summary:



Example of summary format output:
---------------------------------

KDB(0)> th *
                SLOT NAME     STATE    TID PRI   RQ CPUID  CL  WCHAN

pvthread+000000    0 swapper  SLEEP 000003 010    0         0  
pvthread+000100    1 init     SLEEP 010003 03C    4         0  
pvthread+080000 2048!wait     RUN   000105 0FF    0 *0000   0  
pvthread+080100 2049 sched    SLEEP 010107 011    0         0  
pvthread+080200 2050 lrud     SLEEP 020109 010    0         0  vmpfh+03F080 
pvthread+080300 2051 vmptacrt SLEEP 03010B 028    0         0  
pvthread+080400 2052 psmd     SLEEP 04010D 010    0         0  vmpfh+03F088 
pvthread+080500 2053 vmmd     SLEEP 05010F 010    0         0  
pvthread+080600 2054 pvlist   SLEEP 060111 010    0         0  
pvthread+080700 2055 reaffin  SLEEP 070113 010    0         0  
pvthread+080800 2056 memgrdd  SLEEP 080115 010    4         0  
pvthread+080900 2057 kpkcs11  SLEEP 090149 03C    4         0  F1000B00003FF168 
pvthread+080A00 2058 kpkcs11  SLEEP 0A011B 03C    4         0  F1000B00003FF168 
...   ...   ...
The slot column lists the thread structure slot index for the thread. The numbers in this column must be used as the slot argument for detailed display options. The PRI column lists the current scheduling priority for the thread. The RQ column lists current scheduler run queue for the thread. CPUID when present, is the CPU index to which the thread is bound. CL is the Workload Manager (WLM) class (relevant when WLM is active). WCHAN is the wait channel for threads that are in the SLEEP state.
Detailed output for a given thread
This format displays all or selected fields of the process structure for a given process. The following example shows the detailed output for the given thread:



Example of detailed output:
---------------------------------

KDB(0)>th
                SLOT NAME     STATE    TID PRI   RQ CPUID  CL  WCHAN

pvthread+08A700 2215*kdb_64   SLEEP A70103 03C    0         0  F1000F0000042478 

NAME................ kdb_64
WTYPE............... WEVENT   
.................tid :0000000000A70103  ......tsleep :FFFFFFFFFFFFFFFF
............tv_flags :00000000  ...........tv_flags2 :00000000
...........pmcontext :00000000
DATA.........pvprocp :F100100A00111400 <pvproc+111400>
LINKS.....prevthread :F100100A1008A700 <pvthread+08A700>
..........nextthread :F100100A1008A700 <pvthread+08A700>
DISPATCH.......synch :FFFFFFFFFFFFFFFF
SCHEDULER...affinity :00000000  .................pri :0000003C
.............boosted :00000000  ...............wchan :F1000F0000042478
...............state :00000003  ...............wtype :00000001
......boost_cnt_lock :0000      .....boost_cnt_other :0000
MISC       ..tv_eyec :7076746850524F43 (pvthPROC)
...   ...   ...
Note: For all kdb subcommands, only a few output might be useful for AIX® users, because most of the output columns requires knowledge about of the corresponding subsystem's internals (in this case, process management).