blob: f3e862085794021879e19f432e61334f35c3d1de (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
start:
case "$(shell hostname)" in \
gadget-*) \
libcamerify tclsh8.6 main.tcl;; \
*) \
tclsh8.6 main.tcl;; \
esac
debug:
gdb --args tclsh8.6 main.tcl
remote-debug: sync
ssh -tt folk@$(FOLK_SHARE_NODE) -- 'sudo systemctl stop folk && make -C /home/folk/folk debug'
FOLK_SHARE_NODE := $(shell tclsh8.6 hosts.tcl shareNode)
sync:
rsync --delete --timeout=5 -e "ssh -o StrictHostKeyChecking=no" -a . folk@$(FOLK_SHARE_NODE):/home/folk/folk
sync-restart: sync
ssh -tt folk@$(FOLK_SHARE_NODE) -- 'sudo systemctl restart folk'
test:
for testfile in test/*.tcl; do echo; echo $${testfile}; echo --------; make FOLK_ENTRY=$${testfile}; done
test/%.debug:
FOLK_ENTRY=test/$*.tcl lldb -- tclsh8.6 main.tcl
test/%:
make FOLK_ENTRY=$@.tcl
repl:
tclsh8.6 replmain.tcl
journal:
ssh folk@$(FOLK_SHARE_NODE) -- journalctl -f -n 100 -u folk
ssh:
ssh folk@$(FOLK_SHARE_NODE)
FLAMEGRAPH_TID := $(shell pgrep tclsh8.6 | head -1)
flamegraph:
sudo perf record -F 997 --tid=$(FLAMEGRAPH_TID) -g -- sleep 30
sudo perf script -f > out.perf
~/FlameGraph/stackcollapse-perf.pl out.perf > out.folded
~/FlameGraph/flamegraph.pl out.folded > out.svg
# You can use the Web server to check the pid of display.folk,
# apriltags.folk, camera.folk, etc.
remote-flamegraph:
ssh -t folk@$(FOLK_SHARE_NODE) -- make -C /home/folk/folk flamegraph $(if $(REMOTE_FLAMEGRAPH_TID),FLAMEGRAPH_TID=$(REMOTE_FLAMEGRAPH_TID),)
scp folk@$(FOLK_SHARE_NODE):~/folk/out.svg .
scp folk@$(FOLK_SHARE_NODE):~/folk/out.perf .
backup-printed-programs:
cd ~/folk-printed-programs && timestamp=$$(date '+%Y-%m-%d_%H-%M-%S%z') && tar -zcvf ~/"folk-printed-programs_$$timestamp.tar.gz" . && echo "Saved to: ~/folk-printed-programs_$$timestamp.tar.gz"
calibrate:
tclsh8.6 calibrate.tcl
calibrate-debug:
gdb --args tclsh8.6 calibrate.tcl
remote-calibrate: sync
ssh folk@$(FOLK_SHARE_NODE) -- make -C /home/folk/folk calibrate
remote-calibrate-debug: sync
ssh folk@$(FOLK_SHARE_NODE) -- make -C /home/folk/folk calibrate-debug
.PHONY: test sync start journal repl calibrate remote-calibrate
|