1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-12 10:39:00 +00:00
trezor-firmware/emu.sh
2016-09-27 17:25:58 +02:00

25 lines
641 B
Bash
Executable File

#!/bin/bash
ARGS="${ARGS:--O0 -X heapsize=100000}"
MAIN="${MAIN:-main.py}"
BROWSER="${BROWSER:-chromium}"
cd `dirname $0`/src
case "$1" in
"-d")
shift
gdb --args ../vendor/micropython/unix/micropython $ARGS $* $MAIN
;;
"-p")
shift
../vendor/micropython/unix/micropython $ARGS $* $MAIN &
perf record -F 100 -p $! -g -- sleep 600
perf script > perf.trace
../vendor/flamegraph/stackcollapse-perf.pl perf.trace | ../vendor/flamegraph/flamegraph.pl > perf.svg
$BROWSER perf.svg
;;
*)
../vendor/micropython/unix/micropython $ARGS $* $MAIN
esac