Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp7513584rwd; Tue, 20 Jun 2023 02:13:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6IyWbxrURMWGO5GI8ivm4ewQAIHZLj+5DMAhe4eGi94CImWpyAJIkEoraLiya2Ve7qqoNc X-Received: by 2002:a17:903:1112:b0:1a6:74f6:fa92 with SMTP id n18-20020a170903111200b001a674f6fa92mr11636935plh.19.1687252435554; Tue, 20 Jun 2023 02:13:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687252435; cv=none; d=google.com; s=arc-20160816; b=gXZTAxlIzcz+V6+YsYUro9C10cC7QT2YwECcKGmGTik0uj+OJjTskj40LsrM/ck0c4 jhlS/TiFah07HnfQ8rrsYL+CBSSaFQElVVS8TowtF1pxpRzY7rffSqvXbhJDhAX9oEjD KNgjm1DJZ11j1u6XBSfo1dslbS761/bpvBAewyON2buCWuQ9T5/KmyGjTRuBVR9LAweS IJwy8pJmKkrfAd6AFUBfZ9Vj3eoUpwIi21ygIuy8wzzFwAbUIzVSjdO4gwAu2Kf5+xT2 XqZ/Vh6bFZK0+qSMt6f3s8XXEkXcXA/EoRUnDrrgoZ3CZ5skks/4CYQYpKdm92Cb7uet WvzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:to:subject :cc; bh=D0Jt5X4eoXr9jEJmJTUZAm58Aet0IiWagCaur3jS2Og=; b=fPeH4eBAMZCruin+3A2v8ph2sq4PU/VdgQm81fwwYX4b4qtbp0QpTNJbNZBh3GclsI anZpbc8T0T6LhRDrtY0rBpVKc5eELVaGiMCI6i6+Tk8bVOToYU1vZwRBWGq5zhX34AjD ARkkK/wRFF5X2zjIleeXkdhUf6ne1v5b15RpKeOl7mPjh/E5woHGHCPgIVD0PRk7Gw5Y HxjlvIPZGMgatoEPkot68ey2+H1HOaTJJLh/bxx49Nrw71+nUfufBQTOA9k1NqLYty7W KhiknhlBelTFYEW1Um5P96hSh8HgbWJ/T5OhmFKfemv0G9HLdoylUiEu7jwDJyV9kc1v JrGw== 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 ay7-20020a1709028b8700b001ab1a00d95dsi1443199plb.250.2023.06.20.02.13.43; Tue, 20 Jun 2023 02:13:55 -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 S231429AbjFTJJ7 (ORCPT + 99 others); Tue, 20 Jun 2023 05:09:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229597AbjFTJJ5 (ORCPT ); Tue, 20 Jun 2023 05:09:57 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF572C9; Tue, 20 Jun 2023 02:09:54 -0700 (PDT) Received: from canpemm500009.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4QlgnP0kByz1FDfh; Tue, 20 Jun 2023 17:09:45 +0800 (CST) Received: from [10.67.102.169] (10.67.102.169) 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.27; Tue, 20 Jun 2023 17:09:46 +0800 CC: , , , , Subject: Re: [PATCH v4 4/5] hwtracing: hisi_ptt: Advertise PERF_PMU_CAP_NO_EXCLUDE for PTT PMU To: hejunhao , , , , , , References: <20230606142244.10939-1-yangyicong@huawei.com> <20230606142244.10939-5-yangyicong@huawei.com> <01c39cb9-e56a-862b-2d99-024b7ba5a769@huawei.com> From: Yicong Yang Message-ID: Date: Tue, 20 Jun 2023 17:09:46 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: <01c39cb9-e56a-862b-2d99-024b7ba5a769@huawei.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.102.169] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To canpemm500009.china.huawei.com (7.192.105.203) 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, URIBL_BLOCKED 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 Hi Junhao, On 2023/6/19 21:00, hejunhao wrote: > Hi, Yicong > > > On 2023/6/6 22:22, Yicong Yang wrote: >> From: Yicong Yang >> >> 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 >> Signed-off-by: Yicong Yang >> --- >> ? 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.