Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp8029790rwd; Tue, 20 Jun 2023 09:13:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4aONpHmHm1W1s+cXA9C0jKshHov3xBdO9B77pzIHvp6/EWfA2RU0MTSH8wRXNVYEggdf0g X-Received: by 2002:a17:902:e74e:b0:1b3:8865:aaae with SMTP id p14-20020a170902e74e00b001b38865aaaemr12848388plf.53.1687277618326; Tue, 20 Jun 2023 09:13:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687277618; cv=none; d=google.com; s=arc-20160816; b=ATAQDRBwDBjxXQN3OnQYNZHAEOGXvTkdXYB/LBrSPSJ5jzLwagKDlA0qfsiWK8L0+B KnZyx0ggloyMa1M8J8sFILL5vk5uVoCWHIOTKagstp1B+SoR18+9l1W1GRe/UdiZrhEA GRyX2ORg5g0Dkgi2SwRjCAka41Dx6wuSgE107dt4ZO/CJniXVoO0mGVjvkrjbOB1OdgZ Q2eMHdGi+L8hWKMcxFCU+zb4fx0EE9s7CBs9n4+W9lELNjeSdaYGirH89L11/LPxCvul NH9GnK797BGEbe/oSKw3BRb/CRs+eqZwzYDLGcwlEcqcEIXlqegT67cWYA/3JRVEOSPd X3JQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f4-20020a170902ce8400b001b01242b3fdsi2287357plg.652.2023.06.20.09.13.19; Tue, 20 Jun 2023 09:13:38 -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 S232983AbjFTP5T (ORCPT + 99 others); Tue, 20 Jun 2023 11:57:19 -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 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII 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 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(-) -- 2.30.GIT