Linux View thread Information __linux

Source: Internet
Author: User

You can use the ps-elf command to view thread information in a Linux operating system:

The following data is the thread that is included in the DB2SYSC process of the DB2 database:

192.168.100.228 [SDE ~]$ ps-elf |grep db2sysc|grep-v grep

UID        PID  PPID   LWP  C nlwp stime TTY          time
 CMD
Db2inst1  4865  4863  4865  0  ?        00:00:00 DB2SYSC 0
Db2inst1  4865  4863  4869  0  ?        00:00:45 DB2SYSC 0
Db2inst1  4865  4863  4870  0  ?        00:00:00 DB2SYSC 0
Db2inst1  4865  4863  4871  0  ?        00:00:00 DB2SYSC 0
Db2inst1  4865  4863  4872  0  ?        00:00:00 DB2SYSC 0
Db2inst1  4865  4863  4873  0  ?        00:00:03 DB2SYSC 0
Db2inst1  4865  4863  4874  0  ?        00:00:00 DB2SYSC 0
Db2inst1  4865  4863  4875  0  ?        00:00:00 DB2SYSC 0
Db2inst1  4865  4863  4876  0  ?        00:00:00 DB2SYSC 0
Db2inst1  4865  4863  4877  0  ?        00:00:00 DB2SYSC 0
Db2inst1  4865  4863  4878  0  ?        00:00:00 DB2SYSC 0
Db2inst1  4865  4863  5156  0  ?        00:00:00 DB2SYSC 0
Db2inst1  4865  4863  5662  0  ?        00:00:09 DB2SYSC 0
Db2inst1  4865  4863  5663  0  ?        00:00:15 DB2SYSC 0
Db2inst1  4865  4863  6125  0  ?        00:00:00 DB2SYSC 0
Db2inst1  4865  4863  6126  0  ?        00:00:01 DB2SYSC 0
Db2inst1  4865  4863  6127  0  ?        00:00:00 DB2SYSC 0
Db2inst1  4865  4863  6128  0  ?        00:00:00 DB2SYSC 0
Db2inst1  4865  4863  6129  0  ?        00:00:00 DB2SYSC 0
Db2inst1  4865  4863  6130  0  ?        00:00:00 DB2SYSC 0
Db2inst1  4865  4863  6131  0  ?        00:00:00 DB2SYSC 0
Db2inst1  4865  4863  6132  0  ?        00:00:00 DB2SYSC 0
Db2inst1  4865  4863  6133  0  ?        00:00:00 DB2SYSC 0
Db2inst1  4865  4863  6134  0  ?        00:00:00 DB2SYSC 0
Db2inst1  4865  4863  6135  0  ?        00:00:00 DB2SYSC 0
Db2inst1  4865  4863  6136  0  ?        00:00:00 DB2SYSC 0
Db2inst1  4865  4863  6137  0  ?        00:00:00 DB2SYSC 0
Db2inst1  4865  4863  6191  0  ?        00:00:06 DB2SYSC 0
Db2inst1  4865  4863  6205  0  ?        00:00:10 DB2SYSC 0
Db2inst1  4865  4863  6337  0  ?        00:00:00 DB2SYSC 0
Db2inst1  4865  4863  7131  0  ?        00:00:00 DB2SYSC 0
Db2inst1  4865  4863  7578  0  ?        00:00:13 DB2SYSC 0
Db2inst1  4865  4863  7596  0  ?        00:00:07 DB2SYSC 0
Db2inst1  4865  4863  7622  0  ?        00:00:01 DB2SYSC 0
Db2inst1  4865  4863  7908  0  ?        00:00:00 DB2SYSC 0
Db2inst1  4865  4863 10637  0  ?        00:00:02 DB2SYSC 0
Db2inst1  4865  4863 25427  0   Jan04?        00:00:04 DB2SYSC 0
Db2inst1  4865  4863 27917  0   Jan04?        00:00:00 DB2SYSC 0
Db2inst1  4865  4863 30815  0   Jan04?        00:00:00 DB2SYSC 0
Db2inst1  4865  4863 30816  0   Jan04?        00:00:00 DB2SYSC 0

which

The UID is the user ID.

PID is the process ID.

Ppid is the parent process ID, which is the 2,

LWP for light weight process or thread, lightweight processes, that is, thread identifiers

NLWP for, number of lwps (threads) in the process, quantity of threads

The DB2SYSC process now contains a total of 40 threads, and their thread numbers are:

192.168.100.228 [SDE ~]$ ps-elf |grep db2sysc|grep-v ' {print $} '
4865
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
5156
5662
5663
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6191
6205
6337
7131
7578
7596
7622
7908
10637
25427
27917
30815
30816

You can view more detailed thread information by using the commands of the database:

192.168.100.228 [SDE ~]$ Db2pd-edus|awk ' {print $3,$4} '
0--
All
 Edus
4865
4863
4880
TID Kernel
30816 DB2AGNTDP
30815 DB2AGNTDP
27917 DB2AGNTDP
25427 DB2AGNTDP
10637 DB2AGNTDP
7908 db2agent
7622 db2agent
7596 db2agent
7578 db2agent
7131 db2agent
6337 Db2agent
6205 db2agent
6191 DB2AGNTDP
6137 DB2EVMGI
6136 DB2FW1
6135 db2fw0
6134 db2lused
6133 DB2WLMD
6132 DB2PFCHR
6131 DB2PFCHR
6130 DB2PFCHR
6129 DB2PCLNR
6128 Db2dlock
6127 Db2lfr
6126 DB2LOGGW
6125 Db2loggr
5663 DB2STMM
5662 db2agent
5156 DB2TASKD
4878 DB2SPMLW
4877 Db2spmrsy
4876 Db2resync
4875 DB2TCPCM
4874 DB2TCPCM
4873 DB2IPCCM
4872 DB2LICC
4871 DB2THCLN
4870 Db2alarm
4869 DB2SYSC

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.