Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2380166pxb; Mon, 19 Apr 2021 04:31:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXp8P963SCliOqESLKdqB08HZJ4q+BjVOsLTrAu2V9gL0lsCiCt3inGJE7WnuRcWc9y/jr X-Received: by 2002:a17:907:75d9:: with SMTP id jl25mr21337782ejc.420.1618831900437; Mon, 19 Apr 2021 04:31:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618831900; cv=none; d=google.com; s=arc-20160816; b=s1PLiKzQ8PzcTnVntunTYNG0VMIgarT3ASOjAg6y3Z3uijv7Mm9a9VOVFe1XhA4q0s M4WDxTBHyKhsETGDHrToUyd0QFnwCkJxD5jT3Z5divnP7+FQkaH6d6I1Kc9g1cR/F7lv f8fb6HsNmBFql7PTawSYgdDzRLtIzxIVLpUPSe3/iyOcAtQ21lp1Uv72puukbqywywEa f5nz6aFDyTn8HqzyZoz+Jx7ELxFYvlVo8wT2duhsHgflsaQJMWMSYPflfMl0BfQ1fdtm zb5sPlQD8bZipk8Vfa5Tmiu4SQAqZJaPyTu0IjFPq16T+fbyMkTEs8Ft4KvYMDx073z4 VMPA== 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=cIzRB71xvzcRsSPRqWHgzN9DiE2u1vNbfWMZU4JvZts=; b=INF/LAeMWwImR5STyrIoMGSDfD/jZg15aAsrRbLcTJq5t1w5f+MOU+LU2UZXpKEh3B Pza8m6NtCR/1Mg5ZEu3ytP2oZknPVK4ECX05tgLnY+qugYQZSJfmfVLJqvnauSVIxdIB xPKWX4L2u5cYxx1w6Z0NqqmrStnVYXWNPO/kVCAOL//6oiSE4y94Y9rLO81emAlinDJk Oac/wx0tk2wjVViXPujEUjXS2ETnkDIZnIPNFN2LqIuLmQ5dIXgWUu/r6xopYkLyuHqC fQJppL11KwP/cIv4WHatX1ApYldBDrNpaCIRGDXElkn1vXd03DMUXY1oBs2hB/sc8jU/ vg+A== 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 t1si11794844edd.379.2021.04.19.04.31.16; Mon, 19 Apr 2021 04:31:40 -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 S234074AbhDSLSQ (ORCPT + 99 others); Mon, 19 Apr 2021 07:18:16 -0400 Received: from foss.arm.com ([217.140.110.172]:40792 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233486AbhDSLSQ (ORCPT ); Mon, 19 Apr 2021 07:18:16 -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 431B031B; Mon, 19 Apr 2021 04:17:46 -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 3C2623F792; Mon, 19 Apr 2021 04:17:43 -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> From: Suzuki K Poulose Message-ID: <529defac-cd67-3a7b-91d3-76eb0bb9dc6c@arm.com> Date: Mon, 19 Apr 2021 12:17:41 +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: <1618654631-42454-1-git-send-email-yangyicong@hisilicon.com> 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 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. Also, please move your driver to drivers/perf/ As Alex mentioned, the ETM drivers were initially developed when the AUX buffer was not available. The sysfs interface is there only for the backward compatibility and for bring up ( due to the nature of the connections between the CoreSight components and sometimes the missing engineering spec). Suzuki