summaryrefslogtreecommitdiff
path: root/packages/perf-flamegraph.nix
diff options
context:
space:
mode:
authorKleidi Bujari <mail@4kb.net>2025-09-12 20:57:59 -0700
committerKleidi Bujari <mail@4kb.net>2025-09-12 21:00:27 -0700
commitfe96211bb8dc81fde57bf6900b840e69f2b218fc (patch)
treeff1c63e7962c6373199b94b8fd236b15e3441244 /packages/perf-flamegraph.nix
parentab58c69b6db2902688841a4008221f72bbbb8692 (diff)
downloaddepot-fe96211bb8dc81fde57bf6900b840e69f2b218fc.tar.gz
depot-fe96211bb8dc81fde57bf6900b840e69f2b218fc.tar.bz2
depot-fe96211bb8dc81fde57bf6900b840e69f2b218fc.zip
move packages to overlay and expose certain packages
Diffstat (limited to 'packages/perf-flamegraph.nix')
-rw-r--r--packages/perf-flamegraph.nix22
1 files changed, 14 insertions, 8 deletions
diff --git a/packages/perf-flamegraph.nix b/packages/perf-flamegraph.nix
index b472b74..780a280 100644
--- a/packages/perf-flamegraph.nix
+++ b/packages/perf-flamegraph.nix
@@ -1,12 +1,18 @@
-# Script that collects perf timing for the execution of a command and writes a
-# flamegraph to stdout
-{ pkgs, ... }:
+# Script that collects perf timing for the execution of a command and
+# writes a flamegraph to stdout
-pkgs.writeShellScriptBin "perf-flamegraph" ''
+{
+ writeShellScriptBin,
+ linuxPackages,
+ flamegraph,
+ ...
+}:
+
+writeShellScriptBin "perf-flamegraph" ''
set -euo pipefail
- ${pkgs.linuxPackages.perf}/bin/perf record -g --call-graph dwarf -F max "$@"
- ${pkgs.linuxPackages.perf}/bin/perf script \
- | ${pkgs.flamegraph}/bin/stackcollapse-perf.pl \
- | ${pkgs.flamegraph}/bin/flamegraph.pl
+ ${linuxPackages.perf}/bin/perf record -g --call-graph dwarf -F max "$@"
+ ${linuxPackages.perf}/bin/perf script \
+ | ${flamegraph}/bin/stackcollapse-perf.pl \
+ | ${flamegraph}/bin/flamegraph.pl
''