jlfwong / speedscope

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

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

Closed will closed 4 months ago

will commented 4 months 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 4 months 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