Find the answer to your Linux question:
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 ...
  1. #1
    Just Joined!
    Join Date
    Aug 2006
    Location
    Boston, MA
    Posts
    2

    Post 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.

  2. #2
    Just Joined!
    Join Date
    Aug 2006
    Location
    Boston, MA
    Posts
    2
    Bump....

    Does anyone have any suggestions ?

    Thanks

  3. #3
    qtp
    qtp is offline
    Just 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

  4. #4
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    17,782
    Quote Originally Posted by qtp View Post
    dis you get any solution to your post?
    Welcome to the forums, qtp!

    Please start a new thread of your own because this one is almost 4 years old.

    Thank you.
    oz

    new users: read this first
    no private messages requesting computer support - post them on the forums!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •