Last active
February 27, 2018 09:31
-
-
Save justdoit0823/2a09aea129edf2ae8d085fa05c5b643f to your computer and use it in GitHub Desktop.
How to debug multithread program under linux system?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get processes with related threads | |
ps -eLf |grep "process name" | |
# list all opened file descriptors in a process PID and under which thread | |
lsof -aKp PID | |
# trace syscalls in a process's main thread or other thread PID | |
strace -p PID | |
# report statistics for different tasks within process | |
pidstat -tdru -p PID 1 | |
# debug a process associated with PID | |
gdb exec_cmd PID | |
# list threads within process PID | |
info threads | |
# jump to thread with ID | |
thread ID | |
# print a stack trace of a running process | |
gstack PID |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment