On Mon, 29 May 2023 09:37:08 GMT, Alan Bateman <al...@openjdk.org> wrote:

>> This is the implementation for JEP 451. There are two parts to this:
>> 
>> 1. A multi-line warning is printed when a JVM TI or Java agent is loaded 
>> into a running VM. For JVM TI, the message is printed to stderr from 
>> JvmtiAgent::load. For Java agents, it is printed to System.err (as that may 
>> be redirected) in the JPLIS (j.l.instrumentation) implementation. This part 
>> includes an update to the JVM TI spec and API docs to require the warning.
>> 
>> 2. If running with -Djdk.instrument.traceUsage or 
>> -Djdk.instrument.traceUsage=true, the calls to the Instrumentation API print 
>> a trace message and stack trace.
>> 
>> Testing: tier1-6
>
> Alan Bateman has updated the pull request with a new target base due to a 
> merge or a rebase. The incremental webrev excludes the unrelated changes 
> brought in by the merge/rebase. The pull request contains 14 additional 
> commits since the last revision:
> 
>  - Allow for warning to be skipped when same agent loaded a second/subsequent 
> time
>  - Merge
>  - Tweak javadoc, update test to use more test infra
>  - Merge
>  - Merge
>  - Refresh package description
>  - Merge
>  - Tweak docs
>  - Merge
>  - Draft docs changes
>  - ... and 4 more: https://git.openjdk.org/jdk/compare/43a8a7a4...a6d3c23c

src/hotspot/share/prims/jvmtiAgentList.cpp line 231:

> 229:        if (agent->is_static_lib() && agent->is_loaded()) {
> 230:          return true;
> 231:        }

This doesn't make sense to me. If  you pass in `null` for `os_lib`, then we 
return true if any loaded static lib is found. Is this an attempt to limit the 
warning to just the first static lib that is loaded? Also, why would `null` 
ever be passed in if there wasn't at least one static lib. Some clarify 
comments would be useful.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13899#discussion_r1212282761

Reply via email to