RFR: 7903722: JMH: Add xctrace-based perfnorm profiler for macOS
Filipp Zhinkin
fzhinkin at openjdk.org
Tue Sep 24 23:33:50 UTC 2024
On Mon, 23 Sep 2024 17:03:54 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> @shipilev
>>> 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?
>
>> > 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
> Ctrl-C to stop the recording
> Run issues were detected (trace is still ready to be viewed):
> * [Error] Unexpected failure: Couriers have returned unexpectedly.
>
> * [Error] Failed to acquire kernel trace recording resources (Connection refused). Possibly in use by pid 53875.
>
> * [Error] UnexRepceocrtdeidn gf afialiulreed: wDiattha esroruorrcse. aSgaevnitn gf aoiultepdu tt of ialrem...
>
> .
> Output file saved as: Launch_java_2024-09-23_18.59.50_6B677147.trace
> <forked VM failed with exit code 2>
>
>
> ...and `pid 53875` is `tailspind`:
>
>
> 0 53875 1 0 5:45PM ?? 0:00.02 /usr/libexec/tailspind
Thank you, @shipilev!
-------------
PR Comment: https://git.openjdk.org/jmh/pull/131#issuecomment-2372568340
More information about the jmh-dev
mailing list