Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6963612rdb; Fri, 15 Dec 2023 13:19:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IEAOWALMnuZ3xLpUrbpYIil9dq7AOYgoTu+zJs6QQJLsPb3a3IzDorapXbOpiVpoKyyQzAB X-Received: by 2002:a05:651c:2126:b0:2cb:2f37:6f5a with SMTP id a38-20020a05651c212600b002cb2f376f5amr6012600ljq.9.1702675182333; Fri, 15 Dec 2023 13:19:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702675182; cv=none; d=google.com; s=arc-20160816; b=F2gfI1kP95vBLeaWTvFPaA/AolkEfrS3uWrcL6CeZK00AMDqcu8qT91q/ymEQIth/z iGwnH8id+t1R8aVNnf8YILibR/FzQDMAvRfiPk4E2yDdZ5PSSkvSC4aATRkY0wawwzHi lJ7O6wUyXQnn1PWzXnXq20zUSTIDUU3UcpjYG+q4WQcoA3TV+1aZZCMYRFI/C0gStdwX ZDviid+Os7WP9ZvLB7qbmfngfNE63zw8/Y81FB8F/lwRBAsNgJZz1bp2GLRs4qmZn7iJ 0zrN2vlULepheC6UUIaO+Zal8or97ub0AHxZuLqxa4iKw6DfQOyBilzom3p3AgoZNSEg lIcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=8mxcQ8U3h2VEOqJmIa1ew38QPU2ZNWsAXvnsDdFpYNk=; fh=71ALR9s8+Ows7Ujk8hrzBCL12sfLfCB13NaLDnXyYvs=; b=lkbs4iQANmtNCJ6WBbwAlTr5EpaW9py9E8O+GIARMpVyTtGEDHFw+zKzI0GDx0Ld+Y /0tcsIZYEDXLAJwUMd4aDmTNxLu63QMCtd7/Nfkabf4h1JIq1jzW1pd4/F3WHNpCq2Aj h9DdPAn1rDO7Nnixp1OIUTy97xvKX6IQE0ABwE94FrTz9v/85gXUXB9+pTA1dOfOmqDV GMCJs8shEJNUtXFGQd0Wk4wM37JDNY7DNvFfgw45TR10eRgaX5Wl7gRZtF/NQyqkXuag 2vXx3z1G3Y8CfTEt/Adi6H5tdUZMXR8dXcY3+8U2Wnghjy2QAquSZzVt2LTvXtw+tlVm 9aYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=z2C9fwrQ; spf=pass (google.com: domain of linux-kernel+bounces-1667-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1667-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id n9-20020a5099c9000000b005529d3279fdsi1087324edb.683.2023.12.15.13.19.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 13:19:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1667-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=z2C9fwrQ; spf=pass (google.com: domain of linux-kernel+bounces-1667-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1667-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D8E011F2673A for ; Fri, 15 Dec 2023 21:19:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5864B47F77; Fri, 15 Dec 2023 21:19:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="z2C9fwrQ" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1AF9947F5E for ; Fri, 15 Dec 2023 21:19:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-552d4483414so1120071a12.2 for ; Fri, 15 Dec 2023 13:19:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1702675170; x=1703279970; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=8mxcQ8U3h2VEOqJmIa1ew38QPU2ZNWsAXvnsDdFpYNk=; b=z2C9fwrQBa1wtnJDsS2VfZ2PbcIs8oda73n+Uy3iZ4rOsviIusfkrkpCasr16iZ08B Cpl5ccUeour+h/IVL6TN3c3RaHflJaHLKYk5O6gsxNwNzyLYogKWbYys5zBh8czUp4iX ZQfjW6o4ZfqAHNm8tniwoL/tcXkf/OirkqItMM7D7FTMjq5GISnH/TO1EMoSrS9tWxNJ IvbfqTfhYnubk8a4B8o/YXrbu4mbxYCFWY16UckqEPlAna6bqSqlU+iHP0zIgJ9qJcMg GtVzasmeLgiwlJF/EFWfZsMaW9xuSIYK5c3AE8A617KtuP5WQJe19gFsFx5kg4vK/FTV IBLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702675170; x=1703279970; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8mxcQ8U3h2VEOqJmIa1ew38QPU2ZNWsAXvnsDdFpYNk=; b=RCQbzqkhZSoG2nfFLTOEt4VfipUPBEBdlqquOB4Lfb0duFGCIl0prHxJhmVckya61/ 0gqG85BpKwnQD0cUYQt9Y8BacRRwJTqDDK1Hz51pSo0s1sS7Vk5CEdPhjWY10VCNDe/B 7gMjgTwJ8uvpr1HZm3ltBWcneQwl2+1qXTB+4MA5TYs4ocRW4+w7/88yrENnZJfsJAoH FpDCFw2iVjktCBILgx8aKU1MwG3sPZyFwLv0tq4tv1y+QNjrcHHXo5FFk7BqtOKiKXMk XpIHU+pE9J63bBpz1ykAeL+Tbg6E/0FExjjFP0rsa4Imm1IPL0irmVc6otDf2lP+GXXx ahBg== X-Gm-Message-State: AOJu0YzZodsodFnslEiek7YygKhAVjXqGExgMTe4VRXsrqTDch0aEYl+ lA5J/HWptInMPB1L2vSp6alsZ1nZysREkhxP9AA7rw== X-Received: by 2002:a50:8d50:0:b0:552:e8c3:95a7 with SMTP id t16-20020a508d50000000b00552e8c395a7mr409698edt.27.1702675170229; Fri, 15 Dec 2023 13:19:30 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231215-llvm-decode-stacktrace-v1-1-201cb86f4879@quicinc.com> In-Reply-To: <20231215-llvm-decode-stacktrace-v1-1-201cb86f4879@quicinc.com> From: Justin Stitt Date: Fri, 15 Dec 2023 13:19:18 -0800 Message-ID: Subject: Re: [PATCH] scripts/decode_stacktrace.sh: Use LLVM environment variable To: Elliot Berman Cc: Nathan Chancellor , Nick Desaulniers , Bill Wendling , Manuel Traut , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, On Fri, Dec 15, 2023 at 10:27=E2=80=AFAM Elliot Berman wrote: > > When using LLVM as the compiler, decode_stacktrace should also use > llvm-addr2line. Check if LLVM is set and add the appropriate > suffix/prefix. > > Signed-off-by: Elliot Berman > --- I tried it out by dropping a random dump_stack() call into the init phase of the kernel and redirecting the serial console output to a log file. Using the pre-(this patch) and post-(this patch) script yields good stack trace results. It seems llvm-addr2line is a drop-in replacement. Tested-by: Justin Stitt > scripts/decode_stacktrace.sh | 12 +++++++++++- > 1 file changed, 11 insertions(+), 1 deletion(-) > > diff --git a/scripts/decode_stacktrace.sh b/scripts/decode_stacktrace.sh > index 564c5632e1a2..189b00f4e120 100755 > --- a/scripts/decode_stacktrace.sh > +++ b/scripts/decode_stacktrace.sh > @@ -16,6 +16,16 @@ elif type c++filt >/dev/null 2>&1 ; then > cppfilt_opts=3D-i > fi > > +if [[ "${LLVM}" =3D=3D "1" ]] ; then > + addr2line=3D"llvm-addr2line" > +elif [[ "${LLVM}" =3D=3D */ ]] ; then > + addr2line=3D"${LLVM}llvm-addr2line" > +elif [[ "${LLVM}" =3D=3D -* ]] ; then > + addr2line=3D"llvm-addr2line${LLVM}" > +else > + addr2line=3D"${CROSS_COMPILE}addr2line" > +fi > + > if [[ $1 =3D=3D "-r" ]] ; then > vmlinux=3D"" > basepath=3D"auto" > @@ -169,7 +179,7 @@ parse_symbol() { > if [[ $aarray_support =3D=3D true && "${cache[$module,$address]+i= sset}" =3D=3D "isset" ]]; then > local code=3D${cache[$module,$address]} > else > - local code=3D$(${CROSS_COMPILE}addr2line -i -e "$objfile"= "$address" 2>/dev/null) > + local code=3D$(${addr2line} -i -e "$objfile" "$address" 2= >/dev/null) > if [[ $aarray_support =3D=3D true ]]; then > cache[$module,$address]=3D$code > fi > > --- > base-commit: 3f7168591ebf7bbdb91797d02b1afaf00a4289b1 > change-id: 20231214-llvm-decode-stacktrace-09538979006d > > Best regards, > -- > Elliot Berman > Thanks Justin