flamegraph
flamegraph copied to clipboard
Option to use `sample` on macos instead of `dtrace`
dtrace is not available on macOS when "system integrity protection is on"
% sudo flamegraph ls
dtrace: system integrity protection is on, some features will not be available
dtrace: failed to execute ls: dtrace cannot control executables signed with restricted entitlements
failed to sample program
It would be helpful if flamegraph could also use sample program for collecting samples.
Inferno already has support for sample, so this should not be terribly difficult to implement. I just realized how horrible the UX of using DTrace on macOS is, so PRs are very welcome! (though I can't test this personally)
dtrace is not available on macOS when "system integrity protection is on"
Actually it only doesn't work for executables with restricted entitlements (like many system executables)
dtrace cannot control executables signed with restricted entitlements
@bjorn3 are you sure? I've found conflicting information about this. If that's the case that would be great though.
I just tried it, and running dtrace as root with a non system binary works. When running as normal user, it says: "dtrace: failed to initialize dtrace: DTrace requires additional privileges".