Results 1 to 4 of 4
I am looking to dump or log the stack trace for a suspended thread within a C++ program. The threads are being created using ACE. I know pstack() exists but ...
- 08-01-2006 #1Just Joined!
- Join Date
- Aug 2006
- Location
- Boston, MA
- Posts
- 2
Linux Stack Trace for a Thread in a Process
I am looking to dump or log the stack trace for a suspended thread within a C++ program. The threads are being created using ACE. I know pstack() exists but it will only dump for an entire process (Solaris 10 pstack() does allow you to select the thread of your choice within the process). So I rather not sift through a log file for the thread of interest. There is also backtrace() but from my understanding, it has to be called from the process of interest. You can apply a thread to it, but if the thread is suspended then I do not think it is possible to apply it to backtrace(). Any ideas or atleast starting points would be great. Again these calls need to be possible through C++.
pstack usage:
pstack <pid> > my_process_log.txt
will log the stack trace for the process <pid> to the file of my choice.
Solaris 10 and I think OpenSolaris allows: pstack <pid>/<tid> and will report for just the thread of interest but since I'm running RedHat I can not use it.
- 08-03-2006 #2Just Joined!
- Join Date
- Aug 2006
- Location
- Boston, MA
- Posts
- 2
Bump....
Does anyone have any suggestions
?
Thanks
- 03-29-2010 #3Just Joined!
- Join Date
- Mar 2010
- Posts
- 1
Did you get any answer to this
Hi,
dis you get any solution to your post?
i am also looking at retrieving call stack of the executing threads on linux. i am trying to use pstack. any other solution should also work for me.
any idea about this?
Thanks,
Sandeep
- 03-29-2010 #4forum.guy
- Join Date
- May 2004
- Location
- arch linux
- Posts
- 17,782
oz
→ new users: read this first
→ no private messages requesting computer support - post them on the forums!




