From patchwork Mon Mar 6 10:14:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 64569 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1760866wrd; Mon, 6 Mar 2023 02:25:59 -0800 (PST) X-Google-Smtp-Source: AK7set9hsXkV/nMnBlVhnabtNyYznAzYC/eDZZlPop1JryvHqFFnWK5P5btHrnqQFt9lPRVqmk/J X-Received: by 2002:a17:907:9627:b0:862:11f6:a082 with SMTP id gb39-20020a170907962700b0086211f6a082mr13383849ejc.17.1678098359011; Mon, 06 Mar 2023 02:25:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678098358; cv=none; d=google.com; s=arc-20160816; b=mUkCtJQdEspfBoibpgXHu7g/pfQU3H4rAm4e0hFrpweEeuJ9SzLgq6r4x5i8k+qaDK YDad+NdNiSk7Bc7j9v+GBkw5mTJR8CbkIexoT6srgTUrDPZJzGJQWummj3R0jSMCt+Ug YdMvMZwtPlWlg80b+kfIbX+cf78iPtiNfaFRU7BEZ/5DtOVLXQA11B8KtBq48GrOoZj7 tt8RiyCYma8nPchexZa3c7m08W/LW6gjHX87XbF252+B5NmctcDp82hsNVPII8Wgpq6E a6EBMQ8jnEyDH94glgcG60ksg1niJtkGYQeQv08Yq5DB8wMtB6s6sNeWt2anBLcBjcWq k20Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=bvmgWujZdbYkFAecaxp20fyrfYON81YYtB1O/0CkywQ=; b=C7IfILZ3webfAgc+byWv0HzdJv4Jl/zEqDoV9o8K31tHWiEh3SqGmICkKm1af38AKX i3g2SK/I6hmQEYW1RegeRJuTTla2nc5z8h8eCbwdiGBdZlVI29SPY6fTq9zT3U1tlnM3 oxvNmvnhCpg2nckwPtGEAZ3ZteSmbC/h7tPj61yt23DA9QfY+PV2Inyy/NK+m6+g2xl1 0+VaJWu42amvV8IoFH+9T484KowEnGylOy13ccUSZ9hNy70pJpyC5DfDhOo4x1f8Pbj6 s8UND/uGnGC4ysAzqp2unsjrsid8UKv7VX4nEaCCLowjalVFXPEVH/LpSwpwFU7Zj4UO DZlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Zu8k0Tkv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a12-20020a17090640cc00b008b17d8d4dcasi8705679ejk.692.2023.03.06.02.25.16; Mon, 06 Mar 2023 02:25:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Zu8k0Tkv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230423AbjCFKQE (ORCPT + 99 others); Mon, 6 Mar 2023 05:16:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230414AbjCFKPm (ORCPT ); Mon, 6 Mar 2023 05:15:42 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10FC922796; Mon, 6 Mar 2023 02:15:04 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A9E26B80D79; Mon, 6 Mar 2023 10:15:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F225C433EF; Mon, 6 Mar 2023 10:14:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678097701; bh=b8mXcWVvr64LaGiDwsadENDYgpIdOC4YHwo1Q1/sMko=; h=From:To:Cc:Subject:Date:From; b=Zu8k0Tkvwvb7q/J3jqm9DD2lkIqZIAlMvxqxd5XXdq73BDVe0QUNbtzGWGoFP02g3 koG9v303G5KWhlmKVFlT86hN3WYUu9HUFUMT7g/S6GRYbUpKX0StsddRz8GENQ5BuJ qSzMuiFAPw9LJvUEZsq9pPZt0fc2PRqBhq/8JR44oJDIOw7J566ABaXhX4Izx95Z0W Zhz6Q6MY9fXKeB6TgU176iwoTWo8d2T6hkvpBW3WuRUl5D+eWwf5Yme3M0NA8yeHYk KIvTEXTn0UN2rnnPxTly3dYqqkdCbjmfDjgq1Zg6Dq5CvBAql1ac7OiYKuxmb/9nzO oRGkeAvIk+VwA== From: Arnd Bergmann To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Nathan Chancellor , Nick Desaulniers , Nicolas Schier , Greg Kroah-Hartman , Kees Cook , Miguel Ojeda , Zhen Lei , Boqun Feng , Luis Chamberlain , linux-kernel@vger.kernel.org, Arnd Bergmann Subject: [PATCH 1/2] kallsyms: add kallsyms_seqs_of_names to list of special symbols Date: Mon, 6 Mar 2023 11:14:50 +0100 Message-Id: <20230306101451.375844-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759613665061888202?= X-GMAIL-MSGID: =?utf-8?q?1759613665061888202?= From: Arnd Bergmann My randconfig build setup ran into another kallsyms warning: Inconsistent kallsyms data Try make KALLSYMS_EXTRA_PASS=1 as a workaround After adding some debugging code to kallsyms.c, I saw that the recently added kallsyms_seqs_of_names symbol can sometimes cause the second stage table to be slightly longer than the first stage, which makes the build inconsistent. Add it to the exception table that contains all other kallsyms-generated symbols. Fixes: 60443c88f3a8 ("kallsyms: Improve the performance of kallsyms_lookup_name()") Signed-off-by: Arnd Bergmann --- scripts/kallsyms.c | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c index 8a68179a98a3..a239a87e7bec 100644 --- a/scripts/kallsyms.c +++ b/scripts/kallsyms.c @@ -119,6 +119,7 @@ static bool is_ignored_symbol(const char *name, char type) "kallsyms_markers", "kallsyms_token_table", "kallsyms_token_index", + "kallsyms_seqs_of_names", /* Exclude linker generated symbols which vary between passes */ "_SDA_BASE_", /* ppc */ "_SDA2_BASE_", /* ppc */ From patchwork Mon Mar 6 10:14:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 64562 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1760435wrd; Mon, 6 Mar 2023 02:24:49 -0800 (PST) X-Google-Smtp-Source: AK7set+N+hNXSmMU0uGQwjxiKLDHXsvyGXsN7TZimm6xh31E8VpniXRY7aOJ2j80jc0co/xbCKXv X-Received: by 2002:a17:906:9f28:b0:8b1:3813:7b6 with SMTP id fy40-20020a1709069f2800b008b1381307b6mr10355764ejc.30.1678098289371; Mon, 06 Mar 2023 02:24:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678098289; cv=none; d=google.com; s=arc-20160816; b=sGhohBanK535D+uEuF2/iSL5UIHd2XP5IlqV0Qwk+9h7vGHfDO1nOsWj46FGtQrzWN g698dyHGGOtL51hqWlE/DpvzT7tHPwxs+8mZuAWdREj1ZkCgQevDYUAxcIHFXBlJVovY UiNQWDgGFseNBeZM0BNlgyl3Zo3MG9rEtynhv3Yztj9o4nnhj67Vs7hBl088AXUCbN/6 CWq8+wP0iVFzs4CcqAfDUcQs4jmhHbxNl8mxJk6zCzvbb7coG2PnjCVcOCegToyH1jyQ bd7G2GD75ftgPUGpM/HINVxMKe3VSYSqR66tXFWaU++0su7d4lj25e3cSxaPEl/HQZ8X n07g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=rB7bKokAOFsa5bqaY/OlyPoy312qdrZ5e196c/QkHdc=; b=gAWMt7tto0qXyuMz98iPRO41q3iH3KAE47Ld+dqZIg1Kshr80zhmeyR8de/wCzwkFl K//ECGx033HKHMQHo/ZfnQeBCIyehKdGZK2T1OuhSQxM7zOidCx46gGUPEd8M2wYGJ7w wkynuBRTYGpT37L+5yfB6R9kgQrpTFotTvm7Mc4Aiq2DFE3u56IvYvWoU7Omg3nSFQUv Lk+ntcjNovMdTTMqW7y6oUXMfqxSgh/E1E5aECySye18Suw9nvVwXuT9CGXn8UMpprMN 3RNFyi/y3QrTAsjNOnlgLno8d8mhQnkCz78u7B6zxI4QC+8DRQLYSDwqJDona+ss/QqB 6R6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=i2TaLotz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w23-20020a17090633d700b008cbb481fc7asi3940937eja.614.2023.03.06.02.24.26; Mon, 06 Mar 2023 02:24:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=i2TaLotz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230409AbjCFKQB (ORCPT + 99 others); Mon, 6 Mar 2023 05:16:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230413AbjCFKPm (ORCPT ); Mon, 6 Mar 2023 05:15:42 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96F467DAB; Mon, 6 Mar 2023 02:15:05 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 32C2F60DBD; Mon, 6 Mar 2023 10:15:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C162EC433AA; Mon, 6 Mar 2023 10:15:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678097704; bh=gMn8LBo4YTVz4DCKbMOG8G2eyzp1G0ta2S/O8jCHVPo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i2TaLotztsUci/exTzbvk9XHqyKP3LCim+/r3AbtTx2DCWDp5H4PHEvbFsyO51sNp p8rbs/qYmr5RYL9B+Ib7kqYO/h5Mqx9tFRPGudGqigweySeDAjAlPpZJWwCap4LYH4 I3U8G6hSaAiYdjG9AVDB6OqjG92pWLcdN/4KS8twDy76XcF5c/6mFfMWtaXuGDPsc2 nAtAdDqt+KeQWlJaqaOg8tdJRLjfl/Mgj+k/0EGB/FfAlitpg0wHx956pRFsg8YuGv igujcesHHxhQad991EbKxKYbpS6I0kcZ1NLo1yhw4Kdrb/yA98gbH9lPjPA8YER5S7 5wJI7DPfOi3Rg== From: Arnd Bergmann To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Nathan Chancellor , Nick Desaulniers , Nicolas Schier , Greg Kroah-Hartman , Kees Cook , Miguel Ojeda , Zhen Lei , Boqun Feng , Luis Chamberlain , linux-kernel@vger.kernel.org, Arnd Bergmann Subject: [PATCH 2/2] kallsyms: expand symbol name into comment for debugging Date: Mon, 6 Mar 2023 11:14:51 +0100 Message-Id: <20230306101451.375844-2-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230306101451.375844-1-arnd@kernel.org> References: <20230306101451.375844-1-arnd@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759613591651373590?= X-GMAIL-MSGID: =?utf-8?q?1759613591651373590?= From: Arnd Bergmann The assembler output of kallsyms.c is not meant for people to understand, and is generally not helpful when debugging "Inconsistent kallsyms data" warnings. I have previously struggled with these, but found it helpful to list which symbols changed between the first and second pass in the .tmp_vmlinux.kallsyms*.S files. As this file is preprocessed, it's possible to add a C-style multiline comment with the full type/name tuple. Signed-off-by: Arnd Bergmann --- No idea if there is already a better way to debug this kind of problem, or if this causes a notable slowdown. --- scripts/kallsyms.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c index a239a87e7bec..ea1e3d3aaa6b 100644 --- a/scripts/kallsyms.c +++ b/scripts/kallsyms.c @@ -525,7 +525,8 @@ static void write_src(void) table[i]->addr); exit(EXIT_FAILURE); } - printf("\t.long\t%#x\n", (int)offset); + expand_symbol(table[i]->sym, table[i]->len, buf); + printf("\t.long\t%#x /* %s */\n", (int)offset, buf); } else if (!symbol_absolute(table[i])) { output_address(table[i]->addr); } else {