반응형
OS명령어로써 프로세스 혹은 쓰레드에 대한 스택 추적을 출력합니다.
DB Hang이 걸린 문제 등이 발생했을 시 프로세스/쓰레드 별로 확인할때 사용합니다.
사용법
pstack <process-id> |
예시
$ ps -ef |grep tbsvr
tibero 11713 1 0 Feb08 pts/1 00:00:25 tbsvr -t NORMAL -SVR_SID tibero
tibero 11716 11713 0 Feb08 pts/1 00:00:00 tbsvr_TBMP -t NORMAL -SVR_SID tibero
tibero 11717 11713 0 Feb08 pts/1 00:00:00 tbsvr_WP000 -t NORMAL -SVR_SID tibero
tibero 11718 11713 0 Feb08 pts/1 00:02:24 tbsvr_WP001 -t NORMAL -SVR_SID tibero
tibero 11719 11713 0 Feb08 pts/1 00:00:00 tbsvr_PEP000 -t NORMAL -SVR_SID tibero
tibero 11720 11713 0 Feb08 pts/1 00:00:00 tbsvr_PEP001 -t NORMAL -SVR_SID tibero
tibero 11721 11713 0 Feb08 pts/1 00:00:00 tbsvr_PEP002 -t NORMAL -SVR_SID tibero
tibero 11722 11713 0 Feb08 pts/1 00:00:00 tbsvr_PEP003 -t NORMAL -SVR_SID tibero
tibero 11723 11713 0 Feb08 pts/1 00:01:18 tbsvr_AGNT -t NORMAL -SVR_SID tibero
tibero 11724 11713 0 Feb08 pts/1 00:01:29 tbsvr_DBWR -t NORMAL -SVR_SID tibero
tibero 11725 11713 0 Feb08 pts/1 00:00:02 tbsvr_RECO -t NORMAL -SVR_SID tibero
tibero 26663 14251 0 18:41 pts/1 00:00:00 grep --color=auto tbsvr
$ pstack 11721 > 11721.log
$vi 11721.log
...생략
Thread 2 (Thread 0x7ff6f0d98700 (LWP 11818)):
#0 0x00007ff7b67347fa in semtimedop () from /lib64/libc.so.6
#1 0x0000000000dd66a8 in tb_sem_wait_internal (my_tid=<optimized out>, usec=<optimized out>, wait_mode=<optimized out>) at /home/autodist/build_20210108_152316/tibero6/src/tbsvr/frame/sem.c:667
#2 tb_sem_wait (my_tid=<optimized out>, timeout=<optimized out>, wait_mode=<optimized out>) at /home/autodist/build_20210108_152316/tibero6/src/tbsvr/frame/sem.c:954
#3 0x0000000000dd096c in bitq_read_internal (bitmask=..., timeout=<optimized out>, event_type=WE_CONN_IDLE, id1=-1, id2=-1) at /home/autodist/build_20210108_152316/tibero6/src/tbsvr/frame/bitqueue.c:537
#4 0x00000000005a69ac in svr_wthr_main_internal (my_tid=103) at /home/autodist/build_20210108_152316/tibero6/src/tbsvr/body/tbsvr_wthr.c:735
#5 0x0000000000df0120 in wthr_init (args=<optimized out>) at /home/autodist/build_20210108_152316/tibero6/src/tbsvr/frame/tbsvr_cthr.c:3265
#6 0x00007ff7b8914dd5 in start_thread () from /lib64/libpthread.so.0
#7 0x00007ff7b6732f6d in clone () from /lib64/libc.so.6
Thread 1 (Thread 0x7ff7bacc37c0 (LWP 11721)):
#0 0x00007ff7b6733543 in epoll_wait () from /lib64/libc.so.6
#1 0x00000000020597ca in _epoll_wait (base=<optimized out>, arg=0x7ff6f6234f18, tv=<optimized out>) at /home/autodist/build_20210108_152316/tibero6/src/common/mio/epoll.c:173
#2 0x00000000020581b8 in tevt_wait (tv=0x7ffd0c7e7310, flags=<optimized out>) at /home/autodist/build_20210108_152316/tibero6/src/common/mio/tevent.c:232
#3 0x0000000000df2394 in cthr_main () at /home/autodist/build_20210108_152316/tibero6/src/tbsvr/frame/tbsvr_cthr.c:4142
#4 0x0000000000e341b1 in svr_child_thr_main (proc_idx=6) at /home/autodist/build_20210108_152316/tibero6/src/tbsvr/frame/tbsvr_child_thr_main.c:259
#5 0x0000000000e28bcb in tb_fork_proc (proc_idx=6) at /home/autodist/build_20210108_152316/tibero6/src/tbsvr/frame/tbsvr_main.c:1924
#6 0x0000000000e2dd43 in main (argc=<optimized out>, argv=<optimized out>) at /home/autodist/build_20210108_152316/tibero6/src/tbsvr/frame/tbsvr_main.c:924
반응형
'Linux&Unix' 카테고리의 다른 글
AIX x-11 forwarding 설정하기(gui 창 띄우기) (0) | 2024.07.18 |
---|
댓글