Add perf stage

This commit is contained in:
Rodrigo Arias 2020-10-15 18:50:34 +02:00
parent 4f901c1b9c
commit c3659d316d
2 changed files with 31 additions and 0 deletions

30
garlic/stages/perf.nix Normal file
View File

@ -0,0 +1,30 @@
{
stdenv
, perf
, garlicTools
}:
{
nextStage
, perfOptions
}:
with garlicTools;
let
program = stageProgram nextStage;
in
stdenv.mkDerivation {
name = "perf";
phases = [ "installPhase" ];
preferLocalBuild = true;
dontPatchShebangs = true;
installPhase = ''
cat > $out <<EOF
#!/bin/sh
exec ${perf}/bin/perf ${perfOptions} ${program}
EOF
chmod +x $out
'';
}

View File

@ -244,6 +244,7 @@ let
exec = callPackage ./garlic/stages/exec.nix { }; exec = callPackage ./garlic/stages/exec.nix { };
extrae = callPackage ./garlic/stages/extrae.nix { }; extrae = callPackage ./garlic/stages/extrae.nix { };
valgrind = callPackage ./garlic/stages/valgrind.nix { }; valgrind = callPackage ./garlic/stages/valgrind.nix { };
perf = callPackage ./garlic/stages/perf.nix { };
isolate = callPackage ./garlic/stages/isolate { }; isolate = callPackage ./garlic/stages/isolate { };
runexp = callPackage ./garlic/stages/runexp { }; runexp = callPackage ./garlic/stages/runexp { };
trebuchet = callPackage ./garlic/stages/trebuchet.nix { }; trebuchet = callPackage ./garlic/stages/trebuchet.nix { };