On Tue, 1 Dec 2026 03:07:32 GMT, Andrei Pangin <[email protected]> wrote:
> I agree that invocation of `Agent_OnAttach` is not an agent as such. But it > is a useful event on its own, and it's the function where `options` come > from. I think it was an oversight to make `NativeAgent` event periodic in the > first place, and it's the root cause of the original issue. As a momentary > event, invocation of `Agent_OnLoad`/`Agent_OnAttach` makes total sense, and > it provides more information to the user comparing to jvmtiEnv-based > alternative. The cleanest solution would be probably to make two separate > events: one periodic (jvmtiEnv-based) and one momentary (invocation-based). Take a look at the examples and the output in [JDK-8392584](https://bugs.openjdk.org/browse/JDK-8392584) , and try to justify why the end-user should get flooded with agent-internal control messages like: jdk.NativeAgent { startTime = 15:31:59.758 (2026-09-23) name = "D:\utilities\intellij\lib\async-profiler\amd64\libasyncProfiler.dll" options = "start,jfr,event=wall,interval=10ms,jfrsync=profile,file=C:\Users\mgronlun.MGRONLUN01\IdeaSnapshots\MethodTracer_2026_09_23_153130.jfr,log=D:\temp\MethodTracer_2026_09_23_153130.jfr.log.txt,loglevel=DEBUG,dbghelppath=D:\utilities\intellij\lib\async-profiler\amd64\dbghelp.dll" dynamic = true initializationTime = 15:31:30.244 (2026-09-23) initializationDuration = 830 ms path = "D:\utilities\intellij\lib\async-profiler\amd64\libasyncProfiler.dll" disposalTime = N/A } If an agent wants its own control-channel tracing, it could log it privately to avoid flooding the end user with irrelevant details. ------------- PR Comment: https://git.openjdk.org/jdk/pull/33700#issuecomment-7306687258
