-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
89 lines (71 loc) · 2.47 KB
/
Makefile
File metadata and controls
89 lines (71 loc) · 2.47 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# SPDX-License-Identifier: GPL-2.0-only
# Makefile for linux-inference-memory-hints research demo
CC = gcc
CFLAGS = -O2 -Wall
BENCH_DIR = benchmarks
TOOLS_DIR = tools
RESULTS_DIR = results
.PHONY: all build run-baseline run-semantic run-pressure collect parse plot demo clean check-env validate check-semantic-support
all: build
build:
@echo "Building benchmarks..."
$(CC) $(CFLAGS) $(BENCH_DIR)/synthetic/memory_patterns.c -o $(BENCH_DIR)/synthetic/patterns
$(CC) $(CFLAGS) $(BENCH_DIR)/pressure/memory_pressure.c -o $(BENCH_DIR)/pressure/pressure
$(CC) $(CFLAGS) $(TOOLS_DIR)/check_semantic_support.c -o $(TOOLS_DIR)/check_semantic_support
check-semantic-support: build
@./$(TOOLS_DIR)/check_semantic_support
build-kernel:
@bash scripts/build_kernel.sh
create-rootfs:
@sudo bash scripts/create_rootfs.sh
run-qemu:
@bash scripts/run_qemu.sh
run-in-vm-note:
@echo "To run benchmarks inside the VM, execute: /mnt/repo/scripts/run_in_vm.sh"
check-env:
@bash $(TOOLS_DIR)/check_environment.sh
validate: build
@echo "Validating scripts and compilation..."
@bash -n $(TOOLS_DIR)/*.sh
@python3 -m py_compile $(TOOLS_DIR)/*.py
@echo "[OK] All components validated."
run-baseline: build
@echo "Running Baseline Workload..."
@mkdir -p $(RESULTS_DIR)/baseline
./$(BENCH_DIR)/synthetic/patterns --mode baseline & \
BENCH_PID=$$!; \
sleep 2; \
./$(BENCH_DIR)/pressure/pressure 4 & \
PRESS_PID=$$!; \
sleep 30; \
kill $$BENCH_PID $$PRESS_PID; \
$(TOOLS_DIR)/collect_mm_stats.sh baseline
run-semantic: build
@echo "Running Semantic-Hint Workload..."
@mkdir -p $(RESULTS_DIR)/semantic
./$(BENCH_DIR)/synthetic/patterns --mode semantic & \
BENCH_PID=$$!; \
sleep 2; \
./$(BENCH_DIR)/pressure/pressure 4 & \
PRESS_PID=$$!; \
sleep 30; \
kill $$BENCH_PID $$PRESS_PID; \
$(TOOLS_DIR)/collect_mm_stats.sh semantic
collect:
@echo "Manual collection not implemented as standalone. Use run-* targets."
parse:
@echo "Parsing results..."
python3 $(TOOLS_DIR)/parse_results.py
plot:
@echo "Generating plots..."
python3 $(TOOLS_DIR)/plot_results.py
demo: check-env build
@echo "Running full experiment demo..."
@bash $(TOOLS_DIR)/run_full_experiment.sh --runs 2
@echo "--------------------------------------------------"
@echo "Demo Complete. Results available in $(RESULTS_DIR)/"
@echo "Check $(RESULTS_DIR)/plots/ for visualizations."
@echo "--------------------------------------------------"
clean:
rm -f $(BENCH_DIR)/synthetic/patterns $(BENCH_DIR)/pressure/pressure
rm -rf $(RESULTS_DIR)/*