From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1AF60C433EF for ; Mon, 7 Feb 2022 06:07:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233543AbiBGGEl (ORCPT ); Mon, 7 Feb 2022 01:04:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242507AbiBGDb0 (ORCPT ); Sun, 6 Feb 2022 22:31:26 -0500 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2990AC061A73 for ; Sun, 6 Feb 2022 19:31:25 -0800 (PST) Received: by mail-pj1-x102d.google.com with SMTP id p22-20020a17090adf9600b001b8783b2647so5851399pjv.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=FaS/8q1UPtpRovmLx1lVXNaLexcRDastUZaQIcc0YlM0pi9jUVjx+aOvLiuMvQMw+P IO85RebYv5C8hMBknsVpJy43XyJJnTmYCtr3ZZKCvgrV1frMEKhQn40XovlOByzMva9o v/dP88nNTcJECJi/gwoml2yO+3c7MabNxXvF5ECMAAQUMOmxo/my9WJivJqCl7RnDhwL KKmuS7shEsrNOLvFl994C+MKCqy9PQyaaIBOUO+ZvxSKXFW0RZth+LY1D8DKEe1AGVaI aapaD3k+Ipidgn7EuaR4y12LOgBwnaHalJlhjXlZ6s3HDPVe1AcgrO5jJoi+N9F79NKo roFw== X-Gm-Message-State: AOAM533o2i44HtkV0vSmY5WEGa3sL8WwPmVC8JZTfYEwATAyj+KpWD/9 FenhRjGuG7hJB7tNY03X23MKcw== X-Google-Smtp-Source: ABdhPJwEQXNbmG3jgYfTVG3BtqUk2B62Q1FY7AdDYz8KoNic3DRlZsUpTPdBTY+Eja0b4x7JYBdkxA== 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: Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@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!