summaryrefslogtreecommitdiff
path: root/tool/lrama/lib/lrama/report/profile.rb
diff options
context:
space:
mode:
Diffstat (limited to 'tool/lrama/lib/lrama/report/profile.rb')
-rw-r--r--tool/lrama/lib/lrama/report/profile.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/tool/lrama/lib/lrama/report/profile.rb b/tool/lrama/lib/lrama/report/profile.rb
new file mode 100644
index 0000000000..36156800a4
--- /dev/null
+++ b/tool/lrama/lib/lrama/report/profile.rb
@@ -0,0 +1,14 @@
+module Lrama
+ class Report
+ module Profile
+ # See "Profiling Lrama" in README.md for how to use.
+ def self.report_profile
+ require "stackprof"
+
+ StackProf.run(mode: :cpu, raw: true, out: 'tmp/stackprof-cpu-myapp.dump') do
+ yield
+ end
+ end
+ end
+ end
+end