Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp507338pxb; Mon, 7 Feb 2022 17:14:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJzJWaYIgqp9ALERNwqHdYubTdiWlEKR+u8BCRJdT/wFOCdRGz4Ag97x2h2UhEfO3wrC/qAo X-Received: by 2002:a05:6402:11cd:: with SMTP id j13mr2083740edw.116.1644282853704; Mon, 07 Feb 2022 17:14:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644282853; cv=none; d=google.com; s=arc-20160816; b=Li/ENMxmJ6nlO1R2F2qtnokGbvSgPgwX8N4Z3nhZA9HAPbjphjpsGh8K8mUsrY4nuJ /w6weXcSOZuZT38tq3otfE9sO2NrE9DFXsJkgF/Ku6YOfavsO48oeELgGROOdpzmgcTH oEAWkGSGU1k+xg8T67QgwO4ENkmOcqgK3ZD++xkEAMidIamGIjSUQ70RIFOsv3uKNSSy zRx80x0NtUyi++1ISJ6LTp5CXFZJU2RJNfYCHaqrVrqtW0EhafdPUDmrBqPzm/RGIVzd a/yaYP7GaO8red2oEA5lgiXtN5G3iGHjYwtVkOF4oOnkohewOdOyVunmDzu0GLChd35x MqeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=X8O4SjgVdS5SunuH2EEc/jocTlfs6Jf+CUub2i63z1U=; b=xYHpnfSjZ4a4xPlPoxmknTvGqthHYG4uhMn51nOSxDLH+pA/y307q1UHJgzsQNL+vn FLKW5UlwW5asRkuzFOMYQdG/zAd2cm1brExOP/kmhvPe0+4jBgiq+nDLlbo+pG2LkW7K 4RWQ3CLoxS4jEVpY0uu4XYNcPnuY6l2UVgjs/Ynn5150YPRs/e9oDdPQH9316ySnokF9 fv2Ic5iMVOrI7tABdLwISg4ZpM996xHza0VB1X+mu8xnN0n3LeCJZbcT3Xe7o1nwIJLJ Tt0oK9StSgWoES+KSP1O+iBwumKXHgcfCf2kGqjJnYM5Uz23MGjlFksOgwPzypNwzln2 mD1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lBs6XhEf; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w15si8802431ejz.710.2022.02.07.17.13.48; Mon, 07 Feb 2022 17:14:13 -0800 (PST) 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=@linaro.org header.s=google header.b=lBs6XhEf; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351710AbiBGFxH (ORCPT + 99 others); Mon, 7 Feb 2022 00:53:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350415AbiBGDb0 (ORCPT ); Sun, 6 Feb 2022 22:31:26 -0500 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CE77C043180 for ; Sun, 6 Feb 2022 19:31:25 -0800 (PST) Received: by mail-pl1-x634.google.com with SMTP id c3so10148660pls.5 for ; Sun, 06 Feb 2022 19:31:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=X8O4SjgVdS5SunuH2EEc/jocTlfs6Jf+CUub2i63z1U=; b=lBs6XhEfsFsuOE3WNWg2BT0Jyc2nmdOyinZtvlBztKfWbOxzqL8X9E3b4SyNqE0Tvm jtIo8mDN01tpjq7oVr7OCKI1prUml3i98glWaL1pwAsEET0rel4CVJhAgSE+XwJw8hjx x5w8KybVk7IvQS1Z7b/cLBfPDhYgZ5StGnn3m1aBVzqgmQ06lCtKhLKCdpeO8eU9T5Gv iaK9w/QlIrzCL6ppjKhSVDdER8rGF64is0tdXnp8DynI23a+NnLLnKX6+QJH245IaFbj Mj7SrGtmd3PZEnLzVDMO5o1qEijES+UIiHT1HpvHqDbzy2+4YmObrJzK7zLcXjBM9LCg DHxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=X8O4SjgVdS5SunuH2EEc/jocTlfs6Jf+CUub2i63z1U=; b=dOEa6g50rtdIIsBtAFR6F7EKjL+nZbYWIi6xFYHzKK18bOJaee1HWIz5SNPCfElqvn O8opChvlhhW+yOJg6Q0NcjYtaMrhialXOP/CcLmzg4o0mLoyqIiS31jc9AT+Lkd8IlHd iHan8fCCZXNyuoUHH7NGCUTLguowShb6KnT7+uMqhLWxdA0AoYhgRplHNDEAebIDAbLy v5c9LwG3uhEBudY1D9Q+m50L85vDSI8pA7R1x2ulPLG7ossUiKrd7OzGWHle5BJXau+V 74MUbjmCbAY1eiw6crYeM42+aT6GPEsRnGU5VmGjh2w/k0D7WN3oehWK2hGVwrQI3YZ7 wcLQ== X-Gm-Message-State: AOAM530TqBlPMUy7ee5hZMV/u6O4wlEApXIn8SsvZkETDzazytzRmjTM 5u0xn+2KCD15xlL4D9koOW2eDw== X-Received: by 2002:a17:902:8204:: with SMTP id x4mr14619566pln.18.1644204684551; Sun, 06 Feb 2022 19:31:24 -0800 (PST) Received: from leoy-ThinkPad-X240s ([134.195.101.46]) by smtp.gmail.com with ESMTPSA id lb3sm20635240pjb.47.2022.02.06.19.31.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Feb 2022 19:31:24 -0800 (PST) Date: Mon, 7 Feb 2022 11:31:17 +0800 From: Leo Yan To: Arnaldo Carvalho de Melo Cc: James Clark , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Ian Rogers , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1] perf synthetic-events: Return error if procfs isn't mounted for PID namespaces Message-ID: <20220207033117.GA1240868@leoy-ThinkPad-X240s> References: <20211224124014.2492751-1-leo.yan@linaro.org> <20220204124849.GB2040169@leoy-ThinkPad-X240s> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,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 Sun, Feb 06, 2022 at 08:46:37AM -0300, Arnaldo Carvalho de Melo wrote: > Em Fri, Feb 04, 2022 at 08:48:49PM +0800, Leo Yan escreveu: > > On Fri, Jan 07, 2022 at 02:27:57PM +0000, James Clark wrote: > > > On 24/12/2021 12:40, Leo Yan wrote: > > > > For perf recording, it retrieves process info by iterating nodes in proc > > > > fs. If we run perf in a non-root PID namespace with command: > > > > > > > > # unshare --fork --pid perf record -e cycles -a -- test_program > > > > > > > > ... in this case, unshare command creates a child PID namespace and > > > > launches perf tool in it, but the issue is the proc fs is not mounted > > > > for the non-root PID namespace, this leads to the perf tool gathering > > > > process info from its parent PID namespace. > > > > > > > > > > I had some concerns that this would prevent use of perf in docker, but docker > > > does mount /proc so it is still working. And you've added a warning about how > > > to fix the unshare command so I think this is ok. > > > > > > Reviewed-by: James Clark > > > > Thanks a lot for review, James. > > > > Arnaldo, Jiri, could you take a look for this patch? Thanks! > > Looks sane, there was discussion, a detailed set of steps to reproduce > the problem was provided, thanks, applied. Thank you, Arnaldo!