I did not find any tool created for tracing pthread’s threads in linux process. I want something like strace/ltrace, is there something to view calls in real-time?
Thank you
I did not find any tool created for tracing pthread’s threads in linux process.
Share
strace works for threads as well. Use
strace -fto strace all threads.To strace only a particular thread, you first have to find its tid (thread id).
Threads have thread id’s that’s really a pid (process id)
Once you know the pid of the thread, use
strace -p the_pidto strace that thread.The pids of all the threads in a process can be found in
/proc/<pid>/task/, or the current thread id can be learned with thegettid()C call.