Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
With llvm15, the tool 'execsnoop.py' failed the compilation with the following error messages: ... /virtual/main.c:103:157: error: expected ')' data.ppid = ({ typeof(pid_t) _val; __builtin_memset(&_val, 0, sizeof(_val)); bpf_probe_read(&_val, sizeof(_val), (void *)&({ typeof(struct task_struct btf_type_tag(rcu)*) _val; __builtin_memset(&_val, 0, sizeof(_val)); bpf_probe_read(&_val, sizeof(_val), (void *)&task->real_parent); _val; })->tgid); _val; }); ... The main reason is incorrect type string btf_type_tag(rcu) btf_type_tag is introduced in llvm15 is an attribute. The correct type representation should be __attribute__((btf_type_tag("rcu"))) The bug is fixed in llvm16 with [1]. Unfortunately the patch cannot be backported to llvm15 since at that time llvm15 has been freezed. This patch manually fixed this issue for bcc. [1] llvm/llvm-project@82b4446 Signed-off-by: Yonghong Song <[email protected]>
- Loading branch information