Closed dsouzai closed 3 years ago
If I understanding correctly you are suggesting to have an agent option (something like -agentpath:/home/mpirvu/CANOSP/libagent.so=logFile:log.json,enableMethodEnterExit:true
) that will enable the MethodEnter/Exit capability. If this option is not present, method tracing will not be possible, even if a user may decide to do such tracing after the JVM has started (by connecting through a socket and using interactive commands).
Yeah, or maybe having the inverse, like disableMethodEnterExit:true
so that if the user knows they're not going to use method enter/exit tracing, then we can minimize the overhead impact to the JVM.
I see that capabilities like
can_generate_method_entry_events
(andcan_generate_method_exit_events
in https://github.com/eclipse/openj9-utils/pull/52) are set onAgent_OnLoad
. It might be worth only setting these if explicitly set on the agent options so that if these capabilities aren't used, the JVM won't have to make unnecessary compromises (for example, the optimizations the JIT has to forgo because method enter/exit hooks could be triggered).