linux查看線程/進程/調用棧資訊-pstack/pstree__linux

來源:互聯網
上載者:User
¥ pstree -p work | grep ad
sshd(22669)---bash(22670)---ad_preprocess( 4551)-+ -{ad_preprocess}(4552)
                                                 |-{ad_preprocess}(4553)
                                                |-{ad_preprocess}(4554)
                                                |-{ad_preprocess}(4555)
                                                |-{ad_preprocess}(4556)
                                                `-{ad_preprocess}(4557)


work為工感化戶,-p為顯示過程辨認碼,ad_preprocess共啟動了6個子線程,加上主線程共7個線程

2. ps -Lf

¥ ps -Lf 4551
UID        PID  PPID   LWP  C NLWP STIME TTY      STAT   TIME CMD
work      4551 22670  4551  2    7 16:30 pts/2    Sl+    0:02 ./ad_preprocess
work      4551 22670  4552  0    7 16:30 pts/2    Sl+    0:00 ./ad_preprocess
work      4551 22670  4553  0    7 16:30 pts/2    Sl+    0:00 ./ad_preprocess
work      4551 22670  4554  0    7 16:30 pts/2    Sl+    0:00 ./ad_preprocess
work      4551 22670  4555  0    7 16:30 pts/2    Sl+    0:00 ./ad_preprocess
work      4551 22670  4556  0    7 16:30 pts/2    Sl+    0:00 ./ad_preprocess
work      4551 22670  4557  0    7 16:30 pts/2    Sl+    0:00 ./ad_preprocess

過程共啟動了7個線程

3. pstack

pstack顯示每個過程的棧跟蹤

¥ pstack 4551
Thread 7 (Thread 1084229984 (LWP 4552)):
#0  0 x000000302afc63dc in epoll_wait () /lib64/tls/libc.so.6
#1  0 x00000000006f0730 in ub::EPollEx::poll ()
#2  0 x00000000006f172a in ub::NetReactor::callback ()
#3  0 x00000000006fbbbb in ub::UBTask::CALLBACK ()
#4  0 x000000302b80610a in start_thread () /lib64/tls/libpthread.so.0
#5  0 x000000302afc6003 in clone () /lib64/tls/libc.so.6
#6  0 x0000000000000000 in 。。 ()
Thread 6 (Thread 1094719840 (LWP 4553)):
#0  0 x000000302afc63dc in epoll_wait () /lib64/tls/libc.so.6
#1  0 x00000000006f0730 in ub::EPollEx::poll ()
#2  0 x00000000006f172a in ub::NetReactor::callback ()
#3  0 x00000000006fbbbb in ub::UBTask::CALLBACK ()
#4  0 x000000302b80610a in start_thread () /lib64/tls/libpthread.so.0
#5  0 x000000302afc6003 in clone () /lib64/tls/libc.so.6
#6  0 x0000000000000000 in 。。 ()
Thread 5 (Thread 1105209696 (LWP 4554)):
#0  0 x000000302b80baa5 in __nanosleep_nocancel ()
#1  0 x000000000079e758 in comcm::ms_sleep ()
#2  0 x00000000006c8581 in ub::UbClientManager::healthyCheck ()
#3  0 x00000000006c8471 in ub::UbClientManager::start_healthy_check ()
#4  0 x000000302b80610a in start_thread () /lib64/tls/libpthread.so.0
#5  0 x000000302afc6003 in clone () /lib64/tls/libc.so.6
#6  0 x0000000000000000 in 。。 ()
Thread 4 (Thread 1115699552 (LWP 4555)):
#0  0 x000000302b80baa5 in __nanosleep_nocancel ()
#1  0 x0000000000482b0e in armor::armor_check_thread ()
#2  0 x000000302b80610a in start_thread () /lib64/tls/libpthread.so.0
#3  0 x000000302afc6003 in clone () /lib64/tls/libc.so.6
#4  0 x0000000000000000 in 。。 ()
Thread 3 (Thread 1126189408 (LWP 4556)):
#0  0 x000000302af8f1a5 in __nanosleep_nocancel () /lib64/tls/libc.so.6
#1  0 x000000302af8f010 in sleep () /lib64/tls/libc.so.6
#2  0 x000000000044c972 in Business_config_manager::run ()
#3  0 x0000000000457b83 in Thread::run_thread ()
#4  0 x000000302b80610a in start_thread () /lib64/tls/libpthread.so.0
#5  0 x000000302afc6003 in clone () /lib64/tls/libc.so.6
#6  0 x0000000000000000 in 。。 ()
Thread 2 (Thread 1136679264 (LWP 4557)):
#0  0 x000000302af8f1a5 in __nanosleep_nocancel () /lib64/tls/libc.so.6
#1  0 x000000302af8f010 in sleep () /lib64/tls/libc.so.6
#2  0 x00000000004524bb in Process_thread::sleep_period ()
#3  0 x0000000000452641 in Process_thread::run ()
#4  0 x0000000000457b83 in Thread::run_thread ()
#5  0 x000000302b80610a in start_thread () /lib64/tls/libpthread.so.0
#6  0 x000000302afc6003 in clone () /lib64/tls/libc.so.6
#7  0 x0000000000000000 in 。。 ()
Thread 1 (Thread 182894129792 (LWP 4551)):
#0  0 x000000302af8f1a5 in __nanosleep_nocancel () /lib64/tls/libc.so.6
#1  0 x000000302af8f010 in sleep () /lib64/tls/libc.so.6
#2  0 x0000000000420d79 in Ad_preprocess::run ()
#3  0 x0000000000450ad0 in main ()巴爾紮克

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.