Received: by 2002:a05:7412:8598:b0:f9:33c2:5753 with SMTP id n24csp212433rdh; Mon, 18 Dec 2023 17:17:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IGY3s9kLXqVxhbIkPXHo87icBro8n7fEFo0Wf/bHuKLVIdk8O7PhQNZn3ibtGP2sI+3lKKZ X-Received: by 2002:a2e:8547:0:b0:2cc:6f11:1f8f with SMTP id u7-20020a2e8547000000b002cc6f111f8fmr1466270ljj.38.1702948621487; Mon, 18 Dec 2023 17:17:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702948621; cv=none; d=google.com; s=arc-20160816; b=D3A0NAQ2jLAivo9kXZiORalvfLJvmyoZb5gbLByzwd6W7/qvhXS2EK7OA8S9/sXzas BEsSx5qIt+KV3LZiIBtHMHOo1VD+CGxoWHt5IN+9fWdDh+AjdgkvKj73PFSgx5TVyl7S QdoroAoCa56fKw/IDEp20pz4coBS9uaaAFS94UDiDz250xjGy/JCy/Th8Meb3Db5r8l4 FEON3rM9y43ePhFC58kg770PbgMzHrFoPMzrBwzFTKeJg9vfSBGYT3Voz2iVvvJ+cffP ZS9Gyryan4QbG3pUl1Ea/uSQz/eu7Am2mTwpLr80GbQ44HroQNAmj/8P+CR5IrYTMFmk 7PQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=9/NXaF2lkQkA4iaZhFz9EGGgGx4EqVeSe9KT2hTARxc=; fh=8zoz38pdyiHOpb9p9Mh/Ns2cODWFi5l9f+ZaEVh/f4Y=; b=BISP1kY8cqmM+7OsQxFMvWwPyRfmGhkrWFLmbAlaNu7xRhLwUOFvomz3smgFe3PrPl Zs1dQR1W6vAjzlkhCEqyb/Q2m/f9+/6twnhgSPvM32H58CtHidLrsOE8dLuU1dMEFZVI LdlmjC70jnlU0AllBeP3MhDfFPlCCzHnEJwhBSwWzl12cKu09jVWL+T1H8v2XmQe5zNc Y44hNz46iFUtN8IbNNlaGySgcqTPm9ETuEn4x8VCZX9UiDgSTRZSeh9us4/OLy6fziLS H7N88mmf90/yPWnT4AIRamGhWQRHyJkUDxu74nd4otMXfGtQaCBKzjZTdqfh/9L8yJV6 sQtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="OT/EOIYv"; spf=pass (google.com: domain of linux-kernel+bounces-4550-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4550-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. [147.75.80.249]) by mx.google.com with ESMTPS id h5-20020a056402280500b0054c51202201si10461793ede.497.2023.12.18.17.17.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 17:17:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4550-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="OT/EOIYv"; spf=pass (google.com: domain of linux-kernel+bounces-4550-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4550-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 361D21F23FE6 for ; Tue, 19 Dec 2023 01:17:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B459D137C; Tue, 19 Dec 2023 01:16:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="OT/EOIYv" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) (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 A1EB910E6 for ; Tue, 19 Dec 2023 01:16:52 +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-pf1-f171.google.com with SMTP id d2e1a72fcca58-6d9344f30caso80924b3a.1 for ; Mon, 18 Dec 2023 17:16:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1702948612; x=1703553412; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=9/NXaF2lkQkA4iaZhFz9EGGgGx4EqVeSe9KT2hTARxc=; b=OT/EOIYvFJ4OJKFxIbgkimMCqyijyFqYrby8rOA++jE3GWJARb1+bab28IGC2lnBgB bn6zAEGAY7PmvDYyaCp8nbebuLX/xNJo9Gaz/9cmElIXblk1PdT6jiRjCN4STjE84jCo Hh8JVpwfKlhSrLuqr6BxxU6NTLfOejvs0O14tg11SGt64sB+HsrHUzOyQ6RCRRWt85K2 9gncoLZLnObp9ypVOCfMQgcJUarQslhm5DhNQHZTZcUIVJwl1G5B3ezw1elU/lYhpgjj ybRmDa9D/89EWjrwSCSVO5onGYGWzIzEXWwrHyxVHszTcggxneG9gJ6lYMGYmKjb1WWg k6jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702948612; x=1703553412; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=9/NXaF2lkQkA4iaZhFz9EGGgGx4EqVeSe9KT2hTARxc=; b=KTR3XfDX3K8F1UmVYQxgs4BQt3135wnQT6za+SSuBAbP8mF1UdqmQ2oJvFUatFPXUo th4PXtxJ+zxwpA6rzs8+Uxc7FRQ8d0z89DC+ScEbVUAWssAVubH+gkfylLzdyI+mVKjK gQvos+M3ND6TEwaxyJTJG+AgWoTsMo40ygisHeNK+QZuGhCqKiMZqfqv6R6AhAUTADtm ZYWTP8XiQR7kV1bgr2U1jtlKvjkF7n3C3kE5c1nbeRP4dqSx5mc+/7PZ4o6cW9cPq7EX MHpg2ZDbNOuulkMnQfzL66c/RhXB0snu74vtvlgZg64SxamDKCIWD3sXAFgN0wjQ2HkY 43tA== X-Gm-Message-State: AOJu0YxzdZqWs5AgbwCgEHi6NZAGNMhNRKkiCose7taLDLYJrpDqmaxy EjBTMk8lGXzAc0Zpui616ZsrdQ== X-Received: by 2002:a05:6a00:1d0a:b0:6d8:8506:9c06 with SMTP id a10-20020a056a001d0a00b006d885069c06mr352310pfx.24.1702948611746; Mon, 18 Dec 2023 17:16:51 -0800 (PST) Received: from google.com (170.102.105.34.bc.googleusercontent.com. [34.105.102.170]) by smtp.gmail.com with ESMTPSA id j4-20020a63ec04000000b0050f85ef50d1sm17951019pgh.26.2023.12.18.17.16.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 17:16:50 -0800 (PST) Date: Tue, 19 Dec 2023 01:16:46 +0000 From: Carlos Llamas To: Justin Stitt Cc: Nathan Chancellor , Nick Desaulniers , Tom Rix , linux-kernel@vger.kernel.org, kernel-team@android.com, Will Deacon , John Stultz , Masahiro Yamada Subject: Re: [PATCH] scripts/decode_stacktrace.sh: optionally use LLVM utilities Message-ID: References: <20230929034836.403735-1-cmllamas@google.com> <20231219002318.p7yciyr4ld62l4ad@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231219002318.p7yciyr4ld62l4ad@google.com> On Tue, Dec 19, 2023 at 12:23:18AM +0000, Justin Stitt wrote: > Hi, > > On Fri, Sep 29, 2023 at 03:48:17AM +0000, Carlos Llamas wrote: > > 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 (??:?) > > [...] > > Perhaps it is due to where I am dumping the stack, but I am getting good > stack traces on mainline (with a LLVM-built kernel) without this patch. Maybe you have set CROSS_COMPILE=llvm- in your environment? This is an alternative workaround. I write more about this in the commit log. > > With that being said, applying this patch still has good stack traces > and it makes sense if it helps others. > > > > > 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/20230914131225.13415-3-will@kernel.org/ > > > > Cc: Will Deacon > > Cc: John Stultz > > Cc: Masahiro Yamada > > Signed-off-by: Carlos Llamas > > Tested-by: Justin Stitt > > Note that this patch is similar: https://lore.kernel.org/all/20231215-llvm-decode-stacktrace-v1-1-201cb86f4879@quicinc.com/ Ha, I see. Elliot's patch help revive this thread. Cool! -- Thanks, Carlos Llamas