how to print the call stack of a thread

how to print the call stack of a thread

Post by mxi.. » Wed, 31 May 2000 04:00:00



I would like to print out the call stack of a thread, something that
looks like the output of pstack.

From within the thread itself, I suppose I can fork1() to duplicate the
thread and fork another process to run pstack on the duplicated thread.

I would much rather use some api to print out the stack directly. Any
pointer would be appreciated.

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

how to print the call stack of a thread

Post by Andrew Gabri » Thu, 01 Jun 2000 04:00:00




Quote:> I would like to print out the call stack of a thread, something that
> looks like the output of pstack.

I posted code to do this probably around middle of last year.
Unfortunately, deja.com seems to have lost everything before about
September last year unless someone else can work out how to get
anything out of it  :-(

--
Andrew

 
 
 

how to print the call stack of a thread

Post by mxi.. » Wed, 21 Jun 2000 04:00:00






> > I would like to print out the call stack of a thread, something that
> > looks like the output of pstack.

> I posted code to do this probably around middle of last year.
> Unfortunately, deja.com seems to have lost everything before about
> September last year unless someone else can work out how to get
> anything out of it  :-(

> --
> Andrew

I searched deja.com for all your posts with key word "stack" and found
the code you posted. Now my question becomes how to get the frame
pointer of another thread in the same process.

Meng

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

1. demystifying process stack vs. java thread stack on solaris

I am having a very difficult time finding information related to
process stack size, java thread stack size and how these are combined
to affect process memory limits on Solaris.  Basically I would like to
put some science to tuning the jvm on solaris for a large number of
concurrent threads.  Currently I am running into Java out of memory
errors when the heap has plenty of room to grow.  I suspect that the
issue is related to total process memory and how the thread stack
sizes are combined with the maximum heap allocation.  The two knobs I
know of to affect process stack and thread stacks are 'ulimit -s' for
process stack and '-Xss' for java thread stacks.

How do these settings affect each other?

Solaris:
        Solaris 9 12/02 s9s_u2wos_10a SPARC

Java:
        Java HotSpot(TM) Client VM (build 1.4.1_02-b06, mixed mode)

Java Command Line Switches:
        -server -Xms256m -Xmx3072m

ulimit output:
        $ ulimit -a
        time(seconds)        unlimited
        file(blocks)         unlimited
        data(kbytes)         unlimited
        stack(kbytes)        32784
        coredump(blocks)     unlimited
        nofiles(descriptors) 40000
        vmemory(kbytes)      unlimited

2. Problem setting a PPP server

3. Code to print call stack when signal received ?

4. XFree vs. commercial

5. Printing the call stack inside a function?

6. portmap problem

7. Print Call Stack Signal Handler

8. memory > 64 Mo when boot with a floppy

9. remote printing - print filters never being called?

10. Stack trace - Multi threaded

11. linuxthreads, userland threads and alternate signal stack

12. how to get thread stack size

13. Stack trace with threads