File tree Expand file tree Collapse file tree 4 files changed +33
-13
lines changed
tools/testing/selftests/cgroup Expand file tree Collapse file tree 4 files changed +33
-13
lines changed Original file line number Diff line number Diff line change @@ -21,14 +21,15 @@ TEST_GEN_PROGS += test_zswap
21
21
LOCAL_HDRS += $(selfdir ) /clone3/clone3_selftests.h $(selfdir ) /pidfd/pidfd.h
22
22
23
23
include ../lib.mk
24
+ include lib/libcgroup.mk
24
25
25
- $(OUTPUT ) /test_core : cgroup_util.c
26
- $(OUTPUT ) /test_cpu : cgroup_util.c
27
- $(OUTPUT ) /test_cpuset : cgroup_util.c
28
- $(OUTPUT ) /test_freezer : cgroup_util.c
29
- $(OUTPUT ) /test_hugetlb_memcg : cgroup_util.c
30
- $(OUTPUT ) /test_kill : cgroup_util.c
31
- $(OUTPUT ) /test_kmem : cgroup_util.c
32
- $(OUTPUT ) /test_memcontrol : cgroup_util.c
33
- $(OUTPUT ) /test_pids : cgroup_util.c
34
- $(OUTPUT ) /test_zswap : cgroup_util.c
26
+ $(OUTPUT ) /test_core : $( LIBCGROUP_O )
27
+ $(OUTPUT ) /test_cpu : $( LIBCGROUP_O )
28
+ $(OUTPUT ) /test_cpuset : $( LIBCGROUP_O )
29
+ $(OUTPUT ) /test_freezer : $( LIBCGROUP_O )
30
+ $(OUTPUT ) /test_hugetlb_memcg : $( LIBCGROUP_O )
31
+ $(OUTPUT ) /test_kill : $( LIBCGROUP_O )
32
+ $(OUTPUT ) /test_kmem : $( LIBCGROUP_O )
33
+ $(OUTPUT ) /test_memcontrol : $( LIBCGROUP_O )
34
+ $(OUTPUT ) /test_pids : $( LIBCGROUP_O )
35
+ $(OUTPUT ) /test_zswap : $( LIBCGROUP_O )
Original file line number Diff line number Diff line change 17
17
#include <unistd.h>
18
18
19
19
#include "cgroup_util.h"
20
- #include "../clone3/clone3_selftests.h"
20
+ #include "../../ clone3/clone3_selftests.h"
21
21
22
22
/* Returns read len on success, or -errno on failure. */
23
23
ssize_t read_text (const char * path , char * buf , size_t max_len )
Original file line number Diff line number Diff line change 2
2
#include <stdbool.h>
3
3
#include <stdlib.h>
4
4
5
- #include "../kselftest.h"
6
-
5
+ #ifndef PAGE_SIZE
7
6
#define PAGE_SIZE 4096
7
+ #endif
8
8
9
9
#define MB (x ) (x << 20)
10
10
Original file line number Diff line number Diff line change
1
+ CGROUP_DIR := $(selfdir ) /cgroup
2
+
3
+ LIBCGROUP_C := lib/cgroup_util.c
4
+
5
+ LIBCGROUP_O := $(patsubst % .c, $(OUTPUT ) /% .o, $(LIBCGROUP_C ) )
6
+
7
+ LIBCGROUP_O_DIRS := $(shell dirname $(LIBCGROUP_O ) | uniq)
8
+
9
+ CFLAGS += -I$(CGROUP_DIR ) /lib/include
10
+
11
+ EXTRA_HDRS := $(selfdir ) /clone3/clone3_selftests.h
12
+
13
+ $(LIBCGROUP_O_DIRS ) :
14
+ mkdir -p $@
15
+
16
+ $(LIBCGROUP_O ) : $(OUTPUT ) /% .o : $(CGROUP_DIR ) /% .c $(EXTRA_HDRS ) $(LIBCGROUP_O_DIRS )
17
+ $(CC ) $(CFLAGS ) $(CPPFLAGS ) $(TARGET_ARCH ) -c $< -o $@
18
+
19
+ EXTRA_CLEAN += $(LIBCGROUP_O )
You can’t perform that action at this time.
0 commit comments