Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp810216rwb; Mon, 26 Sep 2022 06:13:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5WMG9tEZbWvRfs3zj2j5M2P7ZaIjSHbaNvC9ByiBvTjHAOjQ3rFNg2+OwFw/0V8PM8vsHF X-Received: by 2002:a17:90b:3d04:b0:200:9d93:f6f with SMTP id pt4-20020a17090b3d0400b002009d930f6fmr35791043pjb.185.1664197997738; Mon, 26 Sep 2022 06:13:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664197997; cv=none; d=google.com; s=arc-20160816; b=E8vwFQXYXWp3O22A7HVydsIqMI5ctaf26IbkF+Btl/B9i7P02HioK7ANDfzE2g48+N II56BJGZu2NVbbpZagXOkA8tugvpYqxC3JvdxoY0/Zdl1nhv2oGIpRjy+Yi4W/rdLVFJ y9B51Jc/9s8ljpdIhsXi5VwOK68yjphtxtoMzF1YUQD9tigNwHUI52lrj5ZtLFhzsqxJ eQXyjC1kQ4Qf9nDRVkq9x00TPbFTbjQwCDuf7fWk4jSaqO94l3aS/YU0hyzt+GYhyv94 33EDAObFwAjkzmFhsWwMNO82ojLQS4iCv1LhX86dzkcsXvCf821sEz7+iNxNnrYHVl/o 1Jpg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=C+7sW2rUk69JKgYzJjJBKGFpAWMjEx8XXKWWnH+v/pY=; b=XpVMY6FjgELjMBaVnQ6weVO5cnZqlY0wuwv5tuYUrZL8CpyFGDcWFybSs5Gf9YG5Yj T7xvAQZEY2KXVXBCcngk8BYq571L2zxVBU9Y512VK7F3oH9B/T6bB7Z1GA2IItC/LWiU P4ZJ7XtfzZamdoS68L3E2eDu9bZeVkxqv/ZK/2ZkGNAhF9scRhmVRaBK2G4/eENd6shl R5K+srqvU4PQV6Z7PNVLKwkdkiv7M55VKsepWVUusUTdwazN9K0d9OKtTso1lR3FpCus x5wBa6l0+ylMvuKCDkcyQsXqzKQZuEBvBKamH02t5zK7VthWlHuWl+IJ9lfd3BT+Q3dT DVrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="jh/LVxlY"; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n7-20020a170902d2c700b0017555e9de54si11785897plc.427.2022.09.26.06.12.57; Mon, 26 Sep 2022 06:13:17 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b="jh/LVxlY"; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236966AbiIZLGk (ORCPT + 99 others); Mon, 26 Sep 2022 07:06:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237370AbiIZLFw (ORCPT ); Mon, 26 Sep 2022 07:05:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56B765FAD8; Mon, 26 Sep 2022 03:33:46 -0700 (PDT) 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 3475060C79; Mon, 26 Sep 2022 10:31:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27799C433D6; Mon, 26 Sep 2022 10:31:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664188316; bh=04SZM3opspa5chlZax00mts7tPj+RkmvBiQOqcE8sr8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jh/LVxlYUG9AsvSgfvpTvqtNFdpQAFi4iw01LKor8XUIDQjl95bG9zYSt280Z6tXZ Nq7qVG/oji6iGRW3eOrtO5p7n4QmxkaY/xHG12YQj1CKHyzavbXpaHH8C8OrV7HIw2 7LwEQPpIU+4a1EhI1Sjk7ZAvH3Mj5I5P7p8823gA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Dao , Adrian Hunter , Namhyung Kim , Ian Rogers , Jiri Olsa , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 5.10 110/141] perf kcore_copy: Do not check /proc/modules is unchanged Date: Mon, 26 Sep 2022 12:12:16 +0200 Message-Id: <20220926100758.427411664@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100754.639112000@linuxfoundation.org> References: <20220926100754.639112000@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 From: Adrian Hunter [ Upstream commit 5b427df27b94aec1312cace48a746782a0925c53 ] /proc/kallsyms and /proc/modules are compared before and after the copy in order to ensure no changes during the copy. However /proc/modules also might change due to reference counts changing even though that does not make any difference. Any modules loaded or unloaded should be visible in changes to kallsyms, so it is not necessary to check /proc/modules also anyway. Remove the comparison checking that /proc/modules is unchanged. Fixes: fc1b691d7651d949 ("perf buildid-cache: Add ability to add kcore to the cache") Reported-by: Daniel Dao Signed-off-by: Adrian Hunter Tested-by: Daniel Dao Acked-by: Namhyung Kim Cc: Ian Rogers Cc: Jiri Olsa Link: https://lore.kernel.org/r/20220914122429.8770-1-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/util/symbol-elf.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c index d8d79a9ec775..3e423a920015 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c @@ -2002,8 +2002,8 @@ static int kcore_copy__compare_file(const char *from_dir, const char *to_dir, * unusual. One significant peculiarity is that the mapping (start -> pgoff) * is not the same for the kernel map and the modules map. That happens because * the data is copied adjacently whereas the original kcore has gaps. Finally, - * kallsyms and modules files are compared with their copies to check that - * modules have not been loaded or unloaded while the copies were taking place. + * kallsyms file is compared with its copy to check that modules have not been + * loaded or unloaded while the copies were taking place. * * Return: %0 on success, %-1 on failure. */ @@ -2066,9 +2066,6 @@ int kcore_copy(const char *from_dir, const char *to_dir) goto out_extract_close; } - if (kcore_copy__compare_file(from_dir, to_dir, "modules")) - goto out_extract_close; - if (kcore_copy__compare_file(from_dir, to_dir, "kallsyms")) goto out_extract_close; -- 2.35.1