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=-17.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 94BBEC433EF for ; Wed, 15 Sep 2021 05:16:31 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 465E261242 for ; Wed, 15 Sep 2021 05:16:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 465E261242 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type: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=p6S6wKpon5jNaO9XnEF46HEy6PEgtnEjJpQExcaxuyQ=; b=soLq3B2yIs5SFT1rZxlFjht6uf QMFcFSHKRwjj+808WTX9NZipa9foF+KWrt8ezJ/nEKIDHYNz4LYAqhhBDqQ4jF9In0pVfOw1VtQMz Cvj0QfWDgREx28knzSEIVbIsyI7R54Q+yI/wUUXfPGGah2f4rzOwx62Y5gOhHcBWKll9h6QEIYPkq 2FeSKbeSgERImaRwby3UieH+pQd6278fQkDo9tPOQ1KfHt2kWOSmDqZuW8CRolUSTqfQT3GaJRwbg fekvzJYyJA0HDlmyLf6Eu/EjLFk0qKHM6gOEAwjlr+53/YPtMxlC0Gockj2p1P7ggihic1JiJ5O6H Erbq4INg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mQNFh-0084d6-Jf; Wed, 15 Sep 2021 05:14:33 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mQNFd-0084ci-QP for linux-arm-kernel@lists.infradead.org; Wed, 15 Sep 2021 05:14:31 +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 EC7DD31B; Tue, 14 Sep 2021 22:14:25 -0700 (PDT) Received: from [10.163.70.189] (unknown [10.163.70.189]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B823F3F719; Tue, 14 Sep 2021 22:14:22 -0700 (PDT) Subject: Re: [PATCH v3 04/10] coresight: trbe: Ensure the format flag is set always To: Suzuki K Poulose , coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org, mathieu.poirier@linaro.org, mike.leach@linaro.org, leo.yan@linaro.org, tamas.zsoldos@arm.com, jinlmao@qti.qualcomm.com, al.grant@arm.com, denik@google.com References: <20210914102641.1852544-1-suzuki.poulose@arm.com> <20210914102641.1852544-5-suzuki.poulose@arm.com> From: Anshuman Khandual Message-ID: Date: Wed, 15 Sep 2021 10:45:28 +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: <20210914102641.1852544-5-suzuki.poulose@arm.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210914_221430_010265_DF5F98D3 X-CRM114-Status: GOOD ( 24.82 ) 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-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 On 9/14/21 3:56 PM, Suzuki K Poulose wrote: > When the TRBE is stopped on truncating an event, we may not > set the FORMAT flag, even though the size of the record is 0. > Let us be consistent and not confuse the user. > > To ensure that the format flag is always set on all the > records generated by TRBE, set the flag when we have a > new handle. Rather than deferring to the "end" operation, > which makes it clear. So, we can do this from > > - arm_trbe_enable() -> When a new handle is provided by the > CoreSight PMU, triggered via etm_event_start() > - trbe_handle_overflow() -> When we begin a new handle after > closing the previous on overflow. > > Cc: Anshuman Khandual > Cc: Leo Yan > Cc: Mike Leach > Cc: Mathieu Poirier > Signed-off-by: Suzuki K Poulose > --- > Changes since v2: > - Move the format flag setting to the beginning of a session > than the ending (which can happen via various different paths) Right, this has improved from the last version. Reviewed-by: Anshuman Khandual > --- > drivers/hwtracing/coresight/coresight-trbe.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/drivers/hwtracing/coresight/coresight-trbe.c b/drivers/hwtracing/coresight/coresight-trbe.c > index 176868496879..81bf183a73a1 100644 > --- a/drivers/hwtracing/coresight/coresight-trbe.c > +++ b/drivers/hwtracing/coresight/coresight-trbe.c > @@ -554,8 +554,6 @@ static unsigned long arm_trbe_update_buffer(struct coresight_device *csdev, > if (cpudata->mode != CS_MODE_PERF) > return 0; > > - perf_aux_output_flag(handle, PERF_AUX_FLAG_CORESIGHT_FORMAT_RAW); > - > /* > * We are about to disable the TRBE. And this could in turn > * fill up the buffer triggering, an IRQ. This could be consumed > @@ -648,6 +646,7 @@ static int arm_trbe_enable(struct coresight_device *csdev, u32 mode, void *data) > if (mode != CS_MODE_PERF) > return -EINVAL; > > + perf_aux_output_flag(handle, PERF_AUX_FLAG_CORESIGHT_FORMAT_RAW); > *this_cpu_ptr(drvdata->handle) = handle; > cpudata->buf = buf; > cpudata->mode = mode; > @@ -710,8 +709,7 @@ static void trbe_handle_overflow(struct perf_output_handle *handle) > * Mark the buffer as truncated, as we have stopped the trace > * collection upon the WRAP event, without stopping the source. > */ > - perf_aux_output_flag(handle, PERF_AUX_FLAG_CORESIGHT_FORMAT_RAW | > - PERF_AUX_FLAG_TRUNCATED); > + perf_aux_output_flag(handle, PERF_AUX_FLAG_TRUNCATED); > perf_aux_output_end(handle, size); > event_data = perf_aux_output_begin(handle, event); > if (!event_data) { > @@ -725,6 +723,7 @@ static void trbe_handle_overflow(struct perf_output_handle *handle) > *this_cpu_ptr(buf->cpudata->drvdata->handle) = NULL; > return; > } > + perf_aux_output_flag(handle, PERF_AUX_FLAG_CORESIGHT_FORMAT_RAW); > buf->trbe_limit = compute_trbe_buffer_limit(handle); > buf->trbe_write = buf->trbe_base + PERF_IDX2OFF(handle->head, buf); > if (buf->trbe_limit == buf->trbe_base) { > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel