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=-15.2 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,SPF_HELO_NONE,SPF_PASS 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 351B2C433FE for ; Wed, 22 Sep 2021 16:36:37 +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 00BA060F13 for ; Wed, 22 Sep 2021 16:36:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 00BA060F13 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JYrP+lg+MQlMAblagvxGKue0sB06jbD74XpZ3+fzvTQ=; b=hB3eZPoMHzpHI0 bN/m04qhIIQZw+mDhW/4tVgJkG7XY6PUewxEpsdf8UDGPytCdFLcV00uHPjU40ZIHrJmRQ2SBoxP6 XPXujyMpWY0jU/Pjgwt0VBF35JG1qxmyeWkKVT14arAvYfhl/TMWG1jZV2HPN1WI5GmQ13Z96XH/R 8ajoHylrZEk7hsmOTyqAULlYnC3/3DFESzYynQ2Fo2nNqW7oNFFZrBXVzN37OUc9HZetqokVf7t8t dJB2UX3IJJS+KYbz9YEXih7tPkQjnPakS3SLjklxLZL3p6EbrvoolpznzJzrxEJjv8Xj0Y7fBiieA pzg6ZHaIeUX2qP0JHQsA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mT5Cn-0098J4-2K; Wed, 22 Sep 2021 16:34:45 +0000 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mT5Ci-0098Ha-0P for linux-arm-kernel@lists.infradead.org; Wed, 22 Sep 2021 16:34:41 +0000 Received: by mail-pl1-x634.google.com with SMTP id w6so2140143pll.3 for ; Wed, 22 Sep 2021 09:34:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=HibdQCEebh8H1MeXs8Oo9b4YQpd2Yl52rGyLCizYOCM=; b=uJpxl+N3pwJesMOpX/9asN4CcnrBK4Mchwx0xn9unArrzGZFQDiOW+oguHM3nxSRix 1mOx80J3hDaHq4vMKf1eJxsHtRgD4e5iH/XFQzTHx0RJRFKK+fr9I4OQEb/OCOpMQEfE 1TET95+Kg2U72UiYn/VsUpi67Da3pA02jO+XX3IK5JKtAzUuDoVUu/8U3gn1+g7oSouU YetZgDEEJN1ldMhUeuAWQru2xyiqdMpw1DJtVnea7I+YkpSZCCtX8zODZ3xx/hNxumkj gh/4ACKJXd0hvcXe5ssPbURg4aF/btlMlPy2co6lFoWujLrCv/0pU5nnJz8vVekvISjf EWFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=HibdQCEebh8H1MeXs8Oo9b4YQpd2Yl52rGyLCizYOCM=; b=FEGemhPBH1AsLEk9yLB1bt1VTYR0mp+08O3pSy4qoNZpE0qVT69+R23e/02xppw50a ilc2SdQXJsAwPzeC9dRLbNOquseTt2erzuTYbe+1CSb90u7IMXUMBRuGscdMnxYgxvMl sSIFGoNUHYxcWlQ5/pzMsak7b0+wTnNyK7lpClbFBWi0NgpYXsEm52/pcvI2E5emnyTe 3Wim4/u8WPyUlWIXfc+Jt/Zk21ZIC3Lf3CC+L9eTbiYuXpRX8itRaN11627Wh+TXI4vc Su3jWduJk1bdjLoL/P647Lw6fqIpyd7vZtVN0zwXOY1mPn3rAIn4Gr+Ndrf7m9cPW/Q5 sozA== X-Gm-Message-State: AOAM533oJtm9uamwnZONz16qpaTkE+fFTPg7ugTgoaoVgQjqs6PFLV31 uzEVnCQqGc4puQTY3AtFVXrvRg== X-Google-Smtp-Source: ABdhPJxNcs7FTtKAhXMxDiUUGTp8WnIRusDNXk+/rWCn0yf1epmySGiwHKRP01VMNp+i3dfBxXgmFw== X-Received: by 2002:a17:902:b68b:b0:13a:1239:b8d9 with SMTP id c11-20020a170902b68b00b0013a1239b8d9mr478749pls.25.1632328478863; Wed, 22 Sep 2021 09:34:38 -0700 (PDT) Received: from p14s (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id k14sm3693609pgp.27.2021.09.22.09.34.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Sep 2021 09:34:38 -0700 (PDT) Date: Wed, 22 Sep 2021 10:34:36 -0600 From: Mathieu Poirier To: Anshuman Khandual Cc: Suzuki K Poulose , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, mike.leach@linaro.org, leo.yan@linaro.org, tamas.zsoldos@arm.com, jinlmao@qti.qualcomm.com, al.grant@arm.com, denik@google.com Subject: Re: [PATCH v3 05/10] coresight: trbe: Drop duplicate TRUNCATE flags Message-ID: <20210922163436.GB2129167@p14s> References: <20210914102641.1852544-1-suzuki.poulose@arm.com> <20210914102641.1852544-6-suzuki.poulose@arm.com> <47f5a2cd-c435-7804-c3ff-06b8d266ee9b@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <47f5a2cd-c435-7804-c3ff-06b8d266ee9b@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210922_093440_106090_3DCC941D X-CRM114-Status: GOOD ( 29.96 ) 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 Wed, Sep 15, 2021 at 10:56:17AM +0530, Anshuman Khandual wrote: > > > On 9/14/21 3:56 PM, Suzuki K Poulose wrote: > > We mark the buffer as TRUNCATED when there is no space left > > in the buffer. But we do it at different points. > > __trbe_normal_offset() > > and also, at all the callers of the above function via > > compute_trbe_buffer_limit(), when the limit == base (i.e > > offset = 0 as returned by the __trbe_normal_offset()). > > > > So, given that the callers already mark the buffer as TRUNCATED > > drop the caller inside the __trbe_normal_offset(). > > > > This is in preparation to moving the handling of TRUNCATED > > into a central place. > > > > Cc: Anshuman Khandual > > Cc: Mathieu Poirier > > Cc: Mike Leach > > Cc: Leo Yan > > Signed-off-by: Suzuki K Poulose > > Reviewed-by: Anshuman Khandual > > A small nit though. > > > --- > > Change since v2: > > - Added the flag for trbe_handle_spurious() - Anshuman > > --- > > drivers/hwtracing/coresight/coresight-trbe.c | 8 ++------ > > 1 file changed, 2 insertions(+), 6 deletions(-) > > > > diff --git a/drivers/hwtracing/coresight/coresight-trbe.c b/drivers/hwtracing/coresight/coresight-trbe.c > > index 81bf183a73a1..5297b11f26b7 100644 > > --- a/drivers/hwtracing/coresight/coresight-trbe.c > > +++ b/drivers/hwtracing/coresight/coresight-trbe.c > > @@ -252,13 +252,9 @@ static unsigned long __trbe_normal_offset(struct perf_output_handle *handle) > > * trbe_base trbe_base + nr_pages > > * > > * Perf aux buffer does not have any space for the driver to write into. > > - * Just communicate trace truncation event to the user space by marking > > - * it with PERF_AUX_FLAG_TRUNCATED. > > Should not this comment be moved, where PERF_AUX_FLAG_TRUNCATED > gets marked after this change ? I moved the comment and applied this patch. > > > */ > > - if (!handle->size) { > > - perf_aux_output_flag(handle, PERF_AUX_FLAG_TRUNCATED); > > + if (!handle->size) > > return 0; > > - } > > > > /* Compute the tail and wakeup indices now that we've aligned head */ > > tail = PERF_IDX2OFF(handle->head + handle->size, buf); > > @@ -360,7 +356,6 @@ static unsigned long __trbe_normal_offset(struct perf_output_handle *handle) > > return limit; > > > > trbe_pad_buf(handle, handle->size); > > - perf_aux_output_flag(handle, PERF_AUX_FLAG_TRUNCATED); > > return 0; > > } > > > > @@ -688,6 +683,7 @@ static void trbe_handle_spurious(struct perf_output_handle *handle) > > buf->trbe_write = buf->trbe_base + PERF_IDX2OFF(handle->head, buf); > > if (buf->trbe_limit == buf->trbe_base) { > > trbe_drain_and_disable_local(); > > + perf_aux_output_flag(handle, PERF_AUX_FLAG_TRUNCATED); > > return; > > } > > trbe_enable_hw(buf); > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel