Mehdi Tondravi
2008-May-17 03:03 UTC
[dtrace-discuss] JAVA Hex address to symbol translation
Is there a way to get the symbolic name for stack back trace (e.g. jstack(30, 2500))? I get hex addresses and have tried out various things but still do not get symbolic name. Thanks, Mehdi Tondravi -- This message posted from opensolaris.org
michael schuster
2008-May-17 04:59 UTC
[dtrace-discuss] JAVA Hex address to symbol translation
Mehdi Tondravi wrote:> Is there a way to get the symbolic name for stack back trace (e.g. jstack(30, 2500))? > I get hex addresses and have tried out various things but still do not get symbolic name.I''ve never played with Java & DTrace, but if the regular pid provider is anything to go by, this happens because the stack is recorded at the time the probe fires, but the matching of addresses to symbols happens somewhat later. If the application being traced has meanwhile disappeared, there''s nothing to match to, and you get hex output. Could that explain what you''re seeing? HTH Michael -- Michael Schuster http://blogs.sun.com/recursion Recursion, n.: see ''Recursion''
Mehdi Tondravi
2008-May-17 15:10 UTC
[dtrace-discuss] JAVA Hex address to symbol translation
I see the c/c++ calls symbols do appear on the stack back trace however for Java methods I see the hex addresses (e.g. 0xffffffff70e2322c 0xffffffff70c3cd98) - if I do pstack on the thread for this code (many times ) I may get the symbolic name (mangeled c++ name) for the Java method. The Java version used is 1.5 and application does not go away - it is there all the time. Is there a way to force address translation right away? -- This message posted from opensolaris.org
Adam Leventhal
2008-May-19 17:31 UTC
[dtrace-discuss] JAVA Hex address to symbol translation
> I see the c/c++ calls symbols do appear on the stack back trace however for > Java methods I see the hex addresses (e.g. 0xffffffff70e2322c > 0xffffffff70c3cd98) - if I do pstack on the thread for this code (many times ) > I may get the symbolic name (mangeled c++ name) for the Java method.On newer JVMs (1.4.2 and later I believe), the jstack action will perform the translation to symbolic Java method names. In some situations, you may need to change the default number of stack frames and bytes of symbolic Java data: jstack(frames, bytes) The symbolic translation is performed by a DTrace helper built into the JVM. There are some situations in which that helper is known to be deficient. On x86 platforms if the JVM is invoked with the -server option, you will not see the full stack trace. Further, if there are inlined functions, the helper may not pick those up whereas pstack(1) can. These are bugs that the Java team is aware of.> I''ve never played with Java & DTrace, but if the regular pid provider is > anything to go by, this happens because the stack is recorded at the time > the probe fires, but the matching of addresses to symbols happens somewhat > later. If the application being traced has meanwhile disappeared, there''s > nothing to match to, and you get hex output.Java symbol name resolution does not work in the same way as ustack() for normal ELF symbols (i.e. C and C++). Adam -- Adam Leventhal, Fishworks http://blogs.sun.com/ahl