Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp7904490rwn; Wed, 14 Sep 2022 06:18:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4yyPH82XAmSR+wWJ9fQCFX8rrXkLnfanK5frNd0UbWuFmFdOiwuJ6zZ5S55ALS0p4VGgX5 X-Received: by 2002:a17:90b:4b41:b0:203:236f:257f with SMTP id mi1-20020a17090b4b4100b00203236f257fmr1265835pjb.142.1663161488329; Wed, 14 Sep 2022 06:18:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663161488; cv=none; d=google.com; s=arc-20160816; b=s+/mbJyH2qCubSJ8rSEReCxiZKqhKeSVkeFzSBfhsgkErABiS09AP1NSqHDuP7T5yY 2vLnySih/RHk1bWsMW+eBBF//pO2zPbphNprBCqn155194z4qsK3eUgvPzwpSrgVXlDo PKGC/PFBpi2QbgzWyawXWMcUPBMurkgdxdWsyiOjX1EJNlIXFOPaslzi7o8SyQ/6dW8n YeOcr5AGG9/lRlt8YGYgxJYQQ2odBR4STdpS39rosy00olWLLmfwknicxRE2tqZ9BlFV JIO6iZks7h+jYl8GkXxTAxrVvVm2EuCGVGCV1VDf0xMRFMlQ5WFMn3MTnELEPhs5DIW2 2suQ== 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:dkim-signature; bh=ib5mswjR1x7cIBGgOeaYy3ofTlgkjtf1YQmH317wwYc=; b=I4qdPre5xEd1KxFFVyWKOoAfLzCVmSizsJqTSS4zT5wb52lxn/2Sz4M/uuZxUca6kk ZpYekUOk9ocVcLskIzGEtnKyHbYtpMAEiRCgLH3txr6FV4J9ZnaHu7t9FxzWMO9jiT0l 5H3HfFzDfBkYlBoBRnKcN69eJgZ5u768yLNgj9TDodXLmv7tPw8wDZpACkcxMCtMicxT U6MZ0KI0DTwBl+uH/qc4qvJfbvdvL15DktFb/infZQMjezOkiONVORqz0FybCpkJeMAM JYablEyA9ODAHvtHmy8R1AATgButYpikFxs8ZW/RaMoHdfct2/ETpCrOWaE8Pm8bnaa+ KeEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google header.b=EyGvls+P; 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=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d16-20020a170903231000b001782884c948si12492044plh.426.2022.09.14.06.17.53; Wed, 14 Sep 2022 06:18:08 -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=@cloudflare.com header.s=google header.b=EyGvls+P; 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=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229607AbiINNMo (ORCPT + 99 others); Wed, 14 Sep 2022 09:12:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229510AbiINNMm (ORCPT ); Wed, 14 Sep 2022 09:12:42 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 755994F3A6 for ; Wed, 14 Sep 2022 06:12:41 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id y3so34668957ejc.1 for ; Wed, 14 Sep 2022 06:12:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudflare.com; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=ib5mswjR1x7cIBGgOeaYy3ofTlgkjtf1YQmH317wwYc=; b=EyGvls+PPR5gSq51ImovQ9Aykw+f1UwYvKrRnvXUiUMLmdsoj3OZKautZPAbv6yI4S c05fPCDH/izs82miJZsc7xYU6USh/RTsgrfHyuphN64PJYH3IwytNrBNkVgofyZ4MDix +DVuyNg81rdHSCkfrAzOD4MJbUQ6lT2C4FvAI= 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=ib5mswjR1x7cIBGgOeaYy3ofTlgkjtf1YQmH317wwYc=; b=DFquBvawVJJ2zJjBxl2BAzars3Nz5jTS5NF4dhPFQ3CpS400/ZGwl3OIsusvjbBBpC ov+xrz+Tm0nZb2zscPwfGOhfIm5qQbmumdvjGvWeMHEsFZKz8wLNX936LMvwqg9K+J0J sY2i+mY9x7j0CKBKrDBge51qBiBGWqTbX6DGrpFhb6WnOlcNVTrAkHFGrX3SRC3uKQCi DUHKLbcIyCU0aO1MzrJvhQJi8MUeIzZZX3aSGDmO6Ij5r+m6hH+SKN4xaqUshnZuDltV xmC4arCNfRIpqeFbAF4jX1e840X7L1GkezMR7NOK4CXOnFMHvUNEoYR0mQcbm6daFpZy G7jg== X-Gm-Message-State: ACgBeo1qwtFhnlRtjzarvh2M4tmzLJzs1uHTRqHaINQNaHwvd4fJ8Ffh Ruq2SdTutCCmT6uY5lum/Fh71bLYzq52Y9aSiWa3jw== X-Received: by 2002:a17:907:c23:b0:779:237a:4218 with SMTP id ga35-20020a1709070c2300b00779237a4218mr19917347ejc.277.1663161159807; Wed, 14 Sep 2022 06:12:39 -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: Daniel Dao Date: Wed, 14 Sep 2022 14:12:29 +0100 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 , Namhyung Kim , Ian Rogers , linux-kernel , linux-perf-users@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 On Wed, Sep 14, 2022 at 1:24 PM 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 > --- > 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 > Thanks Adrian, Tested-by: Daniel Dao