From e739fa7bde85912a6dd8bea5c48c216769272da5 Mon Sep 17 00:00:00 2001 From: Greg Hurrell Date: Fri, 25 Oct 2024 13:54:31 +0200 Subject: [PATCH] docs: add notes on using Samply --- CONTRIBUTING.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 53edce71..a56f507d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -152,7 +152,7 @@ I also attempted using the `/usr/bin/sample` tool, which produces results, albei sample -wait luajit -mayDie ``` -So far, `dtrace` is the only thing I've been able to get working usefully: +`dtrace`, however, produced a useful result, albeit with some hoop-jumping required: ``` sudo -v @@ -196,6 +196,15 @@ cd FlameGraph dwarfdump --uuid /opt/homebrew/bin/luajit # but not with this. ``` +I also had success straightforwardly with [Samply](https://github.com/mstange/samply): + +``` +cargo install --locked samply +TIMES=1 ~/.cargo/bin/samply record luajit bin/benchmarks/matcher.lua +``` + +**Note:** Using `TIMES=1` because otherwise the generated `profile.json` is too big and crashes Chrome (but not Safari). + ### Using PGO (Profile-Guided Optimizations) Make a build that collects profiling data: