From: Xiu Jianfeng <xiujianfeng(a)huawei.com>
When compiling the cgroup selftests with the following command:
make -C tools/testing/selftests/cgroup/
the compiler complains as below:
test_cpu.c: In function ‘test_cpucg_nice’:
test_cpu.c:284:39: error: incompatible type for argument 2 of ‘hog_cpus_timed’
284 | hog_cpus_timed(cpucg, param);
| ^~~~~
| |
| struct cpu_hog_func_param
test_cpu.c:132:53: note: expected ‘void *’ but argument is of type ‘struct cpu_hog_func_param’
132 | static int hog_cpus_timed(const char *cgroup, void *arg)
| ~~~~~~^~~
Fix it by passing the address of param to hog_cpus_timed().
Fixes: 2e82c0d4562a ("cgroup/rstat: Selftests for niced CPU statistics")
Signed-off-by: Xiu Jianfeng <xiujianfeng(a)huawei.com>
---
tools/testing/selftests/cgroup/test_cpu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/cgroup/test_cpu.c b/tools/testing/selftests/cgroup/test_cpu.c
index 201ce14cb422..a2b50af8e9ee 100644
--- a/tools/testing/selftests/cgroup/test_cpu.c
+++ b/tools/testing/selftests/cgroup/test_cpu.c
@@ -281,7 +281,7 @@ static int test_cpucg_nice(const char *root)
/* Try to keep niced CPU usage as constrained to hog_cpu as possible */
nice(1);
- hog_cpus_timed(cpucg, param);
+ hog_cpus_timed(cpucg, ¶m);
exit(0);
} else {
waitpid(pid, &status, 0);
--
2.34.1
Hello all,
This patch series offers improvements to the way .BTF_ids section data is
created and later patched by resolve_btfids.
Patch #1 simplifies the byte-order translation in resolve_btfids while
making it more resilient to future .BTF_ids encoding updates.
Patch #2 makes sure all BTF ID data is 4-byte aligned, and not only the
.BTF_ids used for vmlinux.
Patch #3 syncs the above changes in btf_ids.h to tools/include, obviating
a previous alignment fix in selftests/bpf.
Feedback and suggestions are welcome!
Best regards,
Tony
Tony Ambardar (3):
tools/resolve_btfids: Simplify handling cross-endian compilation
bpf: btf: Ensure natural alignment of .BTF_ids section
tools/bpf, selftests/bpf : Sync btf_ids.h to tools
include/linux/btf_ids.h | 1 +
tools/bpf/resolve_btfids/main.c | 60 +++++---------
tools/include/linux/btf_ids.h | 80 +++++++++++++++++--
.../selftests/bpf/prog_tests/resolve_btfids.c | 6 --
4 files changed, 97 insertions(+), 50 deletions(-)
--
2.34.1