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=-3.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 8B7DAC433E0 for ; Tue, 16 Feb 2021 12:14:18 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 2E95F64DA1 for ; Tue, 16 Feb 2021 12:14:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2E95F64DA1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=LU0vhfmMsvZzUjK41NV0OC87MzwMCeGz5YJUTl5zSzI=; b=KesLP8qiBhqEfvJSO3KQn6ZO/ WO9GY3IQLqkMtvSv4u4yRh/m/2sxlffRMay7sOHeuFtBBQOkZSfW4jXQArtCcxXdhgE1J9Lz8XGkA t0gcctcV8uluflJ7igHbaNTdSgAuhKQE4XEnZCeuEaADQ7NudJXfD/KzSD2iD8djRi5aFtdFwYDxE XDs4lrjM9gCoWdCzLiJPDnF6JpFEyVlyrK2+beGytFtII+tZo/hpo3EDXx6pWWm4tfq9augdAa15S 1z3eCfOpcgCcxFWbR3r1T9Uwf8J1AgTw0TVctkUnhhI1fTOrtaIMiYPv34F8kwmw5tkcaPIlnFnND S2Mg8IFWA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lBzDl-00010E-6Q; Tue, 16 Feb 2021 12:12:49 +0000 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lBzDi-0000zX-BB for linux-arm-kernel@lists.infradead.org; Tue, 16 Feb 2021 12:12:48 +0000 Received: by mail-wr1-x42a.google.com with SMTP id v1so12645849wrd.6 for ; Tue, 16 Feb 2021 04:12:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1tsTvIQT2HRdZdmNSzbDR0FzDHX8P9VZOoQPmJWXrOI=; b=qNYezyEzJayl10gqLAG43PrqWHTd1WSC68//XU5J8pngSNSa7ac9TqSAov3/+p7cWF 94bmocWeg7HEdLp0VRIxYih3gmUZOsMtAEOF0S9V5rQhUXdjS3lA3yLztIVkgNVI9FOl 6AU9cr9TdFce4KZhyZyfL6sJpoYCCDSI6BAELRWhKIiUABhkWDl8qQNiadfYhbyl/bm3 JL5d+ZB3LAq0eaHHSWxCooqc4l/cx5kzpv/F3aq145VQBRyxAjSRqkoQ6HiZk2Scz4Nt x7skaMHdHvunM7w6BK829t5W8d8Bg6pYiYc4Q2x5QIF/AoPuih5xq2Gx9qUCpW/EHOXz 2X5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1tsTvIQT2HRdZdmNSzbDR0FzDHX8P9VZOoQPmJWXrOI=; b=oJ14vAHmNiwofFvMfK2y7utiJZks9XapFaVUo9VdjCzwvBJN7gZh0LIyDeZKx/e07Z uoCj3hbALx3uK7hefQZOkUnGryuuFOxoo5RA3tZW/dsuwFGeZUiCxH5ya0jG02LRH0KA MATKW5oUXfA99FxOBxt+AZH6mOsgNhI+EiEK5YvZ7r6CKdo5rzUExGLYiNSK1AYBqHmT JTsyrWI8aoxnHV1GoW694rgsZWSrfnpVW7vsQy/1KYkcbFs99kNkwX8pwCWp0yn19NXY ALwfNbfghjf0vLxPkGB0wCmKn7M1+ehRCGyv6H4QSMrIx8OizdQKrq6cCeryRF4DXftG XjFA== X-Gm-Message-State: AOAM533emyCq4xe2D8wUDzBP7SwEJsJBWjdaFj8dcnmv/ra5Zirw+dgc vTuNHP0Uzdkc3+hfVM4CFfRgpGvscx1J7FI/HNf2iQ== X-Google-Smtp-Source: ABdhPJwwW44neKwsoD97iVe7HBmh7M03FPX4vFgMoogx892QDoevHe9LgDLbnQrqzrJ9ueNxb3hOhGAcJJTNwtDu/s0= X-Received: by 2002:adf:e884:: with SMTP id d4mr22760951wrm.275.1613477563677; Tue, 16 Feb 2021 04:12:43 -0800 (PST) MIME-Version: 1.0 References: <1611737738-1493-1-git-send-email-anshuman.khandual@arm.com> <1611737738-1493-12-git-send-email-anshuman.khandual@arm.com> <20210212202628.GC2692426@xps15> <9ca3b9da-dded-1206-e048-835590b2265e@arm.com> <7b20f8b3-4efa-530f-b058-1aae13e4e43e@arm.com> In-Reply-To: <7b20f8b3-4efa-530f-b058-1aae13e4e43e@arm.com> From: Mike Leach Date: Tue, 16 Feb 2021 12:12:32 +0000 Message-ID: Subject: Re: [PATCH V3 11/14] coresight: sink: Add TRBE driver To: Anshuman Khandual X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210216_071246_730644_D7D67892 X-CRM114-Status: GOOD ( 39.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mathieu Poirier , "Suzuki K. Poulose" , Coresight ML , Linux Kernel Mailing List , linux-arm-kernel , Linu Cherian Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Anshuman, On Tue, 16 Feb 2021 at 09:44, Anshuman Khandual wrote: > > Hello Mike, > > On 2/16/21 2:30 PM, Mike Leach wrote: > > Hi Anshuman, > > > > There have been plenty of detailed comments so I will restrict mine to > > a few general issues:- > > > > 1) Currently there appears to be no sysfs support (I cannot see the > > MODE_SYSFS constants running alongside the MODE_PERF ones present in > > the other sink drivers). This is present on all other coresight > > devices, and must be provided for this device. It is useful for > > testing, and there are users out there who will have scripts to use > > it. It is not essential it makes it into this set, but should be a > > follow up set. > > Sure, will try and add it in a follow up series. > > > > > 2) Using FILL mode for TRBE means that the trace will by definition be > > lossy. Fill mode will halt collection without cleanly stopping and > > flushing the source. This will result in the sink missing the last of > > the data from the source as it stops. Even if taking the exception > > moves into a prohibited region there is still the possibility the last > > trace operations will not be seen. Further it is possible that the > > last few bytes of trace will be an incomplete packet, and indeed the > > start of the next buffer could contain incomplete packets too. > > Just wondering why TRBE and ETE would not sync with each other in order > for the ETE to possibly resend all the lost trace data, when the TRBE > runs out of buffer and wrappers around ? The ETE and TRBE are separate devices - there is no feedback between them. The ETE can also send to external sinks. Given the rate of trace generation, buffering enough trace in the ETE to resend is not realistic, and would be very complicated in terms of hardware. Therefore the solution is to stop the source (disable ETE or prohibit using TFR), flush (TSB CSYNC), then stop collection. A TSB CSYNC without stopping the ETE, or after TRBE has stopped collection will have no effect in terms of getting cleanly stopped trace into the buffer. > Is this ETE/TRBE behavior same > for all implementations in the FILL mode ? Just wondering. > Yes - there is nothing in either spec that would suggest otherwise. > > > > This operation differs from the other sinks which will only halt after > > the sources have stopped and the path has been flushed. This ensures > > that the latest trace is complete. The weakness with the older sinks > > is the lack of interrupt meaning buffers were frequently wrapped so > > that only the latest trace is available. > > Right. > > > > > By using TRBE WRAP mode, with a watermark as described in the TRBE > > spec, using the interrupts it is possible to approach lossless trace > > in a way that is not possible with earlier ETR/ETB. This is somethin > Using TRBTRG_EL1 as the above mentioned watermark ? > Using TRBTRG_EL1 precludes using the ETE Event triggers for activating and marking trace. It is preferable to use the write pointer offset from the initial base to allow a portion of the buffer to be filled after wrap. This a little more complex but more flexible in terms of ETE usage. > > that has been requested by partners since trace became available in > > linux systems. (There is still a possibility of loss due to filling > > the buffer completely and overflowing the watermark, but that can be > > flagged). > > > > While FILL mode trace is a good start, and suitable for some scenarios > > - WRAP mode needs implementing as well. > > I would like to understand this mechanism more. Besides how the perf > interface suppose to choose between FILL and WRAP mode ? via a new > event attribute ? > That is an open question. Event option is one possibility, configfs or compile time options are others. Probably have to look at the performance of wrap mode and decide if it could be used all the time or if FILL still has value. We are in the early days of ETE / TRBE development here. I do not think there is anything wrong with using FILL as a first step. as long as the limitations are well understood. Regards Mike > > > > 3) Padding: To be clear, it is not safe for the decoder to run off the > > end of one buffer, into the padding area and continue decoding, or > > continue through the padding into the next buffer. However I believe > > the buffer start / stop points are demarked by the aux_output_start / > > aux_output_end calls? > > Yes. > > > > > With upcoming perf decode updates this should enable the decoder to > > correctly be started and stopped on the buffer boundaries. The padding > > is there primarily to ensure that the decoder does not synchronize > > with the data stream until a genuine sync point is found. > > Right. > > > > > 4) TRBE needs to be a loadable module like the rest of coresight. > > Even though the driver has all the module constructs, the Kconfig was > missing a tristate value, which is being fixed for the next version. > > - Anshuman -- Mike Leach Principal Engineer, ARM Ltd. Manchester Design Centre. UK _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel