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 36E10C433F5 for ; Wed, 22 Sep 2021 16:36:30 +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 07BA6611C6 for ; Wed, 22 Sep 2021 16:36:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 07BA6611C6 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=u396jPqZxN1HqCH0uPhNy3VvOqdToytsD8SZO3nIrpg=; b=llJ/XM/2Q68m+P wSH76UYZheFUDhWZZUFxf+aJKgyFcH8CZqXhjFU3avOVOJpzIvMDrBRYC0MSZ9yKisayGUMtS5hF3 nrPhVduqTkyTAhDJK0R5Y7fpHPeyrBT4V5q+EEMJJXeM6CboS5+qaHlCu+nP1XfXjZJUEXXsUZ5MQ Nq1toRbnb7HpKICmlfXwMmEau/MhzHaLmqTwXl+ll2i0MsVryZo5MVkkjdtdq0I06pJI45QYp6MSA 60mxHqryKNNXhBBtBWGwTIFKgcS1GRQ00//G8L1LwHF1JnljKs8TBvMdlsk2UKQtopA+0q42fv/I6 OeNOES5eCdHbEYDOICWg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mT5C9-00989N-VY; Wed, 22 Sep 2021 16:34:06 +0000 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mT5C6-00988j-3S for linux-arm-kernel@lists.infradead.org; Wed, 22 Sep 2021 16:34:03 +0000 Received: by mail-pl1-x62d.google.com with SMTP id a7so2150700plm.1 for ; Wed, 22 Sep 2021 09:34:01 -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=VTMXcmn8dnvCpjkDylh9yGG6tTFbRXSENcezOPyRaKQ=; b=i5Pqde5ebuIUjCVpewnrUalrqWLNmjdRiW+CQUV7rXOIHOLUNXImgvx1D6is6BI+6/ 6D+PX30m/V8ZnskzTDe3PTrMOGZhnn0ahDExV7Wm/oT24JpE2hjqx5hItdJg2tl+z2xB XzvPcTfYDaCzWVU2v4HaEbt3XOqROBRHUIpP7M5NL7Yl+5Qi7402kPrmBxXrQjy6iup3 av0YVRG6KPedqzo0gQzjuSCPsqzjSyV3kd8oVdVwbK7xSzQswJKZ/13QpMFHD2XSz8Ob 8m0WMJVs0ta/Gqe/dJP2uiFWibmH7R7oU7cWmlt+3bUiuYWFM7zrr9Z4V6BqFbMNuthZ XZYQ== 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=VTMXcmn8dnvCpjkDylh9yGG6tTFbRXSENcezOPyRaKQ=; b=d1q6dz6hpM/6rnfrsOgaKKIcZb8DV7bQTgw/81hfPNm5esI0jO2ezMqBrygyiKQcTr 8nJiMzxqHOY/8TxnxPhZmAvrLAsLPDN2KVCFNd35QDbDDh0FCOs7ZZyx/WtYrP+jrvau ZVQuatCmgcXz5wOypRUOzdsl2yr4a5JizBt3l+ktyJzdIbcaZPlLCl6HAJiRSf5w7+tU fPFjlaqQGxIlUg9CEiyE2prCFXbopmXmhYHyNC/3wv+8o8nQL4R+yZGG9sOw0knutmiZ A9iuV4b/Mg8JOhK6YDwmBUyyaXoEsBIGzfO98Xbb7ORWSu+SAiRxeTlaUhK61amwUdcb ui2Q== X-Gm-Message-State: AOAM5328fLViKFw9PPE/trWf2HVQlZ/WScTPnZQlI0PFrP3Fd+7roq0d LYhpoR78p//E8uEXa4OsxxlyEiKMl1y/4A== X-Google-Smtp-Source: ABdhPJxJ349CRm7kxOTjHUh7FeboF7hTdO8cSy2n9LLzHb4V4svoRVz1PsCSfquYx2rc3Y7BY/D+Mw== X-Received: by 2002:a17:90b:4c09:: with SMTP id na9mr12401607pjb.172.1632328440926; Wed, 22 Sep 2021 09:34:00 -0700 (PDT) Received: from p14s (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id z8sm2890339pfa.113.2021.09.22.09.33.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Sep 2021 09:33:59 -0700 (PDT) Date: Wed, 22 Sep 2021 10:33:57 -0600 From: Mathieu Poirier To: Suzuki K Poulose Cc: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, anshuman.khandual@arm.com, 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 04/10] coresight: trbe: Ensure the format flag is set always Message-ID: <20210922163357.GA2129167@p14s> References: <20210914102641.1852544-1-suzuki.poulose@arm.com> <20210914102641.1852544-5-suzuki.poulose@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210914102641.1852544-5-suzuki.poulose@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210922_093402_228940_EB467D11 X-CRM114-Status: GOOD ( 26.46 ) 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 Tue, Sep 14, 2021 at 11:26:35AM +0100, 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) > --- > drivers/hwtracing/coresight/coresight-trbe.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > I have applied patches 1 to 4. > 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) { > -- > 2.24.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel