RFR: 8080538 hprof does not work well with multiple agents on non-Solaris platforms
Jeremy Manson
jeremymanson at google.com
Fri May 15 23:12:31 UTC 2015
Looking for a sponsor...
The issue: hprof finds its location by looking for the first library
containing an Agent_OnLoad symbol. This may not be libhprof.so. There is
workaround logic for this on Solaris, but not on other platforms.
Note the comment in src/jdk.hprof.agent/unix/native/libhprof/hprof_md.c:296:
/* Just using &Agent_OnLoad will get the first external symbol with
* this name in the first .so, which may not be libhprof.so.
* On Solaris we can actually ask for the address of our Agent_OnLoad.
*/
addr = dlsym(RTLD_SELF, "Agent_OnLoad");
/* Just in case the above didn't work (missing linker patch?). */
if ( addr == NULL ) {
addr = (void*)&Agent_OnLoad;
}
Instead of looking for Agent_OnLoad as a symbol, I suggest we just look for
the symbol of the current method.
Patch:
http://cr.openjdk.java.net/~jmanson/8080538/webrev.00/
Bug:
https://bugs.openjdk.java.net/browse/JDK-8080538
Jeremy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/serviceability-dev/attachments/20150515/0cd974d2/attachment.html>
More information about the serviceability-dev
mailing list