RFR: CODETOOLS-7902928: Improve support for async-profiler 2.x [v2]

Andrei Pangin apangin at openjdk.java.net
Mon May 10 14:38:07 UTC 2021


On Mon, 10 May 2021 14:27:32 GMT, Andrei Pangin <apangin at openjdk.org> wrote:

>> Jason Zaugg has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fixup: remove incorrect/unneeded 'reset' argument
>
> jmh-core/src/main/java/org/openjdk/jmh/profile/AsyncProfiler.java line 100:
> 
>> 98: 
>> 99:         OptionSpec<String> optEvent = parser.accepts("event",
>> 100:                 "Event(s) to sample: cpu, alloc, lock, wall, itimer; com.foo.Bar.methodName; any event from `perf list` e.g. cache-misses")
> 
> I'd vote against making `event` a multi-option:
> 
> - First, not all events can be profiled together, e.g. you cannot profile `wall` and `cache-misses` at the same time. Only `alloc` and/or `lock` may be combined with other events.
> - Second, async-profiler has dedicated options for specifying the allocation profiling interval and the lock profiling threshold, like `alloc=512k,lock=1ms`. Even though multiple `event=x` options are allowed, the canonical way to turn on allocation and lock profiling is `event=cpu,alloc[=interval],lock[=threshold]` (interval and threshold are optional).

So, instead of making `event` a multi-option, my suggestion is to add `alloc` and `lock` as separate options that will be directly translated to async-profiler's peer options.

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

PR: https://git.openjdk.java.net/jmh/pull/37


More information about the jmh-dev mailing list