gradle / gradle-profiler

A tool for gathering profiling and benchmarking information for Gradle builds
Apache License 2.0
1.42k stars 156 forks source link

Add support for `jfrsync` with `async-profiler` #516

Open asodja opened 1 year ago

asodja commented 1 year ago

Async-profiler supports --jfrsync CONFIG option, see README:

--jfrsync CONFIG - start Java Flight Recording with the given configuration synchronously 
with the profiler. The output .jfr file will include all regular JFR events, except that execution 
samples will be obtained from async-profiler. This option implies -o jfr.

One option is, that we add it as --profile async-profiler-jfrsync option, similarly as we have --profile async-profiler-heap. And a custom configurable --async-profiler-jfrsync CONFIG where CONFIG is passed directly to --jfrsync parameter of async-profiler.

asodja commented 1 year ago

Alternatively we could use --jfrsync by default. One could then configure it via --async-profiler-jfrsync CONFIG and disable it via --async-profiler-jfrsync none.

We can then also add --profile async-profiler-cpu that would measure just cpu without jfrsync, basically what does --profile async-profiler now (similar also --profile async-profiler-heap would not use jfrsync).