Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flamegraph incompatible with macOS dtrace #75

Open
Feliix42 opened this issue Feb 21, 2020 · 11 comments
Open

flamegraph incompatible with macOS dtrace #75

Feliix42 opened this issue Feb 21, 2020 · 11 comments

Comments

@Feliix42
Copy link

When running flamegraph on version 0.2.0, it only results in dtrace showing me it's usage message, indicating that the flamegraph tool used a wrong invocation.

For reference, I use macOS Mojave (Version 10.14.6) with the stock dtrace.

@djc
Copy link
Contributor

djc commented Jul 9, 2020

FWIW, flamegraph 0.3.0 seems to be working fine for me on current Catalina.

@alexhexabeam
Copy link

alexhexabeam commented Jul 22, 2020

I also get the dtrace usage message on Mojave (10.14.6), with flamegraph 0.3.0.

@chamons
Copy link

chamons commented Jul 27, 2020

I was able to run on macOS (10.15), and saw a number of error messages:

dtrace: description 'profile-997 ' matched 1 probe
dtrace: pid 45003 has exited
dtrace: error on enabled probe ID 1 (ID 34: profile:::profile-997): invalid address (0x7ffee5f38900) in action #2
dtrace: error on enabled probe ID 1 (ID 34: profile:::profile-997): invalid address (0x7ffee5f38900) in action #2

however it did successfully complete:

writing flamegraph to "flamegraph.svg"

@alexhexabeam
Copy link

@chamons What version of OSX were you running? So far, we've got two reports of it failing on Mojave, and one of success on Catalina.

@chamons
Copy link

chamons commented Jul 27, 2020

Apologies, I thought I pasted it.

10.15.6 (19G73)

@joecorcoran
Copy link

Maybe this helps someone figure it out: I can run flamegraph 0.3.1 on macOS 10.14.6, but only when I pass no arguments to the executable. sudo cargo flamegraph --bin mybin works, sudo cargo flamegraph --bin mybin -- --myarg just prints the dtrace usage instructions.

@Erk-
Copy link

Erk- commented Aug 13, 2020

Also happens on FreeBSD 12.1-RELEASE-p8

$ DTRACE=/usr/sbin/dtrace cargo flamegraph --root --bin test -- argument
    Finished release [optimized + debuginfo] target(s) in 0.14s
dtrace: invalid probe specifier profile-997 /pid == $target/ { @[ustack(100)] = count(); }: extraneous argument 'argument' ($1 is not referenced)
failed to sample program

@djc
Copy link
Contributor

djc commented Sep 29, 2020

If you are having this issue, please try my fix in #100.

@alexhexabeam
Copy link

@djc Your fix seems to work for me. Thank you!

@Feliix42
Copy link
Author

Works for me as well. :)

@kdy1
Copy link

kdy1 commented Nov 28, 2020

I created a new tool, which fixes this issue and supports running any target.

See: https://github.com/kdy1/cargo-profile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants