Generate tracy trace from chrome profile

This commit is contained in:
Félix Baylac Jacqué 2024-02-06 12:12:46 +01:00
parent 08e875fb33
commit 9c3d91e331
2 changed files with 25 additions and 1 deletions

23
profile.sh Executable file
View File

@ -0,0 +1,23 @@
#!/usr/bin/env bash
set -euo pipefail
nix-shell --run "make -j '$(nproc --all)'"
workspace=$(mktemp -d)
function cleanup {
rm -rf "${workspace}"
}
trap cleanup EXIT
chromejson="${workspace}"/out.json
tracyfile="${workspace}"/out.tracy
echo "[+] Instantiating derivation"
NIX_SHOW_TRACE=1 ./outputs/out/bin/nix-instantiate $@ > "${chromejson}"
echo "[+] Converting chrome profile to tracy profile"
nix-shell -p tracy --run "import-chrome '${chromejson}' '${tracyfile}'"
nix-shell -p tracy --run "tracy '${tracyfile}'"

View File

@ -81,7 +81,8 @@ void processExpr(EvalState & state, const Strings & attrPaths,
if (store2)
drvPathS = store2->addPermRoot(drvPath, rootName);
}
std::cout << fmt("%s%s\n", drvPathS, (outputName != "out" ? "!" + outputName : ""));
// THis is polluting the nice trace we're generating, boo.
// std::cout << fmt("%s%s\n", drvPathS, (outputName != "out" ? "!" + outputName : ""));
}
}
}