RFR: 8333994: NMT: call stacks should show source information

Gerard Ziemski gziemski at openjdk.org
Mon Jun 17 02:22:16 UTC 2024


On Tue, 11 Jun 2024 12:38:09 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

> Patch adds printing of source file and line number to NMT call stacks that are printed in detail mode. Useful for hunting down leaks.

The implementation of `NativeCallStack::print_on()` is basically:

>       if (os::dll_address_to_function_name() {
>               Decoder::get_source_info() // calls into os::dll_address_to_library_name()
>       } 
>       if (not printed the info yet) {
>               os::dll_address_to_library_name()
>       } 

where `os::dll_address_to_function_name()` and `os::dll_address_to_library_name()` each call `dladdr()`, so we end up with 2 calls to `dladdr()` in each case.

If that's what takes up most of the time, then perhaps we can find a way to optimize this code by sharing the context returned by `dladdr()` and we can then add the fancy feature, such as `line` info?

-------------

PR Comment: https://git.openjdk.org/jdk/pull/19655#issuecomment-2172050666


More information about the hotspot-dev mailing list