Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp12028948rwd; Thu, 22 Jun 2023 23:53:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7hjfrDTb98z6kJUqZHyBR24vckPv6giYeMevIU68Rj44tXvo5uZlUKHp0R6fHCAHl0jk6K X-Received: by 2002:a05:6a20:151:b0:125:d34f:e905 with SMTP id 17-20020a056a20015100b00125d34fe905mr263686pzs.37.1687503225669; Thu, 22 Jun 2023 23:53:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687503225; cv=none; d=google.com; s=arc-20160816; b=jf/Pm05PCDBfQ9Qt1wcMmx9Mke42iqLUdty2RZ/OL1ekRILNSzeWyPnXhmfvd2nr73 zuEcbm/yZcqakdqibw97gYcrIPG+7ELdSQ2P6Q1lQV2AHO2hFvC+1JicCXFqWFrgBUU5 iCE/PJbQKLwa3MLhcFJR4+TB3CWyLjG5ywMvnO7VVc44kY0hlK8VzSZJ0lkOYehKUFif FXhWdvSe7cLGVPMTt4qgOhYxCq4QQd2TXLlUYBXEbh9LjQoI1/wAlpItpfvFfPk3c7T4 SYqzn/gswdjl8J2DGnEvKfzpMadaGIdCCkx0e3sQFueLbBKeQrhEO0k2vvHJnz7VbM+d 5oFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject; bh=FdjDPTdf2tUB7QPQup1u9RBaTiIJvtw2HpFjvjxXkg4=; b=QDODahszRrhfkOoD3IhJqJm7EnOmsdY9BRQxV74KWwN4B2S1w20H0Z1Z4HrEQDFUkx rQdZmniPRhXTFIpg+Fg8xCan63ou2+pZIVSGEQp2Qg3MJ8VwVg97Yr6g6p5wSVsgTiWd ISW/u3XfrWmxFtUUCiA/FeiA4NuMziPRKxn9U8MPIlSKtsBv/3vYq09Ec9y8ZjEHNt0J v7edqhw/EBQnU6KueZWuKRPqPI25RPSH5gFkMPKA8caH76rI7Nsb4HxYTh2m/nZ/XPH3 oGFY3PVni0yiPxL+c3BZfJaZ+T/E6YvaOG56n1db9bD7+24MfLPacMivBIr6el9JL01A v0pg== 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 185-20020a6217c2000000b006686ec2f62esi8178020pfx.187.2023.06.22.23.53.33; Thu, 22 Jun 2023 23:53:45 -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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231458AbjFWFuK (ORCPT + 99 others); Fri, 23 Jun 2023 01:50:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231181AbjFWFts (ORCPT ); Fri, 23 Jun 2023 01:49:48 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8ECE12D6A; Thu, 22 Jun 2023 22:48:50 -0700 (PDT) Received: from kwepemm600003.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4QnR9q0Pyxz1GF3d; Fri, 23 Jun 2023 13:48:31 +0800 (CST) Received: from [10.67.111.205] (10.67.111.205) by kwepemm600003.china.huawei.com (7.193.23.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Fri, 23 Jun 2023 13:48:39 +0800 Subject: Re: [PATCH 0/2] perf/core: deliver PERF_RECORD_COMM and PERF_RECORD_MMAP side-band events to all online cpus To: Adrian Hunter , , , , , , , , , , References: <20230620155515.101222-1-yangjihong1@huawei.com> From: Yang Jihong Message-ID: Date: Fri, 23 Jun 2023 13:48:39 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.111.205] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600003.china.huawei.com (7.193.23.202) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,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 Hello, On 2023/6/21 2:49, Adrian Hunter wrote: > On 20/06/23 18:55, Yang Jihong wrote: >> Tasks are migrated between cores due to scheduling. >> If perf samples specified CPUs, PERF_RECORD_COMM and PERF_RECORD_MMAP >> events need be deliver to all cores to avoids the problem that the comm >> and symbols cannot be parsed due to task migration to the target core. >> >> The specific scenarios are as follows: >> >> CPU0 CPU1 >> perf record -C 0 start >> taskA starts to be created and executed >> -> PERF_RECORD_COMM and PERF_RECORD_MMAP >> events only deliver to CPU1 >> ...... >> | >> migrate to CPU0 >> | >> Running on CPU0 <----------/ >> ... >> >> perf record -C 0 stop >> >> Now perf samples the PC of taskA. However, perf does not record the >> PERF_RECORD_COMM and PERF_RECORD_COMM events of taskA. >> Therefore, the comm and symbols of taskA cannot be parsed. > > perf record deals with this for PERF_RECORD_TEXT_POKE, by opening > the corresponding "dummy" event on each CPU irrespective of whether > the main events are on selected CPUs. Refer > evlist__add_dummy_on_all_cpus(). > > So this could be handled by perf record. Okay, I'll take a look at it and use this solution to deal with it. Thanks, Yang