Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp3266459pxb; Wed, 14 Apr 2021 00:58:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxeVm++JgfUWtdTAinHNxZ8czX+JR08tqPE1sBJkhBocL7VzEXwq3a1kMJMgCjx2/EKDptz X-Received: by 2002:a05:6402:1004:: with SMTP id c4mr39853159edu.364.1618387109933; Wed, 14 Apr 2021 00:58:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618387109; cv=none; d=google.com; s=arc-20160816; b=HY3xNwg9UOxRnY9N/ldKNDzn6OyLK3rQB9LPywI7uCOcisaXxge/MiUfkQjF/L2Nwp qbWYI/3gVqmRxjcYdvzlM3E9qSZ/dlaCC+FShZnuHasWozof91xXJljdzImnyaV5wuhJ 6JZVzeXyfNgNIE2N5PxJBd664ApxYbh1uFCzysrcTu9UCzDBlcB2tVnxyhN9cYkMzG0J YrSFNJ3QzyBWy7UrpXIIixvVIyu3XFX8QHgSNRxLCA20cqqfeFqZMkCNWAdr+hW2CKgv xS0OUM8l18cNGJKMPxAIJaIkQrfb3fF3QMrKM6glpGF0xmM//y57p5StH/F+2zS3XqPM QQZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:message-id:date:to:cc:from:subject :references:in-reply-to:content-transfer-encoding:mime-version :dkim-signature; bh=UwhGdc46iMWQqFEaIwmWAFlRSRD36hM0PT/2cl0x9I0=; b=iJkVTbDQ0B1XN8McJv1ZPeRw8mbf5rhy9DJB1DICLMTdk4RzBukw5u2GewtwCG2IPW 31ZQ7RS5//pZTBr3QIzuiDPIDNmjX4YqdU/y8wspAcwddgQRP4Uqsd0qN1glsbyRvSYV a1wWB/6nW/b3hR8JI63Q8aLhmGVrJvx7QmnfjcOOH4uQ2XT9q1RIV2N+UCeAcMJf0xt7 /MJI4cmA8DEg1y/EoKugPXYjf5XtzN7Ijhb5knsS06OEjjqUj7D0MVg9lLL38Fzb53Su LQJl+NPKFw0rUg1jmxLBi8Oc4i4T7BqsdZHOlGPJ0O+0RnckWKHNodJCXsU0gXTTR4Q5 kPQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=MsspCibE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g3si11792759edu.276.2021.04.14.00.58.06; Wed, 14 Apr 2021 00:58:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=MsspCibE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231868AbhDMUhP (ORCPT + 99 others); Tue, 13 Apr 2021 16:37:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229914AbhDMUhN (ORCPT ); Tue, 13 Apr 2021 16:37:13 -0400 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA26AC061574 for ; Tue, 13 Apr 2021 13:36:51 -0700 (PDT) Received: by mail-pg1-x535.google.com with SMTP id l76so12788198pga.6 for ; Tue, 13 Apr 2021 13:36:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:content-transfer-encoding:in-reply-to:references :subject:from:cc:to:date:message-id:user-agent; bh=UwhGdc46iMWQqFEaIwmWAFlRSRD36hM0PT/2cl0x9I0=; b=MsspCibEeo+YX6jSqH6x4AskVUjuEN1wEcxXZ9XASs85zv1vx95OriB+hOOnu3qZNP IEyW3+fHT/gjNgMHPTjrZQtf/jmauMpZvL9TYQJ60Qh6mSjTcDSrPLKgkM3KThLxfWqq NCBOBzTZuTSkznk6GiYE+aHp+UfdH6d4u1ivs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:content-transfer-encoding :in-reply-to:references:subject:from:cc:to:date:message-id :user-agent; bh=UwhGdc46iMWQqFEaIwmWAFlRSRD36hM0PT/2cl0x9I0=; b=YeKS8FRKzDFPa7j8FYTHgjDHmPMnYFhGZ0vgMic0QAYAvLYwqpWKtNnOFqwvNCBCk+ UdU+8tSTBwFayl9DznIFY8FlfSf76D1UIldNmuXc9SKNzfyvOoqHk8csCh7svZmbR5mY VABFU/RMjqD2SVDZL4NFabcrF0Ahsa8MeWiPphnAk3qidM2LPZiNF4pxiP0tC7DGd4uc ICaGpbk2D+LmSH6zvZDd/QCcSfQJBLTx0hTMfQoNsPdARqj6GWkD9Y8e15CkXVlE9DeB gAV2O/xBeFMGqaNrxxWiG2HgcuODfpBYtSa6EpXxomoOgUQfyd8myADQyYDyRMbp/1dd P+vg== X-Gm-Message-State: AOAM532twxX+dLEfNldJqkMzYpNWgcA8I9RwYStd59Yd7JsSK7eUNIAl HrigsRdzogkyYlUQuCbcSJ/fvQ== X-Received: by 2002:a63:570e:: with SMTP id l14mr33789397pgb.159.1618346211250; Tue, 13 Apr 2021 13:36:51 -0700 (PDT) Received: from chromium.org ([2620:15c:202:201:1d18:a339:7993:e548]) by smtp.gmail.com with ESMTPSA id f13sm363569pfc.195.2021.04.13.13.36.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Apr 2021 13:36:50 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: References: <20210410015300.3764485-1-swboyd@chromium.org> <20210410015300.3764485-5-swboyd@chromium.org> Subject: Re: [PATCH v4 04/13] dump_stack: Add vmlinux build ID to stack traces From: Stephen Boyd Cc: Andrew Morton , linux-kernel@vger.kernel.org, Jiri Olsa , Alexei Starovoitov , Jessica Yu , Evan Green , Hsin-Yi Wang , Steven Rostedt , Andy Shevchenko , Matthew Wilcox To: Petr Mladek Date: Tue, 13 Apr 2021 13:36:48 -0700 Message-ID: <161834620810.3764895.16783352875023260799@swboyd.mtv.corp.google.com> User-Agent: alot/0.9.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Petr Mladek (2021-04-13 07:41:11) > > diff --git a/lib/dump_stack.c b/lib/dump_stack.c > > index f5a33b6f773f..d685331b065f 100644 > > --- a/lib/dump_stack.c > > +++ b/lib/dump_stack.c > > @@ -5,6 +5,7 @@ > > */ > > =20 > > #include > > +#include > > #include > > #include > > #include > > @@ -36,6 +37,14 @@ void __init dump_stack_set_arch_desc(const char *fmt= , ...) > > va_end(args); > > } > > =20 > > +#if IS_ENABLED(CONFIG_STACKTRACE_BUILD_ID) > > +#define BUILD_ID_FMT " %20phN" > > +#define BUILD_ID_VAL vmlinux_build_id > > +#else > > +#define BUILD_ID_FMT "%s" > > +#define BUILD_ID_VAL "" > > +#endif >=20 > 3rd patch always defines and initializes vmlinux_build_id. But it is > used only when CONFIG_STACKTRACE_BUILD_ID is enabled. It is also used for crash code. > Is it intentional, please? Yes, mostly for simplicity with the other user. >=20 > It is not a big deal for vmlinux_build_id. But it is more questionable > for the per-module id. I am going to open this question for 5th patch > as well. >=20 Right, for the vmlinux_build_id symbol it is not exported, and the whole buildid.c file is part of lib-y, so if the symbol isn't used the linker should drop it during link phase. I can drop the early init call if the config is disabled and crash kernel code isn't enabled, and then rely on the linker to drop the vmlinux_build_id symbol. Let me see if that can work so that we don't have to parse it at boot if it is never used.