Skip to content

Commit 9d1f159

Browse files
rgushchindavem330
authored andcommitted
bpf: move cgroup_helpers from samples/bpf/ to tools/testing/selftesting/bpf/
The purpose of this move is to use these files in bpf tests. Signed-off-by: Roman Gushchin <[email protected]> Acked-by: Alexei Starovoitov <[email protected]> Acked-by: Tejun Heo <[email protected]> Cc: Daniel Borkmann <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ebc614f commit 9d1f159

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

samples/bpf/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ hostprogs-y += syscall_tp
4646

4747
# Libbpf dependencies
4848
LIBBPF := ../../tools/lib/bpf/bpf.o
49+
CGROUP_HELPERS := ../../tools/testing/selftests/bpf/cgroup_helpers.o
4950

5051
test_lru_dist-objs := test_lru_dist.o $(LIBBPF)
5152
sock_example-objs := sock_example.o $(LIBBPF)
@@ -69,13 +70,13 @@ map_perf_test-objs := bpf_load.o $(LIBBPF) map_perf_test_user.o
6970
test_overhead-objs := bpf_load.o $(LIBBPF) test_overhead_user.o
7071
test_cgrp2_array_pin-objs := $(LIBBPF) test_cgrp2_array_pin.o
7172
test_cgrp2_attach-objs := $(LIBBPF) test_cgrp2_attach.o
72-
test_cgrp2_attach2-objs := $(LIBBPF) test_cgrp2_attach2.o cgroup_helpers.o
73+
test_cgrp2_attach2-objs := $(LIBBPF) test_cgrp2_attach2.o $(CGROUP_HELPERS)
7374
test_cgrp2_sock-objs := $(LIBBPF) test_cgrp2_sock.o
7475
test_cgrp2_sock2-objs := bpf_load.o $(LIBBPF) test_cgrp2_sock2.o
7576
xdp1-objs := bpf_load.o $(LIBBPF) xdp1_user.o
7677
# reuse xdp1 source intentionally
7778
xdp2-objs := bpf_load.o $(LIBBPF) xdp1_user.o
78-
test_current_task_under_cgroup-objs := bpf_load.o $(LIBBPF) cgroup_helpers.o \
79+
test_current_task_under_cgroup-objs := bpf_load.o $(LIBBPF) $(CGROUP_HELPERS) \
7980
test_current_task_under_cgroup_user.o
8081
trace_event-objs := bpf_load.o $(LIBBPF) trace_event_user.o
8182
sampleip-objs := bpf_load.o $(LIBBPF) sampleip_user.o

tools/testing/selftests/bpf/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ TEST_PROGS := test_kmod.sh test_xdp_redirect.sh test_xdp_meta.sh
2323

2424
include ../lib.mk
2525

26-
BPFOBJ := $(OUTPUT)/libbpf.a
26+
BPFOBJ := $(OUTPUT)/libbpf.a $(OUTPUT)/cgroup_helpers.c
2727

2828
$(TEST_GEN_PROGS): $(BPFOBJ)
2929

0 commit comments

Comments
 (0)