Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5571167pxb; Tue, 16 Feb 2021 01:46:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJyBbkTd1ffOxnC6F/lvjdunBIz0c/YWI0p9nS14n6ITnqfUHvBPdGlfD7Zxb8Ty/c8wMFOv X-Received: by 2002:aa7:d8d4:: with SMTP id k20mr5291398eds.350.1613468797080; Tue, 16 Feb 2021 01:46:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613468797; cv=none; d=google.com; s=arc-20160816; b=FZGev8ujPzGRP5l+V7jZ3h37CJn72yIjEF6NeWsSPgud5nE/Be+Rtua1SYRkYSOIHn BgWJrvR2RpvaNmw+XWJFunJUucULlvBVPPhH5HySbTejUw9QBTAaD/ZRmW4EvujUZMIS iiT5DpbAUBmikkbF+UWgc9tx6kRdr2oVQRuSDHSAdtAzVyqrk/u47Kzpdsy1k3oJNZYx VgWLI+yHYPdIheGNPWdC4bO0QtSagiiNDAMZT4lhDNxS7JoDE2Tio7IOQEGBrpGJAuMC y11cE5Ggrd3kSdgzZr82nSmFUgX8ybNEbL75KLI6diKQYLc39uQeVPwRMJ3+omBgZ/Pe roBw== 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=9MTVWLpF2C0UUHwgdgaRXIYUdreRSee167ttmColVyU=; b=CeT9xXUXvCc372MUzOKEn5XhDXju14SWUqRW7FWMd/jb0MzMxMLAFIyzQO/8i5KJMm 27J6zVzNStI+nmJYAbQtlRvuhIub+GOa1cCJfWfmcB+JMUavBoUAH1ES42QbzCwLhFAQ Xx9QcNUvLu9CJoKcFuOqkOLdr7OcselvWb6HT6i2NfcUwfUemKnRZ8MxFg2LXhf0yhfN 1BPpWmYYtaCwWH2HaEdJkBSBkFRl7YTcQ7GWCyiIf/N34czjnvGtbMdYa0h7tv8bV96i zujXl8MowqvxZKZ46rcGc0L0cVMTDJ/3hPCdfRyOM3+ZDzaD0qWWAMQhEOB5CYZnupNm YVjw== 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 by17si13794171ejb.604.2021.02.16.01.46.14; Tue, 16 Feb 2021 01:46:37 -0800 (PST) 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 S229803AbhBPJpK (ORCPT + 99 others); Tue, 16 Feb 2021 04:45:10 -0500 Received: from foss.arm.com ([217.140.110.172]:59236 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229725AbhBPJpI (ORCPT ); Tue, 16 Feb 2021 04:45:08 -0500 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 9AF9B1FB; Tue, 16 Feb 2021 01:44:22 -0800 (PST) Received: from [192.168.0.130] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4E2B03F694; Tue, 16 Feb 2021 01:44:20 -0800 (PST) Subject: Re: [PATCH V3 11/14] coresight: sink: Add TRBE driver To: Mike Leach Cc: Mathieu Poirier , linux-arm-kernel , Coresight ML , "Suzuki K. Poulose" , Linu Cherian , Linux Kernel Mailing List 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> From: Anshuman Khandual Message-ID: <7b20f8b3-4efa-530f-b058-1aae13e4e43e@arm.com> Date: Tue, 16 Feb 2021 15:14:37 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 ? Is this ETE/TRBE behavior same for all implementations in the FILL mode ? Just wondering. > > 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 ? > 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 ? > > 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