Using perf:
$ perf record -g binary
$ perf script | stackcollapse-perf.pl | rust-unmangle | flamegraph.pl > flame.svg
NOTE: See @GabrielMajeri's comments below about the
-goption.
| # for more info: https://gist.github.com/1120938 |
| /* | |
| * Starts jetty for scalatra programatically | |
| * | |
| * Replace YourApplicationEndpointFilter with the filter in your application | |
| */ | |
| import org.eclipse.jetty.server.Server | |
| import org.eclipse.jetty.servlet.{DefaultServlet, ServletContextHandler} | |
| object JettyLauncher { | |
| def main(args: Array[String]) { |
| package scalaz_memo_example | |
| import scala.util.control.Exception.allCatch | |
| import scalaz._ | |
| import Scalaz._ | |
| object Main{ | |
| def timer[T](f : => T):T = { | |
| val start = System.currentTimeMillis |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| Version 2, December 2004 | |
| Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
| Everyone is permitted to copy and distribute verbatim or modified | |
| copies of this license document, and changing it is allowed as long | |
| as the name is changed. | |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
| # place mathjax.rb in _plugins directory of your blog | |
| require 'redcarpet' | |
| class HTMLwithAlbino < Redcarpet::Render::HTML | |
| def block_code(code, language) | |
| if language == 'mathjax' | |
| "<script type=\"math/tex; mode=display\"> | |
| #{code} | |
| </script>" | |
| else | |
| "<pre><code class=\"#{language}\">#{code}</code></pre>" |
Using perf:
$ perf record -g binary
$ perf script | stackcollapse-perf.pl | rust-unmangle | flamegraph.pl > flame.svg
NOTE: See @GabrielMajeri's comments below about the
-goption.
Flamegraphing in Rust can now be done with a new cargo subcommand. Please check this out before embarking on the legacy journey below:
https://github.com/flamegraph-rs/flamegraph
perf, using Brendan Gregg's guide:
http://www.brendangregg.com/perf.html#Prerequisitesflamegraph from repo:| #!/bin/bash | |
| gdb -p "$1" -batch -ex 'set {short}$rip = 0x050f' -ex 'set $rax=231' -ex 'set $rdi=0' -ex 'cont' |