tracing: ring-buffer: allowlist clang-generated symbols
PATCH 1/1 tracing: ring-buffer: allowlist clang-generated symbols
From: Arnd Bergmann <[email protected]>
In randconfig build testing using clang-22, I came across two sets of extra symbols in the ring buffer code that may get inserted by the compiler:
Unexpected symbols in kernel/trace/simple_ring_buffer.o:
U memset
Unexpected symbols in kernel/trace/simple_ring_buffer.o:
U llvm_gcda_emit_arcs
U llvm_gcda_emit_function
U llvm_gcda_end_file
U llvm_gcda_start_file
U llvm_gcda_summary_info
U llvm_gcov_init
Add all of these to the allowlist.
--- kernel/trace/Makefile | 1 + 1 file changed, 1 insertion(+)
kernel/trace/Makefile +1 -0
@@ -146,6 +146,7 @@ KASAN_SANITIZE_undefsyms_base.o := y UNDEFINED_ALLOWLIST = __asan __gcov __kasan __kcsan __hwasan __sancov __sanitizer __tsan __ubsan __msan \ __aeabi_unwind_cpp __s390_indirect_jump __x86_indirect_thunk simple_ring_buffer \ + memset llvm_gcda llvm_gcov \ $(shell $(NM) -u $(obj)/undefsyms_base.o 2>/dev/null | awk '{print $$2}') quiet_cmd_check_undefined = NM $<
Signature · 1 line
2.39.5
kernel/trace/Makefile KASAN_SANITIZE_undefsyms_base.o := y
Quoted 29 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
In randconfig build testing using clang-22, I came across two sets of extra symbols in the ring buffer code that may get inserted by the compiler:
Unexpected symbols in
kernel/trace/simple_ring_buffer.o:
U memsetUnexpected symbols in
kernel/trace/simple_ring_buffer.o:
Ullvm_gcda_emit_arcs
Ullvm_gcda_emit_function
Ullvm_gcda_end_file
Ullvm_gcda_start_file
Ullvm_gcda_summary_info
Ullvm_gcov_initAdd all of these to the allowlist.
Signed-off-by Arnd Bergmann <[email protected]>--- kernel/trace/Makefile | 1 + 1 file changed, 1 insertion(+)kernel/trace/Makefile +0
-0@@ -146,6 +146,7 @@ KASAN_SANITIZE_undefsyms_base.o := y
Would "GCOV_PROFILE_undefsyms_base.o := y" work?
Quoted 10 lines
kernel/trace/Makefile +1
-0UNDEFINED_ALLOWLIST = __asan __gcov __kasan __kcsan __hwasan __sancov __sanitizer __tsan __ubsan __msan \ __aeabi_unwind_cpp __s390_indirect_jump __x86_indirect_thunk simple_ring_buffer \ + memset llvm_gcda llvm_gcov \ $(shell $(NM) -u $(obj)/undefsyms_base.o 2>/dev/null | awk '{print $$2}') quiet_cmd_check_undefined = NM $<Signature · 1 line
2.39.5
Steven Rostedt
maintainerQuoted 25 lines · On Wed, 17 Jun 2026 14:26:36 +0100 Vincent Donnefort <[email protected]>…
Quoted 24 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
In randconfig build testing using clang-22, I came across two sets of extra symbols in the ring buffer code that may get inserted by the compiler:
Unexpected symbols in
kernel/trace/simple_ring_buffer.o:
U memsetUnexpected symbols in
kernel/trace/simple_ring_buffer.o:
Ullvm_gcda_emit_arcs
Ullvm_gcda_emit_function
Ullvm_gcda_end_file
Ullvm_gcda_start_file
Ullvm_gcda_summary_info
Ullvm_gcov_initAdd all of these to the allowlist.
Signed-off-by Arnd Bergmann <[email protected]>--- kernel/trace/Makefile | 1 + 1 file changed, 1 insertion(+)
Quoted 7 lines
kernel/trace/Makefile KASAN_SANITIZE_undefsyms_base.o := y
Quoted 5 lines
kernel/trace/Makefile +0
-0@@ -146,6 +146,7 @@ KASAN_SANITIZE_undefsyms_base.o := yWould "GCOV_PROFILE_undefsyms_base.o := y" work?
Arnd?
-- Steve
Quoted 11 lines
Quoted 11 lines
kernel/trace/Makefile +1
-0UNDEFINED_ALLOWLIST = __asan __gcov __kasan __kcsan __hwasan __sancov __sanitizer __tsan __ubsan __msan \ __aeabi_unwind_cpp __s390_indirect_jump __x86_indirect_thunk simple_ring_buffer \ + memset llvm_gcda llvm_gcov \ $(shell $(NM) -u $(obj)/undefsyms_base.o 2>/dev/null | awk '{print $$2}') quiet_cmd_check_undefined = NM $<Signature · 1 line
2.39.5
Quoted 35 lines · Steven Rostedt
Quoted 25 lines · On Wed, 17 Jun 2026 14:26:36 +0100 Vincent Donnefort <[email protected]>…
Quoted 24 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
In randconfig build testing using clang-22, I came across two sets of extra symbols in the ring buffer code that may get inserted by the compiler:
Unexpected symbols in
kernel/trace/simple_ring_buffer.o:
U memsetUnexpected symbols in
kernel/trace/simple_ring_buffer.o:
Ullvm_gcda_emit_arcs
Ullvm_gcda_emit_function
Ullvm_gcda_end_file
Ullvm_gcda_start_file
Ullvm_gcda_summary_info
Ullvm_gcov_initAdd all of these to the allowlist.
Signed-off-by Arnd Bergmann <[email protected]>--- kernel/trace/Makefile | 1 + 1 file changed, 1 insertion(+)Quoted 7 lines
kernel/trace/Makefile KASAN_SANITIZE_undefsyms_base.o := y
Quoted 5 lines
kernel/trace/Makefile +0
-0@@ -146,6 +146,7 @@ KASAN_SANITIZE_undefsyms_base.o := yWould "GCOV_PROFILE_undefsyms_base.o := y" work?
Quoted 1 line
Arnd?
Yes, turning off gcov for this file should avoid the llvm_gcda and llvm_gcov symbols, but not the memset() symbol.
All the other features that leave annotations are handled by listing the symbol names (__asan __gcov __kasan __kcsan __hwasan __sancov __sanitizer __tsan __ubsan __msan), so I think for consistency it makes sense to treat llvm gcov the same way we handle gcc gcov and the rest.
Arnd
Quoted 36 lines · Arnd Bergmann
Quoted 35 lines · Steven Rostedt
Quoted 32 lines · On Wed, 17 Jun 2026 14:26:36 +0100 Vincent Donnefort <[email protected]>…
kernel/trace/Makefile KASAN_SANITIZE_undefsyms_base.o := y
Quoted 29 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
In randconfig build testing using clang-22, I came across two sets of extra symbols in the ring buffer code that may get inserted by the compiler:
Unexpected symbols in
kernel/trace/simple_ring_buffer.o:
U memsetUnexpected symbols in
kernel/trace/simple_ring_buffer.o:
Ullvm_gcda_emit_arcs
Ullvm_gcda_emit_function
Ullvm_gcda_end_file
Ullvm_gcda_start_file
Ullvm_gcda_summary_info
Ullvm_gcov_initAdd all of these to the allowlist.
Signed-off-by Arnd Bergmann <[email protected]>--- kernel/trace/Makefile | 1 + 1 file changed, 1 insertion(+)kernel/trace/Makefile +0
-0@@ -146,6 +146,7 @@ KASAN_SANITIZE_undefsyms_base.o := yWould "GCOV_PROFILE_undefsyms_base.o := y" work?
Quoted 4 lines
Quoted 1 line
Arnd?
Yes, turning off gcov for this file should avoid the
llvm_gcdaandllvm_gcovsymbols, but not thememset()symbol.
This would actually turn on GCOV for this translation unit and cause the llvm_gcda and llvm_gcov symbols to be included in UNDEFINED_ALLOWLIST via the $(NM) call.
Quoted 5 lines
All the other features that leave annotations are handled by listing the symbol names (
__asan__gcov__kasan__kcsan__hwasan__sancov__sanitizer__tsan__ubsan__msan), so I think for consistency it makes sense to treat llvm gcov the same way we handle gcc gcov and the rest.
I do tend to agree with this though, as opposed to using GCOV_PROFILE_... or ..._SANTIZE variables.
Signature · 2 lines
Cheers, Nathan