From patchwork Tue May 14 19:40:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 10943695 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1A0C492A for ; Tue, 14 May 2019 19:40:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 07D69288E2 for ; Tue, 14 May 2019 19:40:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F0431288E6; Tue, 14 May 2019 19:40:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9C388288E2 for ; Tue, 14 May 2019 19:40:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=zJVJqR0qsk9Cyvm+CBwRx2K6mjDtojIfm+7oPEl7eOk=; b=BmU/9k6ZMh9Y2KJEsDWmNgaO4Y c3sZn9KwI6kxEzloIJWTwnFr4AIjkaa0EVCJfHyIJb+hgaUw//56S523OURcwvL9m44jT6BhjbhxK Wg48qq3gRso3hXqhxFPQ1IUZQHq/2mg3hjTa+iDC6mHtEJgG1m2ywB0xMvJWG3CQsCZjTeH7jLe/P WGbV4w5J4SSewbbi7xcepBUVw2RnvjCLp/Fkn5bUvqM1+EYMwkKD9rXmJDzmmGuemOJPrf0wEbJqB /ELqwcNdmUZ91vkctx7ZU7CrVoEYafUAlMtLgWZb1gyIM7sNKeSUpoTXaWH7vl3BHPM+Ti1SErXOc lVpJ69AQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hQdI6-0006ie-8w; Tue, 14 May 2019 19:40:46 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hQdHj-0006Fx-RL for linux-arm-kernel@lists.infradead.org; Tue, 14 May 2019 19:40:25 +0000 Received: by mail-pg1-x544.google.com with SMTP id d31so70145pgl.7 for ; Tue, 14 May 2019 12:40:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+AhN3Bvjm6iExjpvfnaKjLZ6Hur3GYpc1/lk5q3y4p0=; b=ffGExovUSLhtcOKqbyTXzRlHzMpyVLs5ai0l4CZ8LqjMkSlA3Ln6kWmowCiuhEs8h9 WgcJLKyZhJ+z8JA2XpxMxxvNnoxZkw2mJ87u0CoLKHJ0kCSge9GVUomZqvUnlLYXd6zM OZnLv8FCLugHEnkH9wni60vjwz6D7sgS6ZII4ML5eiZ+soWJBBlBMJwa0UsIkEtCc4bo pcCuaW2MEAzib9wTFRNcQKO63HctbFqv0Iph0nOh+1otPV9LwFo3ITIjESLvjuz+o5hq KRH0Gax1S8Lx7K+t7cxQGfCMGU80Kr4ioxHFCq4zBIgs9sCHF6KmFtMAbjYjSRsQQ8TM Zijg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+AhN3Bvjm6iExjpvfnaKjLZ6Hur3GYpc1/lk5q3y4p0=; b=p6jW8HRhgtzQRfXNlO4uLc60Sl7sjTPi69D8v3EEGrZ9uevWH9jGiV7FgICJXlcnDc DJuwJlrn0Mm6iUZXk34IHbteSNHzKgso3s47eRihF/67xrFJGiUs4PXb31L9PmmavNMC 5RMMUOehS7brx5B5JCl3X72KICsGzvM53+fVe4o/2qVacOeYY6Aori39ypo0xLpQl9Pp CBf4hpSd9dGriIMfn+/eW8jPWEc8Xz7OnPTtBGarGBGxIqAWohvyhOMF9u+SUpa4qyc1 8A/KADmH4pI/Eqh+cyViSZ/WP9Ou5IAN2Nc/xVARsKYMfiqk0hanW0gu9ircYApg1bV9 tnOg== X-Gm-Message-State: APjAAAUBPPyztNZaunLhKkmsYncY/uzwv9i3Ke+6Jz8GaI38z36rKKTy 4Ef086ARcMeU5fXXLphCtCGhBmp2KFo= X-Google-Smtp-Source: APXvYqxQnuHPyiJxOcjfiMT2ToXf2Pynp+AgagCoPx9qjPtyO3u2zh0otNBTtQ68qiBpNENECDlU1g== X-Received: by 2002:a65:624f:: with SMTP id q15mr40053183pgv.436.1557862823074; Tue, 14 May 2019 12:40:23 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id w66sm5791196pfb.47.2019.05.14.12.40.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 May 2019 12:40:22 -0700 (PDT) From: Mathieu Poirier To: linux-arm-kernel@lists.infradead.org Subject: [PATCH V2 2/6] coresight: tmc-etr: Properly set AUX buffer head in snapshot mode Date: Tue, 14 May 2019 13:40:14 -0600 Message-Id: <20190514194018.23420-3-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190514194018.23420-1-mathieu.poirier@linaro.org> References: <20190514194018.23420-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190514_124023_880324_348ABE60 X-CRM114-Status: GOOD ( 13.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: suzuki.poulose@arm.com, alexander.shishkin@linux.intel.com, coresight@lists.linaro.org, acme@kernel.org, peterz@infradead.org, mingo@redhat.com, leo.yan@linaro.org, mike.leach@linaro.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Unify amongst sink drivers how the AUX ring buffer head is communicated to user space. That way the same algorithm in cs_etm_find_snapshot() can be used to determine where the latest data is and how much of it to access. Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-tmc-etr.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b/drivers/hwtracing/coresight/coresight-tmc-etr.c index df6e4b0b84e9..cc8401c76c39 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-etr.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c @@ -1501,14 +1501,13 @@ tmc_update_etr_buffer(struct coresight_device *csdev, tmc_etr_sync_perf_buffer(etr_perf); /* - * Update handle->head in snapshot mode. Also update the size to the - * hardware buffer size if there was an overflow. + * In snapshot mode we simply increment the head by the number of byte + * that were written. User space function cs_etm_find_snapshot() will + * figure out how many bytes to get from the AUX buffer based on the + * position of the head. */ - if (etr_perf->snapshot) { + if (etr_perf->snapshot) handle->head += size; - if (etr_buf->full) - size = etr_buf->size; - } lost |= etr_buf->full; out: