ds: add perf stat parser

We can only read one output file by now, located at:
.garlic/perf.csv
This commit is contained in:
2021-03-05 18:29:43 +01:00
parent c1efba1e65
commit 14fbb1499b
3 changed files with 96 additions and 0 deletions

23
garlic/ds/perf/stat.nix Normal file
View File

@@ -0,0 +1,23 @@
{
stdenv
, python3
, gzip
}:
resultTree:
stdenv.mkDerivation {
name = "perf-stat.json.gz";
preferLocalBuild = true;
src = ./stat.py;
phases = [ "unpackPhase" "installPhase" ];
unpackPhase = ''
cp $src stat.py
'';
buildInputs = [ python3 gzip ];
installPhase = ''
python stat.py ${resultTree} | gzip > $out
'';
}