#!/usr/bin/env bash # run the core profiler N times, fold set -e cd "$(dirname "$0")" nice cargo build --release -q D=../../external/dormann S=$(python3 -c "import json;print('%04X'%json.load(open('$D/labels.json'))['start'])") E=$(python3 -c "import json;print('%04X'%json.load(open('$D/labels.json'))['success_address'])") : > all.txt for i in $(seq ${N:-12}); do nice taskset -c ${CPU:-19} target/release/coreprof $D/test.bin $S $E 2>/dev/null >/dev/null || true if [ ! -s all.txt ]; then cat profile.txt > all.txt; else tail -n +2 profile.txt >> all.txt; fi done python3 ../profile.py all.txt --lines ${LINES:-40}