From fe96211bb8dc81fde57bf6900b840e69f2b218fc Mon Sep 17 00:00:00 2001 From: Kleidi Bujari Date: Fri, 12 Sep 2025 20:57:59 -0700 Subject: move packages to overlay and expose certain packages --- packages/perf-flamegraph.nix | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'packages/perf-flamegraph.nix') 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 '' -- cgit v1.3.1