Patch "scripts: decode_stacktrace: demangle Rust symbols" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    scripts: decode_stacktrace: demangle Rust symbols

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     scripts-decode_stacktrace-demangle-rust-symbols.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 701fdb2fff3ddaf22147d8d0b2032d4b8322efcf
Author: Miguel Ojeda <ojeda@xxxxxxxxxx>
Date:   Sun Dec 5 19:00:43 2021 +0100

    scripts: decode_stacktrace: demangle Rust symbols
    
    [ Upstream commit 99115db4ecc87af73415939439ec604ea0531e6f ]
    
    Recent versions of both Binutils (`c++filt`) and LLVM (`llvm-cxxfilt`)
    provide Rust v0 mangling support.
    
    Reviewed-by: Kees Cook <keescook@xxxxxxxxxxxx>
    Reviewed-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
    Co-developed-by: Alex Gaynor <alex.gaynor@xxxxxxxxx>
    Signed-off-by: Alex Gaynor <alex.gaynor@xxxxxxxxx>
    Co-developed-by: Wedson Almeida Filho <wedsonaf@xxxxxxxxxx>
    Signed-off-by: Wedson Almeida Filho <wedsonaf@xxxxxxxxxx>
    Signed-off-by: Miguel Ojeda <ojeda@xxxxxxxxxx>
    Stable-dep-of: efbd63983533 ("scripts/decode_stacktrace.sh: optionally use LLVM utilities")
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/scripts/decode_stacktrace.sh b/scripts/decode_stacktrace.sh
index 7075e26ab2c4..564c5632e1a2 100755
--- a/scripts/decode_stacktrace.sh
+++ b/scripts/decode_stacktrace.sh
@@ -8,6 +8,14 @@ usage() {
 	echo "	$0 -r <release> | <vmlinux> [<base path>|auto] [<modules path>]"
 }
 
+# Try to find a Rust demangler
+if type llvm-cxxfilt >/dev/null 2>&1 ; then
+	cppfilt=llvm-cxxfilt
+elif type c++filt >/dev/null 2>&1 ; then
+	cppfilt=c++filt
+	cppfilt_opts=-i
+fi
+
 if [[ $1 == "-r" ]] ; then
 	vmlinux=""
 	basepath="auto"
@@ -180,6 +188,12 @@ parse_symbol() {
 	# In the case of inlines, move everything to same line
 	code=${code//$'\n'/' '}
 
+	# Demangle if the name looks like a Rust symbol and if
+	# we got a Rust demangler
+	if [[ $name =~ ^_R && $cppfilt != "" ]] ; then
+		name=$("$cppfilt" "$cppfilt_opts" "$name")
+	fi
+
 	# Replace old address with pretty line numbers
 	symbol="$segment$name ($code)"
 }




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux