Message ID | 20230606142244.10939-5-yangyicong@huawei.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3442839vqr; Tue, 6 Jun 2023 07:37:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Pi6orm6xrtVgK62RWpTo+F/0PgXtkWSxqBGyjj2hoxA96CpNjwi2AIropqmO4oL//3+em X-Received: by 2002:a05:6214:1c4e:b0:621:451b:6e1c with SMTP id if14-20020a0562141c4e00b00621451b6e1cmr2966896qvb.6.1686062243370; Tue, 06 Jun 2023 07:37:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686062243; cv=none; d=google.com; s=arc-20160816; b=DFteNv/15XboWUkSnbAbo5XTLgs/CZSO7IDgW+TOwas6NOZufgfl/w5Dr/zSV94orz xUUORVGE/ERTGQhWGX4jHS2IIi6PXTu4QMCL9A8l9dSFlCbAKPZUO7mxSk+/7Yts8za6 61T5Yl8ODfasAE9sY9eBs6fC3yIpxgIBYOhRwWghD7/z8gQ3eFPXMeAqH9j84nbe7bqy CI66KDqdLMfBhuqYsSOETd97F7OE02jop0+LNQcgvkuu3UB2Tclc40szi+eLj7EGkOEz /yQmnLfiSh7MPeA5GKabAryVvZpynwE2el3KY33g8TPVcXODcKFogR4kmcK7+JJNYDRi cazw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=LSooPmB/j2Pp/PnwHf1bhlqZCLbzn/W3D7OHKRG++8g=; b=xe7HwSkvztyRRVWQIWGbVLUyp4U3OaagUwTRbz6sOvGfy7IpwODa0s9mSGShYYtcea rdxZYUCoy5wASDkw9FRA7fOS5MIKw4VEUTmaL7/NuX/L+qtX4coaSBJQErisuNwrD5rL sRT9Rkz2EhGb6qiGaax77xdLgHsYh39mCGFgM1+dAqB9q4vKsF12cixCTYkyAYZ0TvGS 97Hd7ixGTO6gReIkSVakBcC1vjKAF+T4hj8WoqL+ST9F+vwuCSg6UCZxzwUQm4hF6jFy wSJr4+o76aoet5RkJFjtCIy4FYvQPf0LPSNnfJT6t4lMXb+JRhTOZx3WkcmOu5vKC77O P3mw== 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 t17-20020a05620a035100b0075b22d47335si5931186qkm.70.2023.06.06.07.37.09; Tue, 06 Jun 2023 07:37:23 -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 S237818AbjFFOYc (ORCPT <rfc822;xxoosimple@gmail.com> + 99 others); Tue, 6 Jun 2023 10:24:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237551AbjFFOYU (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 6 Jun 2023 10:24:20 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BBB1E42; Tue, 6 Jun 2023 07:24:18 -0700 (PDT) Received: from canpemm500009.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4QbCN04f0QztQVt; Tue, 6 Jun 2023 22:21:52 +0800 (CST) Received: from localhost.localdomain (10.50.163.32) by canpemm500009.china.huawei.com (7.192.105.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 6 Jun 2023 22:24:13 +0800 From: Yicong Yang <yangyicong@huawei.com> To: <mathieu.poirier@linaro.org>, <suzuki.poulose@arm.com>, <jonathan.cameron@huawei.com>, <corbet@lwn.net>, <linux-kernel@vger.kernel.org>, <linux-doc@vger.kernel.org> CC: <alexander.shishkin@linux.intel.com>, <helgaas@kernel.org>, <linux-pci@vger.kernel.org>, <prime.zeng@huawei.com>, <linuxarm@huawei.com>, <yangyicong@hisilicon.com> Subject: [PATCH v4 4/5] hwtracing: hisi_ptt: Advertise PERF_PMU_CAP_NO_EXCLUDE for PTT PMU Date: Tue, 6 Jun 2023 22:22:43 +0800 Message-ID: <20230606142244.10939-5-yangyicong@huawei.com> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20230606142244.10939-1-yangyicong@huawei.com> References: <20230606142244.10939-1-yangyicong@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.50.163.32] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To canpemm500009.china.huawei.com (7.192.105.203) 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767964403159956207?= X-GMAIL-MSGID: =?utf-8?q?1767964403159956207?= |
Series |
Improve PTT filter interface and some fixes
|
|
Commit Message
Yicong Yang
June 6, 2023, 2:22 p.m. UTC
From: Yicong Yang <yangyicong@hisilicon.com> The PTT trace collects PCIe TLP headers from the PCIe link and don't have the ability to exclude certain context. It doesn't support itrace as well. So only advertise PERF_PMU_CAP_NO_EXCLUDE. This will greatly save the storage of final data. Tested tracing idle link for ~15s, without this patch we'll collect ~28.682MB data for context related information and with this patch it reduced to ~0.226MB. Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Yicong Yang <yangyicong@hisilicon.com> --- drivers/hwtracing/ptt/hisi_ptt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Hi, Yicong On 2023/6/6 22:22, Yicong Yang wrote: > From: Yicong Yang <yangyicong@hisilicon.com> > > The PTT trace collects PCIe TLP headers from the PCIe link and don't > have the ability to exclude certain context. It doesn't support itrace > as well. So only advertise PERF_PMU_CAP_NO_EXCLUDE. This will greatly > save the storage of final data. Tested tracing idle link for ~15s, > without this patch we'll collect ~28.682MB data for context related > information and with this patch it reduced to ~0.226MB. > > Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> > Signed-off-by: Yicong Yang <yangyicong@hisilicon.com> > --- > drivers/hwtracing/ptt/hisi_ptt.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/hwtracing/ptt/hisi_ptt.c b/drivers/hwtracing/ptt/hisi_ptt.c > index 5c7e93e7705f..ff2c16efe5b1 100644 > --- a/drivers/hwtracing/ptt/hisi_ptt.c > +++ b/drivers/hwtracing/ptt/hisi_ptt.c > @@ -1210,7 +1210,7 @@ static int hisi_ptt_register_pmu(struct hisi_ptt *hisi_ptt) > > hisi_ptt->hisi_ptt_pmu = (struct pmu) { > .module = THIS_MODULE, > - .capabilities = PERF_PMU_CAP_EXCLUSIVE | PERF_PMU_CAP_ITRACE, > + .capabilities = PERF_PMU_CAP_NO_EXCLUDE, According to the error prompt of function hisi_ptt_trace_start(). https://elixir.bootlin.com/linux/v6.4-rc7/source/drivers/hwtracing/ptt/hisi_ptt.c#L197 You may be need to keep advertise PERF_PMU_CAP_EXCLUSIVE? Such pmus can only have one event scheduled at a time, if not the perf tool will report device busy. Best regards, Junhao. > .task_ctx_nr = perf_sw_context, > .attr_groups = hisi_ptt_pmu_groups, > .event_init = hisi_ptt_pmu_event_init,
Hi Junhao, On 2023/6/19 21:00, hejunhao wrote: > Hi, Yicong > > > On 2023/6/6 22:22, Yicong Yang wrote: >> From: Yicong Yang <yangyicong@hisilicon.com> >> >> The PTT trace collects PCIe TLP headers from the PCIe link and don't >> have the ability to exclude certain context. It doesn't support itrace >> as well. So only advertise PERF_PMU_CAP_NO_EXCLUDE. This will greatly >> save the storage of final data. Tested tracing idle link for ~15s, >> without this patch we'll collect ~28.682MB data for context related >> information and with this patch it reduced to ~0.226MB. >> >> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> >> Signed-off-by: Yicong Yang <yangyicong@hisilicon.com> >> --- >> drivers/hwtracing/ptt/hisi_ptt.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/hwtracing/ptt/hisi_ptt.c b/drivers/hwtracing/ptt/hisi_ptt.c >> index 5c7e93e7705f..ff2c16efe5b1 100644 >> --- a/drivers/hwtracing/ptt/hisi_ptt.c >> +++ b/drivers/hwtracing/ptt/hisi_ptt.c >> @@ -1210,7 +1210,7 @@ static int hisi_ptt_register_pmu(struct hisi_ptt *hisi_ptt) >> hisi_ptt->hisi_ptt_pmu = (struct pmu) { >> .module = THIS_MODULE, >> - .capabilities = PERF_PMU_CAP_EXCLUSIVE | PERF_PMU_CAP_ITRACE, >> + .capabilities = PERF_PMU_CAP_NO_EXCLUDE, > > According to the error prompt of function hisi_ptt_trace_start(). > https://elixir.bootlin.com/linux/v6.4-rc7/source/drivers/hwtracing/ptt/hisi_ptt.c#L197 > > You may be need to keep advertise PERF_PMU_CAP_EXCLUSIVE? > Such pmus can only have one event scheduled at a time, if not the perf > tool will report device busy. > Thanks for point it out. Checking [1] I think we still need this flag here, will add it back. [1] https://github.com/torvalds/linux/blob/v6.4-rc6/kernel/events/core.c#L5054 Thanks.
diff --git a/drivers/hwtracing/ptt/hisi_ptt.c b/drivers/hwtracing/ptt/hisi_ptt.c index 5c7e93e7705f..ff2c16efe5b1 100644 --- a/drivers/hwtracing/ptt/hisi_ptt.c +++ b/drivers/hwtracing/ptt/hisi_ptt.c @@ -1210,7 +1210,7 @@ static int hisi_ptt_register_pmu(struct hisi_ptt *hisi_ptt) hisi_ptt->hisi_ptt_pmu = (struct pmu) { .module = THIS_MODULE, - .capabilities = PERF_PMU_CAP_EXCLUSIVE | PERF_PMU_CAP_ITRACE, + .capabilities = PERF_PMU_CAP_NO_EXCLUDE, .task_ctx_nr = perf_sw_context, .attr_groups = hisi_ptt_pmu_groups, .event_init = hisi_ptt_pmu_event_init,