commit | 583a6c76b9498ea08948aeb9558a492b470dfa0f | [log] [tgz] |
---|---|---|
author | Carlos Llamas <[email protected]> | Fri Sep 29 03:48:17 2023 +0000 |
committer | Greg Kroah-Hartman <[email protected]> | Fri Feb 23 08:42:31 2024 +0100 |
tree | 776e318b5670916081b2513988cc197c2275761f | |
parent | 0f906882eba54874fdbd69eaa946efbf3e045a22 [diff] |
scripts/decode_stacktrace.sh: optionally use LLVM utilities [ Upstream commit efbd6398353315b7018e6943e41fee9ec35e875f ] GNU's addr2line can have problems parsing a vmlinux built with LLVM, particularly when LTO was used. In order to decode the traces correctly this patch adds the ability to switch to LLVM's utilities readelf and addr2line. The same approach is followed by Will in [1]. Before: $ scripts/decode_stacktrace.sh vmlinux < kernel.log [17716.240635] Call trace: [17716.240646] skb_cow_data (??:?) [17716.240654] esp6_input (ld-temp.o:?) [17716.240666] xfrm_input (ld-temp.o:?) [17716.240674] xfrm6_rcv (??:?) [...] After: $ LLVM=1 scripts/decode_stacktrace.sh vmlinux < kernel.log [17716.240635] Call trace: [17716.240646] skb_cow_data (include/linux/skbuff.h:2172 net/core/skbuff.c:4503) [17716.240654] esp6_input (net/ipv6/esp6.c:977) [17716.240666] xfrm_input (net/xfrm/xfrm_input.c:659) [17716.240674] xfrm6_rcv (net/ipv6/xfrm6_input.c:172) [...] Note that one could set CROSS_COMPILE=llvm- instead to hack around this issue. However, doing so can break the decodecode routine as it will force the selection of other LLVM utilities down the line e.g. llvm-as. [1] https://lore.kernel.org/all/[email protected]/ Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Carlos Llamas <[email protected]> Reviewed-by: Nick Desaulniers <[email protected]> Reviewed-by: Elliot Berman <[email protected]> Tested-by: Justin Stitt <[email protected]> Cc: Will Deacon <[email protected]> Cc: John Stultz <[email protected]> Cc: Masahiro Yamada <[email protected]> Cc: Nathan Chancellor <[email protected]> Cc: Tom Rix <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Sasha Levin <[email protected]>