jlfwong / speedscope

🔬 A fast, interactive web-based viewer for performance profiles.
https://www.speedscope.app
MIT License
5.45k stars 237 forks source link

[wiki] Importing from `sample` (macos) #479

Closed will closed 1 month ago

will commented 1 month ago

Thanks for speedscope!

I dont have xcode or Instruments installed, but I figured out how to import from sample which comes with macos. I was going to add it to the wiki but I dont think I can.

first get stackcollapse-sample.awk:

curl -LO https://raw.githubusercontent.com/brendangregg/FlameGraph/master/stackcollapse-sample.awk
chmod +x stackcollapse-sample.awk

Then to get a flame.prof file to put into speedscope:

sample <pid | partial-process-name> -file /dev/stdout | ./stackcollapse-sample.awk > flame.prof
will commented 1 month ago

Just going to close this since it's not actually an issue, just wanted to share how to do it for people who come along