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 481FBC433B4 for ; Mon, 19 Apr 2021 16:11:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0E47D61246 for ; Mon, 19 Apr 2021 16:11:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233705AbhDSQMY (ORCPT ); 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 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 072C4C433B4 for ; Mon, 19 Apr 2021 16:14:00 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8127661246 for ; Mon, 19 Apr 2021 16:13:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8127661246 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=YdF/4xda3Hf8cN22NmryBNDrECAIvcCciQfiUIKerGY=; b=AKolKrNOV8uy0DjRI0V69sD+s zFJG4Npe8uj19CbRnHrZRac6JGnWWFIOx+lkzjjDS6hwjX04WihExka0F6EUc3R0rviJ3ejxvTnz2 VU94fjG7i6TKGmrdLvtxbHdXNb5b2FKm8o6CW2x9k3pRIAXrxdCNHe79upk2xtUAAsZIeA7DuiI1w knTFGC7IGO8ab+0FGb6C3zm3owEkJt66yk60zSOwUSUeRrEk/LpcJCuK2yGTAJMMJWteoRF44wk4V 7Qc2A6StgdoTgeRZJQ9smEysthhC+QEruDR+Mumt7v1KS1mw13xqkRKj7EJPKT7QCgzth8V++WkZr xXX/0vV6g==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lYWVJ-00AFMo-At; Mon, 19 Apr 2021 16:12:05 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lYWVG-00AFMX-Fc for linux-arm-kernel@desiato.infradead.org; Mon, 19 Apr 2021 16:12:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description; bh=TBfzcoZWDp3yF7NJNsd0wrimBLaDMCTqb+lQEG2NLIQ=; b=4BmwEin460qtyroUkRl1j3XmUh tbrnHGym4e1vjCoVbheMyo696Kgo5jWhqKtlJ+XPNwiFdeHKteTB0LVfTBSventwyr/LIp0lOYuhL bfThpEAa90UOInEs0jBGPD9Gw5iLNh/9DNy8v+twC7d24qc5beWBqpGyJ05+RzXBO1Xtg3OHHlmW/ 2ey1lDRO8Ifs4B5AXgauA1lxHS4l1164dlYuLKiKDcHOljJEdUNQa1AaTUktN5UXhyDe6CM5gHPp2 pvTmWsVyZEnr3SUBxQck5htTi5YWoCn/O9hymiiFl8GxnXOgvYnFZSlbhVxuys4TUzZxJhGllDAhu cTE2rSeA==; Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lYWVD-00BW3J-MJ for linux-arm-kernel@lists.infradead.org; Mon, 19 Apr 2021 16:12:01 +0000 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-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210419_091159_807419_0CDB0EA4 X-CRM114-Status: GOOD ( 20.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel