Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3238346rwb; Tue, 8 Nov 2022 02:07:45 -0800 (PST) X-Google-Smtp-Source: AMsMyM6R4a3i5DKQz1NU7sKMcamJI8JpB/7DP9Luw4djFEXvDJUNqsoh5X3D8CHlwDTv5jp00eso X-Received: by 2002:a17:906:e214:b0:7ae:3c5c:399a with SMTP id gf20-20020a170906e21400b007ae3c5c399amr18644767ejb.650.1667902065300; Tue, 08 Nov 2022 02:07:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667902065; cv=none; d=google.com; s=arc-20160816; b=mMCHXXg5bhARaxhKs4nXO4dmqvLxI0UGI9eyJz+g7Mf5SXI68PwkW+52gMe/XYlExG uhwHrWDiImt/3jGJnU9rGTUiFfgClS5b2tWabhzKbriTi5fkMrdQeIsGguukGR9W7ZbO HmBrcgXk3hBL9uJKEacdsJAxQsuTlM38E+oQriLkuUptwXf/+YrjT8dmyVR+P9ubAuE0 oDm0g4+L9GvvJY0algh3HwX4H8/xtG2v9qJQ5lQ9nj778NDCmS5VZdxUoec1hiTdKRDh +cL2c/+ke6cKb8aY4SV61aUuX4OS7qFT8YvwiapuBuNcnt0u8D9HW2GhZdIZm0ZHX9HQ Gtgw== 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:references :cc:to:from:subject:user-agent:mime-version:date:message-id; bh=RjkQq/wdYODp5pXWFMRl1GvlSIPkBuIRVw9Uo+TTN40=; b=Ovq11BTJyy/OYYfvmkXV9cmZQbpecc2E/EVOUh0JYY2fXFODcrkkpsDuiVoiDhxlxN O9g00tlGRx+MwHfWXbfx2Otb1gUCDYvF35r4G5HvzwUz285/0eHEK+mc00oe6dQxAcBK s2RgvpQER4okJ3WzDbTBcu4U/rRqEqe2fIB0xbfpuGkwfuOxsgWMADcbWLtPkt4UgMZA n41leFXd33H8/1M5CM3TtSr9J3SNKBlKucApZ88el6GaAGbkLLoQwDD+SAc45g74WOyq YCxXAIowiDITEvU+TpfShR04zdpfKH1/Ct3WaoPXh5VYKVA2Vx9Gk+YXmwMN+hlMYfT2 DaXg== 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=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i3-20020a0564020f0300b00458ff6921e6si11996814eda.79.2022.11.08.02.07.22; Tue, 08 Nov 2022 02:07:45 -0800 (PST) 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=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233494AbiKHJlM (ORCPT + 90 others); Tue, 8 Nov 2022 04:41:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233761AbiKHJlA (ORCPT ); Tue, 8 Nov 2022 04:41:00 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3AED53134B; Tue, 8 Nov 2022 01:40:59 -0800 (PST) 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 217251FB; Tue, 8 Nov 2022 01:41:05 -0800 (PST) Received: from [10.57.67.115] (unknown [10.57.67.115]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7A8493F534; Tue, 8 Nov 2022 01:40:56 -0800 (PST) Message-ID: <64c239e6-2df9-fd98-ee1e-151218d0d070@arm.com> Date: Tue, 8 Nov 2022 09:40:54 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: [PATCH v14 0/9] Coresight: Add support for TPDM and TPDA From: Suzuki K Poulose To: Jinlong Mao , Mathieu Poirier , Alexander Shishkin , Konrad Dybcio , Mike Leach Cc: Leo Yan , Greg Kroah-Hartman , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Tingwei Zhang , Yuanfang Zhang , Tao Zhang , Trilok Soni , Hao Zhang , linux-arm-msm@vger.kernel.org, Bjorn Andersson References: <20221102091915.15281-1-quic_jinlmao@quicinc.com> <69a3cd4b-c4b0-b998-b4c1-70a928690972@arm.com> <102a8c21-2b78-56ca-874a-194e878dff8f@quicinc.com> <9072665a-f019-975b-7b3b-d3f37ea71425@arm.com> In-Reply-To: <9072665a-f019-975b-7b3b-d3f37ea71425@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE 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 On 08/11/2022 09:37, Suzuki K Poulose wrote: > On 08/11/2022 05:54, Jinlong Mao wrote: >> >> On 11/8/2022 2:38 AM, Suzuki K Poulose wrote: >>> On 02/11/2022 09:19, Mao Jinlong wrote: >>>> This series adds support for the trace performance monitoring and >>>> diagnostics hardware (TPDM and TPDA). It is composed of two major >>>> elements. >>>> a) Changes for original coresight framework to support for TPDM and >>>> TPDA. >>>> b) Add driver code for TPDM and TPDA. >>>> >>>> Introduction of changes for original coresight framework >>>> Support TPDM as new coresight source. >>>> Since only STM and ETM are supported as coresight source originally. >>>> TPDM is a newly added coresight source. We need to change >>>> the original way of saving coresight path to support more types source >>>> for coresight driver. >>>> The following patch is to add support more coresight sources. >>>>      coresight: core: Use IDR for non-cpu bound sources' paths. >>>> >>> ---8>--- >>> >>>> Introduction of TPDM and TPDA >>>> TPDM - The trace performance monitoring and diagnostics monitor or >>>> TPDM in >>>> short serves as data collection component for various dataset types >>>> specified in the QPMDA(Qualcomm performance monitoring and diagnostics >>>> architecture) spec. The primary use case of the TPDM is to collect data >>>> from different data sources and send it to a TPDA for packetization, >>>> timestamping and funneling. >>>>       Coresight: Add coresight TPDM source driver >>>>       dt-bindings: arm: Adds CoreSight TPDM hardware definitions >>>>       coresight-tpdm: Add DSB dataset support >>>>       coresight-tpdm: Add integration test support >>>>       docs: sysfs: coresight: Add sysfs ABI documentation for TPDM >>>> >>>> TPDA - The trace performance monitoring and diagnostics aggregator or >>>> TPDA in short serves as an arbitration and packetization engine for the >>>> performance monitoring and diagnostics network as specified in the >>>> QPMDA >>>> (Qualcomm performance monitoring and diagnostics architecture) >>>> specification. The primary use case of the TPDA is to provide >>>> packetization, funneling and timestamping of Monitor data as specified >>>> in the QPMDA specification. >>>> The following patch is to add driver for TPDA. >>>>       Coresight: Add TPDA link driver >>>>       dt-bindings: arm: Adds CoreSight TPDA hardware definitions >>>> >>>> The last patch of this series is a device tree modification, which add >>>> the TPDM and TPDA configuration to device tree for validating. >>>>      ARM: dts: msm: Add coresight components for SM8250 >>>>      ARM: dts: msm: Add tpdm mm/prng for sm8250 >>>> >>>> Once this series patches are applied properly, the tpdm and tpda nodes >>>> should be observed at the coresight path /sys/bus/coresight/devices >>>> e.g. >>>> /sys/bus/coresight/devices # ls -l | grep tpd >>>> tpda0 -> ../../../devices/platform/soc@0/6004000.tpda/tpda0 >>>> tpdm0 -> ../../../devices/platform/soc@0/6c08000.mm.tpdm/tpdm0 >>>> >>>> We can use the commands are similar to the below to validate TPDMs. >>>> Enable coresight sink first. >>>> >>>> echo 1 > /sys/bus/coresight/devices/tmc_etf0/enable_sink >>>> echo 1 > /sys/bus/coresight/devices/tpdm0/enable_source >>>> echo 1 > /sys/bus/coresight/devices/tpdm0/integration_test >>>> echo 2 > /sys/bus/coresight/devices/tpdm0/integration_test >>>> The test data will be collected in the coresight sink which is enabled. >>>> If rwp register of the sink is keeping updating when do >>>> integration_test (by cat tmc_etf0/mgmt/rwp), it means there is data >>>> generated from TPDM to sink. >>>> >>>> There must be a tpda between tpdm and the sink. When there are some >>>> other trace event hw components in the same HW block with tpdm, tpdm >>>> and these hw components will connect to the coresight funnel. When >>>> there is only tpdm trace hw in the HW block, tpdm will connect to >>>> tpda directly. >>>>         +---------------+                +-------------+ >>>>      |  tpdm@6c08000 |                |tpdm@684C000 | >>>>      +-------|-------+                +------|------+ >>>>              |                               | >>>>      +-------|-------+                       | >>>>      | funnel@6c0b000|                       | >>>>      +-------|-------+                       | >>>>              |                               | >>>>      +-------|-------+                       | >>>>      |funnel@6c2d000 |                       | >>>>      +-------|-------+                       | >>>>              |                               | >>>>              |    +---------------+          | >>>>              +----- tpda@6004000  -----------+ >>>>                   +-------|-------+ >>>>                           | >>>>                   +-------|-------+ >>>>                   |funnel@6005000 | >>>>                   +---------------+ >>>> >>> >>> --8<-- >>> >>> Please could you add the above to a Documentation file (Of course >>> skip the description of patches). >> Sure. I will add them to the Documentation file. >>> >>> >>>> This patch series depends on patch series: >>>> "[v5,00/14] coresight: Add new API to allocate trace source ID values" >>>> https://patchwork.kernel.org/project/linux-arm-kernel/cover/20221101163103.17921-1-mike.leach@linaro.org/ >>> >>> So, is there a strict binding between a TPDM and a TPDA ? >>> i.e., Multiple TPDMs could never end up reaching the sam >>> TPDA ? I see that the TPDMs could be connected to funnels >>> and thus other TPDMs could be connected to the same funnels >>> and thus reach the same TPDA. >> There is no strict binding between TPDM and TPDA. >> TPDA can have multiple TPDMs connect to it. >> But There must be only one TPDA in the path from the TPDM source to >> TMC sink. >> TPDM can directly connect to TPDA's inport >> or connect to funnel which will connect to TPDA's inport. >>> >>> Also, the trace-id is bound to TPDA and not TPDM. So, if >>> we have multiple TPDMs, trace decoding is going to be >>> impossible. >> The TPDMs which are connected to same TPDA shares the same >> trace-id. When TPDA does packetization, different port will have >> unique channel number for decoding. So this assumes that nobody connects two TPDMs to a funnel, which then connects to a TPDA ? (i.e. tpdm@684C000 above must not be connected to funnel@6c0b000 or funnel@6c2d000). In which case, two of them end up in the same port of the TPDA. Suzuki