eclipse-openj9 / openj9-utils

Other
16 stars 29 forks source link

perf-tool: Consider setting capabilities only if needed #57

Closed dsouzai closed 3 years ago

dsouzai commented 3 years ago

I see that capabilities like can_generate_method_entry_events (and can_generate_method_exit_events in https://github.com/eclipse/openj9-utils/pull/52) are set on Agent_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).

mpirvu commented 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).

dsouzai commented 3 years ago

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.