Archived
1
0
forked from rarias/bscpkgs

Add extrae and perf stages

This commit is contained in:
2020-09-02 10:44:13 +02:00
parent d05d32edbf
commit d469ccd59d
11 changed files with 368 additions and 14 deletions

29
bsc/garlic/statspy.nix Normal file
View File

@@ -0,0 +1,29 @@
{
stdenv
, bash
}:
{
app
, outputDir ? "."
, program ? "bin/run"
}:
stdenv.mkDerivation {
name = "${app.name}-statspy";
preferLocalBuild = true;
phases = [ "installPhase" ];
installPhase = ''
mkdir -p $out/bin
cat > $out/bin/run <<EOF
#!${bash}/bin/bash
mkdir -p ${outputDir}
cat /proc/[0-9]*/stat | sort -n > ${outputDir}/statspy.\$(date +%s.%3N).begin
${app}/${program}
cat /proc/[0-9]*/stat | sort -n > ${outputDir}/statspy.\$(date +%s.%3N).end
EOF
chmod +x $out/bin/run
'';
}