Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp29835411rwd; Wed, 5 Jul 2023 19:00:29 -0700 (PDT) X-Google-Smtp-Source: APBJJlHNLgqWP3jn+wWzl3GIOV3RuvYgrcQFDgLV2js4vaJPgYDiIfz5SsJjZgVE/SU38vJr9zla X-Received: by 2002:a17:90a:ea17:b0:25e:9aa6:2dfc with SMTP id w23-20020a17090aea1700b0025e9aa62dfcmr389871pjy.40.1688608829566; Wed, 05 Jul 2023 19:00:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688608829; cv=none; d=google.com; s=arc-20160816; b=p62bmGPVi1iWVEiX/e8QM7aSYkI20K6hoKs1MFDzRnWa80IK425rrl17ZjIK53Hj87 T4pXPelZzSMV2u0GvYhtmqpJJUjGnUevGYm+cxfcyyWXVSgyay5LjxzfVlGXhFUIS1Jm cLzrSwDP9hi2TPMpTaG1FE4ozAXgNBRqoXQHrTcrLRglMDJVx3gcw3PIH3pjQ1uUImhV 90UAXoiVKDLJTtieDvFdHArjAZG3nsU2E8GaXIvvEeTtTrAI7miys+1Z5Bhm5dcfizmA kzzTzeebfLgn/Egy0i9uOATSTu26a7b7n02HRvo7EruxYEGkcKowccsbdBgq3BDNaHKd nwrw== 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 :cc:to:subject; bh=Mmt8mZHo8N+Z1NB4jIZUeT08ZwCWFrMV4XI2rlNbs/s=; fh=LFE1m73bbCTepyv5lDAxW/Ys9Sgxbr2VlP66eRf2EGM=; b=ZFpqvGtLG/iu9F4UZWsDchSi8nwU3Zc/7GJ9JiJvzg2UZ6tkBUdbGQPFQ62ZJaed20 iCujvYeKU9KTGRsa3ydDkggLxHbh6A/WaqrE0Wsn0bulp/SMFivr5Go5PE/M0xGxmFwS t8PacKy0Ij/4khgqVvqzL5OrBGFURR9nkhDiUT1zw6e06ZGB3q1mHhbSPh5ggtvH8E/c Ftsqzb+WInUmHxlYp6HxtiGiJhYfi4IIX9/DO9r+Qvd8UkNbRoGi2lJQwoM1s9sVopUA xllcaYrA7oWxC8tmZQ1MaHoADdJ0HPg8jnLo+O7NnZ1BnzxyuBDJawAJnGBQoHYwRzNE bQew== 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 s7-20020a634507000000b0055379a7131bsi426875pga.428.2023.07.05.19.00.13; Wed, 05 Jul 2023 19:00:29 -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 S232084AbjGFBje (ORCPT + 99 others); Wed, 5 Jul 2023 21:39:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229700AbjGFBjd (ORCPT ); Wed, 5 Jul 2023 21:39:33 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC9F8E5; Wed, 5 Jul 2023 18:39:31 -0700 (PDT) Received: from kwepemm600003.china.huawei.com (unknown [172.30.72.56]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4QxJzw04XtzPjwV; Thu, 6 Jul 2023 09:37:15 +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; Thu, 6 Jul 2023 09:39:28 +0800 Subject: Re: [PATCH 3/5] perf record: Tracking side-band events for all CPUs when tracing selected CPUs To: Namhyung Kim CC: , , , , , , , , , , References: <20230704074217.240939-1-yangjihong1@huawei.com> <20230704074217.240939-4-yangjihong1@huawei.com> From: Yang Jihong Message-ID: Date: Thu, 6 Jul 2023 09:39:28 +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: 8bit X-Originating-IP: [10.67.111.205] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) 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/7/6 5:09, Namhyung Kim wrote: > On Tue, Jul 4, 2023 at 12:44 AM Yang Jihong wrote: >> >> User space tasks can migrate between CPUs, we need to track side-band >> events for all CPUs. >> >> 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 > > But I'm curious why you don't limit the task to run on the > specified CPUs only (using taskset). > > Also, as you may know, you don't need to specify -C if you > want to profile specific tasks only. It'll open per-cpu, per-task > events and they will have all necessary info. > The actual application scenario is to perform perf records only for specified cores. However, during sampling, the system may create new processes and then migrate the processes between cores due to scheduling. If the processes run on the selected core, In this case, the perf report cannot parse symbols for these processes. >> >> Now perf samples the PC of taskA. However, perf does not record the >> PERF_RECORD_COMM and PERF_RECORD_COMM events of taskA. > > _COMM and _MMAP right? > Yes, PERF_RECORD_COMM and PERF_RECORD_MMAP. There's a clerical error here... Thanks, Yang