RFR: 8346082: Output JVMTI agent information in hserr files [v4]

Thomas Stuefe stuefe at openjdk.org
Fri Dec 13 15:40:37 UTC 2024


On Fri, 13 Dec 2024 12:18:13 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

>> We should output more information about the JVMTI agents in the hserr file.
>
> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
> 
>   simplify coding

Looks fine, two bikeshedding nits.

I approve now, up to you if you take my suggestions.

src/hotspot/share/runtime/os.cpp line 1133:

> 1131:     const JvmtiAgent* agent = it.next();
> 1132:     if (agent != nullptr) {
> 1133:       if (first_agent) st->print_cr("JVMTI agents:");

if no agents are loaded, I would print "JVMTI agents: none" unconditionally. Makes it more obvious than just a missing entry; that could be also an error.

src/hotspot/share/runtime/os.cpp line 1138:

> 1136:       const char* instrumentinfo = agent->is_instrument_lib() ? "instrumentlib" : "";
> 1137:       const char* loadinfo = agent->is_loaded() ? "loaded" : "not loaded";
> 1138:       const char* initinfo = agent->is_initialized() ? "initialized" : "not initialized";

I would just print these as flags, its clearer and simpler to print. E.g.

"myagent path:  mylib.so dynamic:1 loaded:1 instrument_lib:0 initialized:1 xxx options xxx"

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

Marked as reviewed by stuefe (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/22706#pullrequestreview-2502573370
PR Review Comment: https://git.openjdk.org/jdk/pull/22706#discussion_r1884116576
PR Review Comment: https://git.openjdk.org/jdk/pull/22706#discussion_r1884113414


More information about the hotspot-dev mailing list