-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (45 loc) · 1.73 KB
/
Makefile
File metadata and controls
63 lines (45 loc) · 1.73 KB
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
V3D_PROJECT_DIR := /home/zhenlu/proj325
V3D_DATA_DIR := $(V3D_PROJECT_DIR)/data
V3D_LOG_DIR := $(V3D_DATA_DIR)/log
V3D_RECORD_DATA_DIR := $(V3D_DATA_DIR)/record_input \
$(V3D_DATA_DIR)/record_mem
V3D_REPLAY_DATA_DIR := $(V3D_DATA_DIR)/replay_mem
V3D_RECORDER_DIR := $(V3D_PROJECT_DIR)/source/recorder
V3D_RECORDING_PARSER := ${V3D_RECORDER_DIR}/parser.py
V3D_APPS_DIR := ${V3D_PROJECT_DIR}/apps
V3D_APP ?= no_app
KVER := $(shell uname -r)
.PHONY: init build load clean record_ncnn
init: load build
load:
make -C /lib/modules/$(KVER)/build M=$(V3D_RECORDER_DIR) modules
sudo systemctl isolate multi-user.target
-sudo rmmod v3d
sudo insmod $(V3D_RECORDER_DIR)/v3d.ko
build: $(V3D_RECORD_DATA_DIR) $(V3D_REPLAY_DATA_DIR) $(V3D_LOG_DIR)
$(V3D_RECORD_DATA_DIR):
mkdir -p $(V3D_RECORD_DATA_DIR)
$(V3D_REPLAY_DATA_DIR):
mkdir -p $(V3D_REPLAY_DATA_DIR)
$(V3D_LOG_DIR):
mkdir -p $(V3D_LOG_DIR)
clean:
sudo make -C /lib/modules/$(KVER)/build M=$(V3D_RECORDER_DIR) clean
-sudo rm -r $(V3D_DATA_DIR)
apptest:
sudo rmmod v3d
sudo modprobe v3d
cd $(V3D_APPS_DIR)/$(V3D_APP)/record && ./run.sh
record: init
sudo sh -c 'echo 1 > /sys/kernel/tracing/tracing_on'
sudo sh -c 'echo 1 > /sys/kernel/debug/tracing/events/v3d/enable'
sudo sh -c 'echo > /sys/kernel/tracing/trace'
cd $(V3D_APPS_DIR)/$(V3D_APP)/record && ./run.sh
sudo sh -c 'cat /sys/kernel/tracing/trace > $(V3D_LOG_DIR)/$(V3D_APP).log'
sudo sh -c 'echo 0 > /sys/kernel/debug/tracing/events/v3d/enable'
sudo sh -c 'echo 0 > /sys/kernel/tracing/tracing_on'
$(V3D_RECORDING_PARSER) $(V3D_LOG_DIR)/$(V3D_APP).log
cp $(V3D_LOG_DIR)/records-$(V3D_APP).h $(V3D_RECORDER_DIR)/gen
replay: init
cat /sys/kernel/debug/dri/0/replay-$(V3D_APP)
cd $(V3D_APPS_DIR)/$(V3D_APP)/replay && ./run.sh