RFR: 7903722: JMH: Add xctrace-based perfnorm profiler for macOS

Aleksey Shipilev shade at openjdk.org
Mon Sep 23 17:06:49 UTC 2024


On Mon, 23 Sep 2024 16:06:19 GMT, Filipp Zhinkin <fzhinkin at openjdk.org> wrote:

> > I tried on my Mac, and I think profiler requires super-user privileges? I only succeeded when running `sudo java ....`
> 
> It should not require super-user privileges. Otherwise, `xctraceasm` will require them too. Could you please elaborate on what happened w/o SU-privileges?

Yeah, `xctraceasm` does not work either. This might be a borked setup on my side, really. 


$ java -jar jmh-samples/target/benchmarks.jar -prof xctracenorm -f 1 JMHSample_35_Profilers.Atomic -v EXTRA
...

# Fork: 1 of 1
# Preparing profilers: XCTraceNormProfiler 
[-[SimServiceContext sendRequest:]:1764] ERROR : Unable to deliver request ({
    "developer_dir" = "/Applications/Xcode.app/Contents/Developer";
    request = "set_developer_dir";
}) because we are not connected to CoreSimulatorService.
[-[SimServiceContext initWithDeveloperDir:connectionType:error:]:450] WARN  : Unable to discover any Simulator runtimes. Developer Directory is /Applications/Xcode.app/Contents/Developer.
[-[SimDiskImageManager init]:146] ERROR : Could not kickstart simdiskimaged; SimDiskImageManager services will not be available: Error Domain=NSPOSIXErrorDomain Code=53 "Software caused connection abort" UserInfo={NSLocalizedDescription=Error returned in reply from CoreSimulatorService: Connection invalid}
[-[SimServiceContext sendRequest:reply:error:]:1784] ERROR : Unable to deliver request ({
    request = "notification_subscription";
    "set_path" = "/Users/shipilev/Library/Developer/CoreSimulator/Devices";
}) because we are not connected to CoreSimulatorService.
Starting recording with the jmh14925377671874505903extracted template. Launching process: java. 
xpc connection invalid: com.apple.dt.instruments.dtsecurity.xpc

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

PR Comment: https://git.openjdk.org/jmh/pull/131#issuecomment-2368867270


More information about the jmh-dev mailing list