Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp819522rwb; Mon, 26 Sep 2022 06:19:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6wAg/wy3smwqX2xKdZj3ysCUg//nrf/mX0boXHujMgNOqhnl/Bobh6NSU1Q49N+HPXgPpl X-Received: by 2002:a05:6402:1d86:b0:457:e84:f0e with SMTP id dk6-20020a0564021d8600b004570e840f0emr10556623edb.241.1664198364588; Mon, 26 Sep 2022 06:19:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664198364; cv=none; d=google.com; s=arc-20160816; b=DVC/pxDKnlJQuq1i7t8VyzBoCf9SWojzmwtbpLou5I5PwcCxrRgtDJS+geEsaB1Me0 3SzNHq+W3ne+vQ9zhyKmvzCDHgEEQrE7DT9D87QOBFE2JWNxcYOKCiFwjNPGLLEjmLYa hf1I6HWBhwdO7fHvr3KfRMiucwbvB8bUnmV6eW8qi4ns7o+Q0b4O3CKvPfwHK5DuATcw 9YjCQDv7W/HI5WfCLISsr9W+JHCCVUE4mj0w3zqHR2GGlEZaOY2b5e9zOo9xhWJwQNix /t3BafC+KrTad1JyvgVqJdBWc7nurHydT9WjuNRm0fLlA7M+nC+sLhsGRjCp1Noxmnpb oAXA== 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=DWgPEBI96Ad4mWQMpYUQRuSrcmqSwkQ7wL/6VeOhLAE=; b=0Anl3NLeStbFEqWM0gok1S8gNBmddH9H5SqIyo1yvE9t2zEqF1V1zuHozxH64R0LfV z0GWntmr4xlr/OHkMASGif9vVHqrMM3ipCG4Id2CThKdGTCQW0a+fowXISGC+ZaGVpxu rgsA2LvRtmDY/V2rspTcgMxnostXvJwCGl8rmPxaAnW1cOT3lIuswF6HSwa3eewstG0X p1001EN/J64YMoI0ThlPvq11ptbc9EU3guHiCmtFpiY3Vl/Ni7LBNoN7EjkJoPyhq1Pl s6mKVjOj9KUk5QbaIRTIVFFpiG8t/6TdRvEJdgSeu02WvuDUsVKnX3GCQ/AwY0wmzxPQ 6t6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lE94j3up; 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 o11-20020a170906974b00b00779017c0aeasi20653696ejy.595.2022.09.26.06.18.59; Mon, 26 Sep 2022 06:19:24 -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=lE94j3up; 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 S235905AbiIZKgC (ORCPT + 99 others); Mon, 26 Sep 2022 06:36:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235943AbiIZKdk (ORCPT ); Mon, 26 Sep 2022 06:33:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 691614F187; Mon, 26 Sep 2022 03:20:32 -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 E018060C2C; Mon, 26 Sep 2022 10:20:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D1F9DC433D6; Mon, 26 Sep 2022 10:20:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187621; bh=zoFwJNAV8OYE3aCPPkf1bJp38WO9tMqisyaY5w41r3w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lE94j3upy1GPbuTlt6sg4NzntwWfYHHXfmho3Jz6cDLdraBXtJFi/lnHmdpltpJfl TpRrdwWwgVk8+MFTTVKF2a86csGZdTspha8eEH3pd+40GGea+CnTiBOSEiM+GuOItk qhZbdrNuOxu//XB0qQJ0DeEG6lOiT42tB/IOSLww= 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 4.19 48/58] perf kcore_copy: Do not check /proc/modules is unchanged Date: Mon, 26 Sep 2022 12:12:07 +0200 Message-Id: <20220926100743.209738261@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100741.430882406@linuxfoundation.org> References: <20220926100741.430882406@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 bd33d6613929..5fba57c10edd 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c @@ -1871,8 +1871,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. */ @@ -1935,9 +1935,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