Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Write an article for LinuxForums Today! Win Great Prizes!
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.
Open Source Security Myths Dispelled Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization subscribe
InformationWeek InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology. subscribe