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

Alex Menkov amenkov at openjdk.org
Fri Dec 13 21:22:37 UTC 2024


On Fri, 13 Dec 2024 15:57:31 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

> > 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.
> 
> Maybe after the while loop something like this ?
> 
> ```
>   bool first_agent = true;
>   while (it.has_next()) {
>       ...
>   }
>   **if (first_agent) st->print_cr("JVMTI agents: none");**
> ```

You can do it before the loop:

if (it.has_next()) {
  st->print_cr("JVMTI agents:");
} else {
  st->print_cr("JVMTI agents: none");
}

and get rid of `first_agent` variable

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

PR Comment: https://git.openjdk.org/jdk/pull/22706#issuecomment-2542400056


More information about the serviceability-dev mailing list