Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp2514311rwn; Fri, 16 Sep 2022 11:26:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM532iyGPmC1pL2PvOGjfMA3yRDjYfXnf99GiZ2HNxvlhGacTYjQO2Yg4H8eoOknyGo12rj6 X-Received: by 2002:a17:902:ecc6:b0:178:3c7c:18ad with SMTP id a6-20020a170902ecc600b001783c7c18admr1142744plh.112.1663352804733; Fri, 16 Sep 2022 11:26:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663352804; cv=none; d=google.com; s=arc-20160816; b=jQwW2vdSIUgzAVo6lqhzyZ+G24M4ioTFTOLVHyWRKRvwKmb8SPLR9nN6iC445n6aKK MNEGTl4J0Gc/bUsyMutVnj//SE1e83Uw1jC0KZiNdmk10Sk2vXnXTYqd55j9qa+yDYD7 RRHhZ5Cbszw1yEw27PvnvwCgqPB3wocFXMB+j3l1rzcpIzVZupl7nWgd3Cm28nehHOyK ODIpm5znLEDTQCXcpJkxZNU83AEYz9GFoynp56CCjbsBOZVXATIN/JZo9Zr+DveIuq9k ePzVNxloEqdY4311BDM7P9YOY1I8Rxd9Tpmi8/K/K2ic/vFCgNMei6xxGl/gjsNxu/Ak q+EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=Suhd8y7qr16vgZ/mrX8LMlHAfVu2gygWJS3j6CdOblY=; b=LHsfk65yoNiex+ARAm+U9QEG4uVUF1QlXm2JKFGbhuRW61Z4oEsWNXz8mjVtmkQcts UImvy/zcabFSNMdXDABtEK/ISSpSSIYzYfT65Kw02zKGHKN62T8ibvGRarbwvmvYS5l5 GcyZ1cSn2MCX6UCFFA45JZGFw03yRHmp+7p+KYYJy/Sd7N6Gxagn2feJri42QsQcYLTJ EFPdEvynXstcnSQt2tGdgIryN3MqRyCFrHOl9HPRtl1dk1JOyydtevQW75KyUwui5BVJ 1KA8IUy68znVnAk/bXayR1IJBMchcmXDnum9MhabaE2QZNWcrgUIs34/dzzg7AzuMGI1 UwTg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pf18-20020a17090b1d9200b00203214d42a1si4051815pjb.169.2022.09.16.11.26.33; Fri, 16 Sep 2022 11:26:44 -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; 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 S229487AbiIPSCj (ORCPT + 99 others); Fri, 16 Sep 2022 14:02:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229484AbiIPSCh (ORCPT ); Fri, 16 Sep 2022 14:02:37 -0400 Received: from mail-oa1-f50.google.com (mail-oa1-f50.google.com [209.85.160.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2705DB6D21; Fri, 16 Sep 2022 11:02:37 -0700 (PDT) Received: by mail-oa1-f50.google.com with SMTP id 586e51a60fabf-127dca21a7dso53147552fac.12; Fri, 16 Sep 2022 11:02:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=Suhd8y7qr16vgZ/mrX8LMlHAfVu2gygWJS3j6CdOblY=; b=4YVhrgoY9qucGkAYyFE3sEibg0vbL1p7a7spgSgwuWZf2MAYcYQtoDWWSeEUQ0qHqr 6cb9zq+QwGlUVmRmgHilpUXowVHsDuECszYLIFnz8SqDvURklGSi56wNgvo9NtaLGRvt MznoQ1TWKbKx/8t0bqoc6pjLhfpY46G8+lIPgSBIsE9IuwMHXf74IZjUI788FF6h0Sf0 v49wyGtfSAPeG1djqxkwUWVWLFMYTS/ySUG305XOtAECgrexdoERdpax7ZC15zoWHfB6 MmX9aBWkCl8wZp3YdRVlK4PfJ1zOiQuEHUz2HHqq8aCGplNzM6G/jNYkN/DV6+9jg78m o2kg== X-Gm-Message-State: ACrzQf0xcnBjNdnv8RxHFgGN673OIYkwwRplISU+m75tLlnSNoVqGL0i QaKnOU/+YWISF89tYwvlnV3egRKpy1RC0eSlVw8= X-Received: by 2002:a05:6870:a70f:b0:127:666a:658 with SMTP id g15-20020a056870a70f00b00127666a0658mr3564175oam.218.1663351356429; Fri, 16 Sep 2022 11:02:36 -0700 (PDT) MIME-Version: 1.0 References: <20220914122429.8770-1-adrian.hunter@intel.com> In-Reply-To: <20220914122429.8770-1-adrian.hunter@intel.com> From: Namhyung Kim Date: Fri, 16 Sep 2022 11:02:25 -0700 Message-ID: Subject: Re: [PATCH] perf kcore_copy: Do not check /proc/modules is unchanged To: Adrian Hunter Cc: Arnaldo Carvalho de Melo , Jiri Olsa , Ian Rogers , Daniel Dao , linux-kernel , linux-perf-users Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no 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 On Wed, Sep 14, 2022 at 5:24 AM Adrian Hunter wrote: > > /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. > > Reported-by: Daniel Dao > Fixes: fc1b691d7651 ("perf buildid-cache: Add ability to add kcore to the cache") > Signed-off-by: Adrian Hunter Acked-by: Namhyung Kim Thanks, Namhyung > --- > 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.25.1 >