Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp2988766rwb; Mon, 5 Sep 2022 04:58:41 -0700 (PDT) X-Google-Smtp-Source: AA6agR65X4Ws4apUnD77Y2VECRG908sc1SZKbqFJh1/JP4o2c60bfav4FyimgOOoJikYyO8SwhnC X-Received: by 2002:a05:6a00:13a7:b0:538:39fc:ddc0 with SMTP id t39-20020a056a0013a700b0053839fcddc0mr38309203pfg.8.1662379120770; Mon, 05 Sep 2022 04:58:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662379120; cv=none; d=google.com; s=arc-20160816; b=gJef7MS2WceEjWENnu3urJMuX5fMUpO2DRsNqedEZzF8OakvviuxExDpC2Bx9tgy8e gQjETKYCjYEk4yKGW420e1+z/xLbBwiWv3xvzDQx+8NNmCWN/Rwal6PiPjkykyUnXuN5 S+fRjManhorY0GTHrpXWPUiSVokKp3BqNCmdO26hOFpSxYgvmakP01zF+OpgrQl19uks UnoaZkL6mFe5Hm8TO2QTKJkHDI895w1+OxVj1zJHN/2OXmXlY3CKVsZ4FGx8ZO4SNtP2 1ByLEJdHP+/ciMgh/17rNEgDMPKAMdpo1FVpuSe1gPWAhmfdRavGR1L1GdL2tWNdw09K a3lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=XcOa913A3dxW+lTE35qOWSEYvZDvMA+a328jvD9kUTQ=; b=0vUTjUmBYK+hTVr2w0J6qviKLyxBIb9Sk7csn5y3ZnavlJx6/9DEs0ubPcTj+T8jmQ dCl5Yi1nGn1VokdAdRCgJF44+UD/QeLTdvd9QH7o3/y6KW3b3cHR5YH+qqTfA962mdx5 Ot7zRk5FwZE7Sis90RtAfIYaB0NQjJc/eIyYMctT134FMAU40OomWgYnIT8F6CHtS5es hxvmeY/kJeahIffR+1fGlfr8cVzmoSDhv0WMVeHNSH259/Jg5dFA0SF5g8IqNLby0zP4 MTEl20f1ZL2MrsCWVMR/HLP7tRihShi2ITS+SNl7tR/YmU6Eiqp8R6guQCnQYG9EeIRU SQGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=BRZmBspe; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jj4-20020a170903048400b00172dc7ef8e7si9984784plb.499.2022.09.05.04.58.20; Mon, 05 Sep 2022 04:58:40 -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=@intel.com header.s=Intel header.b=BRZmBspe; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236326AbiIELrB (ORCPT + 99 others); Mon, 5 Sep 2022 07:47:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238282AbiIELq5 (ORCPT ); Mon, 5 Sep 2022 07:46:57 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B2F85B7BE; Mon, 5 Sep 2022 04:46:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662378416; x=1693914416; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=rmq9EipHS9L8xFuFMT+S4A7GTg/VyYZlxDZR36o9V9g=; b=BRZmBspeJtgEzhH/0yaLv1RaiA0yzs2rFX9wldtnDBWYQBGlIzB8KsI1 fu9yHd+pAbM10Ps4G2mUPNZrPq9i5/C2TD6rZHW8qS9jY6W8NyM/yJnBE B4ON0IqOVebu7/fYMrCl0ln1mSUl6sX5ux92cMRTFVwbUYS46fBUQSlr4 flqET9prekWSoVupPr38qU2r6fLtQPeFb3bQ8ZUZBb99IxNGRKlTY09cJ aFEmJunIX3ohW+SDwNCuQqRGE5lkElHpOCg0ljLeSUvsAdRXsTbrHE4Xa zEWSrMbDLPY8VXg6zKjzpOYx6b7XhTzEMlW6tCgUEhpMJyL+tnHbSHLJH Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10460"; a="276766910" X-IronPort-AV: E=Sophos;i="5.93,291,1654585200"; d="scan'208";a="276766910" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Sep 2022 04:46:56 -0700 X-IronPort-AV: E=Sophos;i="5.93,291,1654585200"; d="scan'208";a="609654202" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO [10.0.2.15]) ([10.252.56.151]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Sep 2022 04:46:53 -0700 Message-ID: <030c90fe-a09b-eff2-a1cf-55f6609825fb@intel.com> Date: Mon, 5 Sep 2022 14:46:49 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.11.0 Subject: Re: perf top -p broken for multithreaded processes since 5.19 Content-Language: en-US To: Arnaldo Carvalho de Melo , Arnaldo Carvalho de Melo Cc: =?UTF-8?B?VG9tw6HFoSBUcm5rYQ==?= , linux-perf-users , Linux Kernel Mailing List , Peter Zijlstra , Ingo Molnar References: <10137382.nUPlyArG6x@mintaka.ncbr.muni.cz> <2fd9b620-e9a8-9cd9-1b4a-6b13d829b2ae@intel.com> <9a7bc232-e647-0667-4402-2f207003854b@intel.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,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 3/09/22 21:42, Arnaldo Carvalho de Melo wrote: > > > On September 3, 2022 2:35:09 PM GMT-03:00, Adrian Hunter > wrote: >>On 3/09/22 17:08, Arnaldo Carvalho de Melo wrote: >>> Em Sat, Sep 03, 2022 at 10:14:25AM +0300, Adrian Hunter escreveu: >>>> On 2/09/22 22:17, Arnaldo Carvalho de Melo wrote: >>>>> Em Fri, Sep 02, 2022 at 05:50:22PM +0300, Adrian Hunter escreveu: >>>>>> On 2/09/22 17:46, Tomáš Trnka wrote: >>>>>>> Hello, >>>>>>> >>>>>>> A bug in perf v5.19 and newer completely breaks monitoring multithreaded >>>>>>> processes using "perf top -p". The tool fails to start with "Failed to mmap >>>>>>> with 22 (Invalid argument)". It still seems to work fine on single-threaded >>>>>>> processes. "perf record" is also unaffected. >>>>>> >>>>>> It has been reported here: >>>>>> >>>>>>   https://bugzilla.kernel.org/show_bug.cgi?id=216441 >>>>> >>>>> If I do: >>>>> >>>>> ⬢[acme@toolbox perf-urgent]$ git log -2 >>>>> commit dfeb0bc60782471c293938e71b1a1117cfac2cb3 (HEAD -> perf/urgent) >>>>> Author: Arnaldo Carvalho de Melo > >>>>> Date:   Fri Sep 2 16:15:39 2022 -0300 >>>>> >>>>>     Revert "libperf evlist: Check nr_mmaps is correct" >>>>> >>>>>     This reverts commit 4ce47d842d4c16c07b135b8a7975b8f0672bcc0e. >>>>> >>>>>     Signed-off-by: Arnaldo Carvalho de Melo > >>>>> >>>>> commit 78cd283f6b8ab701cb35eafd5af8140560a88f16 >>>>> Author: Arnaldo Carvalho de Melo > >>>>> Date:   Fri Sep 2 16:13:41 2022 -0300 >>>>> >>>>>     Revert "libperf evlist: Allow mixing per-thread and per-cpu mmaps" >>>>> >>>>>     This reverts commit ae4f8ae16a07896403c90305d4b9be27f657c1fc. >>>>> >>>>>     Signed-off-by: Arnaldo Carvalho de Melo > >>>>> ⬢[acme@toolbox perf-urgent]$ >>>>> >>>>> It works again, Tomáš can you please try doing this to see if this works >>>>> for you? >>>>> >>>> >>>> This is the fix I have so far.  I would like to test it some more though. >>> >>> Ok, so I'll leave it for the next pull req, possibly after Linux >>> Plumbers. >>> >>> What do you think about reverting those two patches for v6.0 and then >>> add this for v6.1? >> >>That would break sideband collection with selected CPUs, so I would >>prefer to avoid that. >> >>The fix is a effectively a partial revert of "libperf evlist: Allow >>mixing per-thread and per-cpu mmaps" anyway.  I just need a few days >>to do more testing. > > Ok, please add any insight or clarification you find while testing to the end result patch, like this sideband collection with selected CPUs. > > This is all complex, so even comments being prone to drift from code, having them added in the commit log message, associated with the codebase at that time may help us in the future when fixing problems, using 'git blame'. I finished the testing I wanted to do, and sent V2 of the patch with an expanded commit message: https://lore.kernel.org/lkml/20220905114209.8389-1-adrian.hunter@intel.com/T/#u