|
1 | | -.PHONY: all clean test build-amd64 build-arm64 build-all cross docker-push docker-test-build docker-test-run format local debug bpf-test microbenchmarks test-multi test-pc-real test-pc-mock |
| 1 | +.PHONY: all clean test build-amd64 build-arm64 build-all cross docker-push docker-test-build docker-test-run format local debug generate bpf-test microbenchmarks test-multi test-pc-real test-pc-mock |
2 | 2 |
|
3 | 3 | LIB_NAME = libparcagpucupti.so |
4 | 4 |
|
@@ -115,18 +115,23 @@ microbenchmarks: $(MICROBENCH_BINS) |
115 | 115 | microbenchmarks/%: microbenchmarks/%.cu |
116 | 116 | $(NVCC) -g -lineinfo -arch=$(CUDA_ARCH) -o $@ $< |
117 | 117 |
|
118 | | -# Build the BPF activity parser test program |
| 118 | +# Run go generate for the BPF test program (compiles .bpf.c via bpf2go) |
119 | 119 | # Requires: clang, libbpf-dev, bpftool (for vmlinux.h), Go 1.21+ |
120 | | -bpf-test: |
121 | | - @echo "=== Building BPF activity parser test ===" |
| 120 | +generate: |
| 121 | + @echo "=== Generating BPF objects ===" |
122 | 122 | @if [ ! -f test/bpf/vmlinux.h ]; then \ |
123 | 123 | echo "Generating vmlinux.h from kernel BTF..."; \ |
124 | 124 | bpftool btf dump file /sys/kernel/btf/vmlinux format c > test/bpf/vmlinux.h; \ |
125 | 125 | fi |
126 | 126 | @cd test/bpf && \ |
127 | | - export USDT_HEADERS=$$(go mod download github.com/parca-dev/usdt >/dev/null && \ |
128 | | - go list -m -f '{{.Dir}}' github.com/parca-dev/usdt)/ebpf && \ |
129 | | - go generate ./... && CGO_ENABLED=0 go build -o activity_parser . |
| 127 | + USDT_HEADERS=$$(go list -m -f '{{.Dir}}' github.com/parca-dev/usdt)/ebpf && \ |
| 128 | + export USDT_HEADERS && \ |
| 129 | + go generate ./... |
| 130 | + |
| 131 | +# Build the BPF activity parser test program |
| 132 | +bpf-test: generate |
| 133 | + @echo "=== Building BPF activity parser test ===" |
| 134 | + @cd test/bpf && CGO_ENABLED=0 go build -o activity_parser . |
130 | 135 | @echo "BPF test built: test/bpf/activity_parser" |
131 | 136 |
|
132 | 137 | # Run test_cupti_prof and BPF activity parser in parallel. |
|
0 commit comments