[缺陷描述]: bcc测试集新增test_clang.py失败,内核5.10.134-1029.git.3513726cd139.al8.x86_64成是成功的,内核5.10.134-1033.git.3090e0acdbe6.al8.x86_64失败; 软件版本: # rpm -qa |grep bcc bcc-0.19.0-5.0.2.al8.x86_64 python3-bcc-0.19.0-5.0.2.al8.x86_64 bcc-devel-0.19.0-5.0.2.al8.x86_64 bcc-tools-0.19.0-5.0.2.al8.x86_64 # rpm -qa |grep bcc-tools bcc-tools-0.19.0-5.0.2.al8.x86_64 失败部分日志如下: include/linux/compiler-clang.h:52:9: warning: '__HAVE_BUILTIN_BSWAP64__' macro redefined [-Wmacro-redefined] #define __HAVE_BUILTIN_BSWAP64__ ^ <command line>:5:9: note: previous definition is here #define __HAVE_BUILTIN_BSWAP64__ 1 ^ In file included from <built-in>:2: In file included from /virtual/include/bcc/bpf.h:12: In file included from include/linux/types.h:6: In file included from include/uapi/linux/types.h:14: In file included from include/uapi/linux/posix_types.h:5: In file included from include/linux/stddef.h:5: In file included from include/uapi/linux/stddef.h:2: In file included from include/linux/compiler_types.h:69: include/linux/compiler-clang.h:53:9: warning: '__HAVE_BUILTIN_BSWAP16__' macro redefined [-Wmacro-redefined] #define __HAVE_BUILTIN_BSWAP16__ ^ <command line>:3:9: note: previous definition is here #define __HAVE_BUILTIN_BSWAP16__ 1 ^ 3 warnings generated. /usr/lib/python3.6/site-packages/bcc/__init__.py:505: DeprecationWarning: not a bytes object: 'act' name = _assert_is_bytes(name) . ====================================================================== ERROR: test_ext_ptr_maps1 (__main__.TestClang) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_clang.py", line 726, in test_ext_ptr_maps1 b = BPF(text=bpf_text) File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 365, in __init__ raise Exception("Failed to compile BPF module %s" % (src_file or "<text>")) Exception: Failed to compile BPF module <text> ====================================================================== ERROR: test_ext_ptr_maps2 (__main__.TestClang) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_clang.py", line 755, in test_ext_ptr_maps2 b = BPF(text=bpf_text) File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 365, in __init__ raise Exception("Failed to compile BPF module %s" % (src_file or "<text>")) Exception: Failed to compile BPF module <text> ====================================================================== ERROR: test_ext_ptr_maps_indirect (__main__.TestClang) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_clang.py", line 814, in test_ext_ptr_maps_indirect b = BPF(text=bpf_text) File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 365, in __init__ raise Exception("Failed to compile BPF module %s" % (src_file or "<text>")) Exception: Failed to compile BPF module <text> ====================================================================== ERROR: test_ext_ptr_maps_reverse (__main__.TestClang) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_clang.py", line 784, in test_ext_ptr_maps_reverse b = BPF(text=bpf_text) File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 365, in __init__ raise Exception("Failed to compile BPF module %s" % (src_file or "<text>")) Exception: Failed to compile BPF module <text> ====================================================================== ERROR: test_no_probe_read_addrof (__main__.TestClang) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_clang.py", line 1162, in test_no_probe_read_addrof b = BPF(text=text) File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 365, in __init__ raise Exception("Failed to compile BPF module %s" % (src_file or "<text>")) Exception: Failed to compile BPF module <text> ====================================================================== ERROR: test_paren_probe_read (__main__.TestClang) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_clang.py", line 599, in test_paren_probe_read b = BPF(text=text) File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 365, in __init__ raise Exception("Failed to compile BPF module %s" % (src_file or "<text>")) Exception: Failed to compile BPF module <text> ====================================================================== ERROR: test_probe_member_expr (__main__.TestClang) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_clang.py", line 463, in test_probe_member_expr }""") File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 365, in __init__ raise Exception("Failed to compile BPF module %s" % (src_file or "<text>")) Exception: Failed to compile BPF module <text> ====================================================================== ERROR: test_probe_member_expr_deref (__main__.TestClang) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_clang.py", line 450, in test_probe_member_expr_deref }""") File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 365, in __init__ raise Exception("Failed to compile BPF module %s" % (src_file or "<text>")) Exception: Failed to compile BPF module <text> ====================================================================== ERROR: test_probe_read3 (__main__.TestClang) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_clang.py", line 87, in test_probe_read3 b = BPF(text=text) File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 365, in __init__ raise Exception("Failed to compile BPF module %s" % (src_file or "<text>")) Exception: Failed to compile BPF module <text> ====================================================================== ERROR: test_probe_read4 (__main__.TestClang) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_clang.py", line 98, in test_probe_read4 b = BPF(text=text) File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 365, in __init__ raise Exception("Failed to compile BPF module %s" % (src_file or "<text>")) Exception: Failed to compile BPF module <text> ====================================================================== ERROR: test_probe_read_array_accesses7 (__main__.TestClang) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_clang.py", line 1238, in test_probe_read_array_accesses7 b = BPF(text=text) File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 365, in __init__ raise Exception("Failed to compile BPF module %s" % (src_file or "<text>")) Exception: Failed to compile BPF module <text> ====================================================================== ERROR: test_probe_read_ctx_array (__main__.TestClang) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_clang.py", line 1061, in test_probe_read_ctx_array b = BPF(text=text) File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 365, in __init__ raise Exception("Failed to compile BPF module %s" % (src_file or "<text>")) Exception: Failed to compile BPF module <text> ====================================================================== ERROR: test_probe_read_kprobe_ctx (__main__.TestClang) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_clang.py", line 1049, in test_probe_read_kprobe_ctx b = BPF(text=text) File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 365, in __init__ raise Exception("Failed to compile BPF module %s" % (src_file or "<text>")) Exception: Failed to compile BPF module <text> ====================================================================== ERROR: test_probe_read_multiple_return (__main__.TestClang) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_clang.py", line 1115, in test_probe_read_multiple_return b = BPF(text=text) File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 365, in __init__ raise Exception("Failed to compile BPF module %s" % (src_file or "<text>")) Exception: Failed to compile BPF module <text> ====================================================================== ERROR: test_probe_read_nested_deref (__main__.TestClang) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_clang.py", line 490, in test_probe_read_nested_deref b = BPF(text=text) File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 365, in __init__ raise Exception("Failed to compile BPF module %s" % (src_file or "<text>")) Exception: Failed to compile BPF module <text> ====================================================================== ERROR: test_probe_read_nested_deref2 (__main__.TestClang) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_clang.py", line 505, in test_probe_read_nested_deref2 b = BPF(text=text) File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 365, in __init__ raise Exception("Failed to compile BPF module %s" % (src_file or "<text>")) Exception: Failed to compile BPF module <text> ====================================================================== ERROR: test_probe_read_nested_deref3 (__main__.TestClang) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_clang.py", line 517, in test_probe_read_nested_deref3 b = BPF(text=text) File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 365, in __init__ raise Exception("Failed to compile BPF module %s" % (src_file or "<text>")) Exception: Failed to compile BPF module <text> ====================================================================== ERROR: test_probe_read_nested_deref_func1 (__main__.TestClang) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_clang.py", line 532, in test_probe_read_nested_deref_func1 b = BPF(text=text) File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 365, in __init__ raise Exception("Failed to compile BPF module %s" % (src_file or "<text>")) Exception: Failed to compile BPF module <text> ====================================================================== ERROR: test_probe_read_nested_deref_func2 (__main__.TestClang) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_clang.py", line 550, in test_probe_read_nested_deref_func2 b = BPF(text=text) File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 365, in __init__ raise Exception("Failed to compile BPF module %s" % (src_file or "<text>")) Exception: Failed to compile BPF module <text> ====================================================================== ERROR: test_probe_read_nested_member1 (__main__.TestClang) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_clang.py", line 561, in test_probe_read_nested_member1 b = BPF(text=text) File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 365, in __init__ raise Exception("Failed to compile BPF module %s" % (src_file or "<text>")) Exception: Failed to compile BPF module <text> ====================================================================== ERROR: test_probe_read_return (__main__.TestClang) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_clang.py", line 1095, in test_probe_read_return b = BPF(text=text) File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 365, in __init__ raise Exception("Failed to compile BPF module %s" % (src_file or "<text>")) Exception: Failed to compile BPF module <text> ====================================================================== ERROR: test_probe_read_return_call (__main__.TestClang) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_clang.py", line 1144, in test_probe_read_return_call b = BPF(text=text) File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 365, in __init__ raise Exception("Failed to compile BPF module %s" % (src_file or "<text>")) Exception: Failed to compile BPF module <text> ====================================================================== ERROR: test_probe_read_return_expr (__main__.TestClang) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_clang.py", line 1130, in test_probe_read_return_expr b = BPF(text=text) File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 365, in __init__ raise Exception("Failed to compile BPF module %s" % (src_file or "<text>")) Exception: Failed to compile BPF module <text> ====================================================================== ERROR: test_probe_read_tracepoint_context (__main__.TestClang) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_clang.py", line 1037, in test_probe_read_tracepoint_context b = BPF(text=text) File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 365, in __init__ raise Exception("Failed to compile BPF module %s" % (src_file or "<text>")) Exception: Failed to compile BPF module <text> ====================================================================== ERROR: test_probe_read_whitelist1 (__main__.TestClang) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_clang.py", line 115, in test_probe_read_whitelist1 b = BPF(text=text) File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 365, in __init__ raise Exception("Failed to compile BPF module %s" % (src_file or "<text>")) Exception: Failed to compile BPF module <text> ====================================================================== ERROR: test_probe_read_whitelist2 (__main__.TestClang) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_clang.py", line 132, in test_probe_read_whitelist2 b = BPF(text=text) File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 365, in __init__ raise Exception("Failed to compile BPF module %s" % (src_file or "<text>")) Exception: Failed to compile BPF module <text> ====================================================================== ERROR: test_probe_simple_member_assign (__main__.TestClang) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_clang.py", line 437, in test_probe_simple_member_assign }""") File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 365, in __init__ raise Exception("Failed to compile BPF module %s" % (src_file or "<text>")) Exception: Failed to compile BPF module <text> ---------------------------------------------------------------------- Ran 83 tests in 70.079s FAILED (errors=27) [复现概率]: 必现 [复现环境]: 机器:线下vm 内核: 5.10.134-1033.git.3090e0acdbe6.al8.x86_64 [复现步骤]: git clone -q http://gitlab-sp.alibaba-inc.com/baseos/bcc.git bcc 解压缩 tar -zxvf xxx ls *.patch cd bcc patch -p1 < ../*.patch (逐一打上patch) chmod +x tools/*.py yum -y install bcc-tools cd tests/python python test_clang.py [预期结果]: 用例执行成功 [实际结果]: 用例执行失败