Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp893616rwb; Mon, 26 Sep 2022 07:11:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4EZUfbiyA43ceaK8OBgdOxap1Nm+BBavnajglyExPIQ6rafd/FBvUifbKaZn8lZFCromgS X-Received: by 2002:a17:906:eec9:b0:783:e662:2513 with SMTP id wu9-20020a170906eec900b00783e6622513mr260385ejb.656.1664201513810; Mon, 26 Sep 2022 07:11:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664201513; cv=none; d=google.com; s=arc-20160816; b=UD5KfUs7psnnGAvpTDpONdoHQOrCRBN/T194VEi+sMhiUE/gjEfE8GS5C69zVwSazJ E/HrKBF0r+4Ll8aKVFRBTCZjG/WMKWONkCknNFCirKdE07lmRvdWywPWsaF4uaH85Md9 JsHEzl6NK42DThkrskTLaQ/gFgLISRWpWkpt9R78p4dg7CI4HOeyBQUdI/wSKfTyCH/H lYT+DJ8OolLT9GoOzz0jV8yLidTkojL0pvVXPbccCi4WnEfPyekgWsp1GguYAzp4eeq4 hsSMugKhuPh6MJU6Dzz+mnJFcTVbmEKRutrvodzfcM4bPrgOamrQSNQTaXc29Ay19TDb EmxA== 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=WfOQ0Znyqgs+OlHcjb1jcE+MIWlJNPezccDc59cEncY=; b=RPO0lNAwTlWTSM0dF3Q1OTFVGLgKy4bN+AO4tmA7JPwLGlhmlUASFRBUv7rECsGmHE id7g8r5V0UhZj++/CSZblXp0eZLjvySh2KpmAia14izZbPZ9ZeflhMwK2oiUHQvIDc1X Ed4zYA9X3YAWB8Ft2SLdhdBws9yz5mFNAvlfE60t4or6Ng2OkCEd7B6mMvbNZ7EpNtbg 6JDpYvPB0MVMFgtjJ45AznwtZHbf6pm1iuMxFoliB5ZNSwH9AFJiIZoLEL4w09jlSv4+ rIePGOEe+ld5RSCEcxEyLf/0Iwstm+RCoH0FazD6Cr1pxNB6fCJQZiGe8LpTf4swA12m 80ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MRK1+tei; 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 f11-20020a056402194b00b0044eae9b2c48si16807984edz.273.2022.09.26.07.11.18; Mon, 26 Sep 2022 07:11:53 -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=MRK1+tei; 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 S238742AbiIZL4Y (ORCPT + 99 others); Mon, 26 Sep 2022 07:56:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238822AbiIZLxy (ORCPT ); Mon, 26 Sep 2022 07:53:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C660D481CA; Mon, 26 Sep 2022 03:49:52 -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 7214A60AF5; Mon, 26 Sep 2022 10:48:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7C860C433D7; Mon, 26 Sep 2022 10:48:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664189320; bh=wT1N8772zsUcNnX7ubuZGvmkTyerDfEJhFIeWhkXEkM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MRK1+tei042ndLWveJA5culRB4is6cowRgdXi1E+BqN5PqNYdP7sr9ZK1exo7pLgQ itO7r9NIBQhlF1HzWVQJSizytBHtTiPunu7DY8wXkpLeZK/Il0iQJw7tQ8O7Bl+Cd0 daP7eGvYhMjLrkGWA5+cLjHNMCykgOJyp75r9IVY= 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.19 148/207] perf kcore_copy: Do not check /proc/modules is unchanged Date: Mon, 26 Sep 2022 12:12:17 +0200 Message-Id: <20220926100813.276649930@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100806.522017616@linuxfoundation.org> References: <20220926100806.522017616@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 75bec32d4f57..647b7dff8ef3 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c @@ -2102,8 +2102,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. */ @@ -2166,9 +2166,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