From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53D82C433ED for ; Mon, 19 Apr 2021 16:11:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1E87E6101C for ; Mon, 19 Apr 2021 16:11:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233604AbhDSQMX (ORCPT ); Mon, 19 Apr 2021 12:12:23 -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-pci@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