Created
February 1, 2017 14:50
-
-
Save lukego/692bedff26e17a5a892bbc53cc2e4758 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create R visualizations of Snabb timeline logs | |
with import <nixpkgs> {}; | |
with stdenv; with lib; | |
let | |
snabb = (import ../snabb).timeline-pmu; | |
timelineCSV = shm: | |
mkDerivation { | |
name = "timeline-csv"; | |
src = shm; | |
buildInputs = [ snabb ]; | |
sourceRoot = "."; | |
prePath = "set -eux"; | |
buildPhase = '' | |
/var/setuid-wrappers/sudo ${./timeline2csv.sh} shm timeline.csv | |
''; | |
installPhase = '' | |
mkdir -p $out | |
cp timeline.csv $out/ | |
''; | |
}; | |
in | |
{ | |
timeline = timelineCSV /home/luke/shm/var/run/snabb/29771; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [ $# != 2 ]; then | |
echo "Usage: $0 <shmdir> <output>" | |
exit 1 | |
fi | |
timeline=$1/engine/timeline | |
csv=$2 | |
[ -f $timeline ] || (echo "file not found: $timeline"; exit 1) | |
snabb snsh -e "require('core.timeline').dump('$timeline')" > $csv |
After s/prePath/prePatch/
:
[luke@interlaken:~/git/studio/nix/timeline]$ nix-build
these derivations will be built:
/nix/store/q0f076y9kpjk76xbgnvxd8dw5whz5flp-timeline-csv.drv
building path(s) ‘/nix/store/dpsrls97wk6hg0bhwlphzf53ays99q1d-timeline-csv’
unpacking sources
unpacking source archive /nix/store/9r4qmsj68bbc4s7m0s8qcrgxmr0j9in8-29771
source root is .
setting SOURCE_DATE_EPOCH to timestamp 1485960732 of file ./env-vars
warning: file ./env-vars may be generated; SOURCE_DATE_EPOCH may be non-deterministic
patching sources
++ return 0
/nix/store/62h3c4d6rdnlxichixqg8h9jxi8nhxk0-stdenv/setup: line 612: patches: unbound variable
+++ exitHandler
+++ exitCode=1
+++ set +e
+++ closeNest
+++ '[' 1 -gt 0 ']'
+++ stopNest
+++ nestingLevel=0
+++ echo -en '\033[q'
+++ '[' 0 -gt 0 ']'
/nix/store/62h3c4d6rdnlxichixqg8h9jxi8nhxk0-stdenv/setup: line 124: showBuildStats: unbound variable
builder for ‘/nix/store/q0f076y9kpjk76xbgnvxd8dw5whz5flp-timeline-csv.drv’ failed with exit code 1
error: build of ‘/nix/store/q0f076y9kpjk76xbgnvxd8dw5whz5flp-timeline-csv.drv’ failed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output: