From patchwork Tue Jun 20 15:55:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Jihong X-Patchwork-Id: 11053 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3786920vqr; Tue, 20 Jun 2023 09:26:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5uaiswuAKxSMkgV2jAX6cfVlj38I9w5tHpSvTUQU8nyvLFqqnAeoh8WNLu7LlJimiK8JVh X-Received: by 2002:a05:6870:c806:b0:18f:1113:c6be with SMTP id ee6-20020a056870c80600b0018f1113c6bemr8613408oab.11.1687278364287; Tue, 20 Jun 2023 09:26:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687278363; cv=none; d=google.com; s=arc-20160816; b=sZ3RoRP/MyS5PsW5wJtqCGVKdL3X1BWM13dzAbEUyTRuy/PeQYRLgrww+kPz1s6pT4 Q5areWkg2W6c7R44BDWKZIa7DDzRQB2h1IpVVpG/w+3RBxzKqbT3yBTZ0lMGWHM7t2Km J2OyYwNCYcUg1ostquOjTP0HIBNNt9jPYB85wDM5Bw6YAjb/ba+bwbD6EZp1/KKFlTC0 9ZT0hpnvBJyB0wO39H8Jf9+S0RBzmG7bLeDfIXTox8b/EDwbj+dV6CEOLHSnEEB45DRV eqtPRmigLBVH3MXW0o37Y2qhBuVCyUeCFbNxh0aKXTyKVy7uBDZmzbnLhkfhOQleDAQQ qDhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=k7jAv1zXteBo3cJqYWK5bnEubx69BupXMAOHTkvfEVc=; b=XjyyaWz4mJPaOKLD/ZDlCdGx2sl3HkwZKclwpuGaTPKnaTZhVxFLKtbCBQc1Vadwjt kLvb4Z6VjBIlrdB5gihcrlh5juXq9LgmbHgRKnfhmy1lKbY4g7cXKRy5iwbs5xiwWlXt UBmWlMeAiXAriCBe6G/ZAolUPQ0kDWKIRXOWpv8Jl2+KxvjbAAsHC2ZHpGr3xqX4Z3li kcUC5JS7+xd4nzoHyUjEIM0Nrev9iY6Dtf3kNHI4jsSl1xdVT7pvdY1znHMhXVPS1wIC fq6y0ghB7U/QcV/Mbb02EZLAds8xBZMu4Sc5RJMRU6UuUcbCWZnpdMLBU0LHuZpKTJ6J 68Qg== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t4-20020a63f344000000b00553cb20380bsi1942004pgj.33.2023.06.20.09.25.48; Tue, 20 Jun 2023 09:26:03 -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 S232839AbjFTP5U (ORCPT + 99 others); Tue, 20 Jun 2023 11:57:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232729AbjFTP5K (ORCPT ); Tue, 20 Jun 2023 11:57:10 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2BA6B7; Tue, 20 Jun 2023 08:57:08 -0700 (PDT) Received: from kwepemm600003.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Qlrln3fy1zMpHZ; Tue, 20 Jun 2023 23:53:57 +0800 (CST) Received: from localhost.localdomain (10.67.174.95) 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; Tue, 20 Jun 2023 23:57:04 +0800 From: Yang Jihong To: , , , , , , , , , , CC: Subject: [PATCH 0/2] perf/core: deliver PERF_RECORD_COMM and PERF_RECORD_MMAP side-band events to all online cpus Date: Tue, 20 Jun 2023 15:55:13 +0000 Message-ID: <20230620155515.101222-1-yangjihong1@huawei.com> X-Mailer: git-send-email 2.30.GIT MIME-Version: 1.0 X-Originating-IP: [10.67.174.95] 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.2 required=5.0 tests=BAYES_00,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769239563183337952?= X-GMAIL-MSGID: =?utf-8?q?1769239597801605185?= 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. Yang Jihong (2): perf/core: perf_iterate_sb_cpu() supports to receive side-band events for all oneline cpus perf/core: deliver PERF_RECORD_COMM and PERF_RECORD_MMAP side-band events to all online cpus kernel/events/core.c | 58 +++++++++++++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 17 deletions(-)