Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2750919pxb; Mon, 19 Apr 2021 12:59:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyrj1tO7Vh7GZUR25jCRSnB2fWwW5nxPUUvj4HGMJaPGQeRaLFr2Id30sp4BEvFSJ6t149 X-Received: by 2002:a17:906:2b03:: with SMTP id a3mr24514803ejg.481.1618862386836; Mon, 19 Apr 2021 12:59:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618862386; cv=none; d=google.com; s=arc-20160816; b=mweT3ENyDMb4E/OYZ8UXnOA6s3iQpZ3XtibS4whCKtNK0RvpHJ5R19JESkYSbj1jqt VNK1JatUUASiAJaStWgyEtQ2hw4iaHfRS81Wumi0XJuUrlDHHDwdJqbXyUuM8uIGQ7iz v321TY6dFh/cGXt7TFWLa+Hixpf5j6M4RSW4MLk/Ter7Q3Fy9bb+GPjgcCznBg8CJKQQ gTdMfO06aKbiWR3tkp7kauygVxGKxxBpvYsOPwYqlErHbVujVOangYUQKKcOIe67H5iV 7ORKUnnS9PRZ9p5V44og4wRuJwMdNS1aN0UnbO2JKkdYwUmjMUhXIyx6F918Lqo0NgJA EitA== 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=TBfzcoZWDp3yF7NJNsd0wrimBLaDMCTqb+lQEG2NLIQ=; b=m6jiWyp9oVILuy93lLulteKNteWFDV2v4r1xnICu7w8a5L64X4TQjU0v9FXO+ytqJr eKpFSPMWDj4UinLrEKisxYxdf9F4FfcywbanZJESzg0+ztnlTBunV5kk+f7K7U4Jf6/S pplDR7dGThPkoM22aE77FizzgSjDHlwwImc4tcJRHnu7hum/MriwdNVSPeiNfSHtjsOQ kSUxA46cxr3RsoAsvramXd3j5ppntjMinuvQIp2m0MeGtuX83FdisIHycjnrCmM2BNMo ICl90Hhw2u/L2+pFFY7VEfOLdKXya35zGwbcs8RHwE+uxkwxIHfYC7QQ3CUWx6fKXdTX OPtA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n4si10846135eji.301.2021.04.19.12.59.22; Mon, 19 Apr 2021 12:59:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232633AbhDSQMY (ORCPT + 99 others); Mon, 19 Apr 2021 12:12:24 -0400 Received: from foss.arm.com ([217.140.110.172]:45894 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230160AbhDSQMV (ORCPT ); Mon, 19 Apr 2021 12:12:21 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B538F1478; Mon, 19 Apr 2021 09:11:50 -0700 (PDT) Received: from [10.57.66.181] (unknown [10.57.66.181]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A15143F7D7; Mon, 19 Apr 2021 09:11:47 -0700 (PDT) Subject: Re: [PATCH RESEND 0/4] Add support for HiSilicon PCIe Tune and Trace device To: Yicong Yang , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org, linux-pci@vger.kernel.org Cc: alexander.shishkin@linux.intel.com, helgaas@kernel.org, gregkh@linuxfoundation.org, lorenzo.pieralisi@arm.com, will@kernel.org, mark.rutland@arm.com, mathieu.poirier@linaro.org, mike.leach@linaro.org, leo.yan@linaro.org, jonathan.cameron@huawei.com, song.bao.hua@hisilicon.com, john.garry@huawei.com, prime.zeng@huawei.com, liuqi115@huawei.com, zhangshaokun@hisilicon.com, linuxarm@huawei.com References: <1618654631-42454-1-git-send-email-yangyicong@hisilicon.com> <529defac-cd67-3a7b-91d3-76eb0bb9dc6c@arm.com> From: Suzuki K Poulose Message-ID: Date: Mon, 19 Apr 2021 17:11:46 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19/04/2021 14:21, Yicong Yang wrote: > On 2021/4/19 19:17, Suzuki K Poulose wrote: >> On 17/04/2021 11:17, Yicong Yang wrote: >>> [RESEND with perf and coresight folks Cc'ed] >>> >>> HiSilicon PCIe tune and trace device (PTT) is a PCIe Root Complex >>> integrated Endpoint (RCiEP) device, providing the capability >>> to dynamically monitor and tune the PCIe traffic (tune), >>> and trace the TLP headers (trace). >>> >>> PTT tune is designed for monitoring and adjusting PCIe link parameters. >>> We provide several parameters of the PCIe link. Through the driver, >>> user can adjust the value of certain parameter to affect the PCIe link >>> for the purpose of enhancing the performance in certian situation. >> >> ... >> >>> >>> The reason for not using perf is because there is no current support >>> for uncore tracing in the perf facilities. We have our own format >>> of data and don't need perf doing the parsing. The setting through >>> perf tools doesn't seem to be friendly as well. For example, >>> we cannot count on perf to decode the usual format BDF number like >>> ::., which user can use to filter the TLP >>> headers through the PTT device. >>> >>> A similar approach for implementing this function is ETM, which use >>> sysfs for configuring and a character device for dumping data. >>> >>> Greg has some comments on our implementation and doesn't advocate >>> to build driver on debugfs [1]. So I resend this series to >>> collect more feedbacks on the implementation of this driver. >>> >>> Hi perf and ETM related experts, is it suggested to adapt this driver >>> to perf? Or is the debugfs approach acceptable? Otherwise use >>> sysfs + character device like ETM and use perf tools for decoding it? >>> Any comments is welcomed. >> >> Please use perf. Debugfs / sysfs is not the right place for these things. >> > > ok. > >> Also, please move your driver to drivers/perf/ >> > > Does it make sense as it's a tuning and tracing device, and doesn't have counters > nor do the sampling like usual PMU device under drivers/perf/. It doesn't matter. As long as you can drive it via the perf interface, it can live there. The CoreSight was added way before there was kind of a suitable place like the above. You could find other uncore PMUs under drivers/perf. Suzuki