RFR: 7903696: JMH: Add xctrace-based perfasm profiler for macOS [v3]

Dmitry Tsitelov duke at openjdk.org
Wed Apr 17 11:06:54 UTC 2024


On Sun, 7 Apr 2024 18:22:34 GMT, Filipp Zhinkin <fzhinkin at openjdk.org> wrote:

>> Currently, the only perfasm profiler available on macOS is dtraceasm.
>> While it serves its purposes well, there are a few shortcomings: dtrace requires superuser privileges and it can only sample by timer interrupts.
>> 
>> Xcode comes with a performance-analysis tool called Instruments and it has a command-line tool, called xctrace.
>> xctrace allows profiling an app using both timer interrupts and PMI, and it does not require superuser privileges.
>> 
>> This PR brings JMH a profiler that uses xctrace on macOS.
>> 
>> ~~There are two profilers:~~
>> ~~- XCTraceAsmProfiler, a perfasm profiler based on xctrace that works fine out of the box;~~
>> ~~- XCTraceNormProfiler, a perfnorm profiler that requires mandatory parameter, that has to be setup using Instruments UI.~~
>> 
>> ~~The latter is added as a PoC and could be wiped out of this PR.~~
>> 
>> Unfortunately, `xctrace` exports data in XML format, thus most of the code is responsible for XML parsing.
>
> Filipp Zhinkin has updated the pull request incrementally with three additional commits since the last revision:
> 
>  - 7903696: Removed an option unsupported by older xctrace version
>  - 7903696: Support legacy backtrace format
>  - 7903696: Detect xctrace using xcode-select

Hi, many thanks for xctrace support, eagerly waiting for it.
Could you add any hints for an early adopter on how to check it from a development branch?

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

PR Comment: https://git.openjdk.org/jmh/pull/130#issuecomment-2060884287


More information about the jmh-dev mailing list