All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: linux-arm-kernel@lists.infradead.org
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
Subject: [PATCH V2 4/6] coresight: tmc-etf: Fix snapshot mode update function
Date: Tue, 14 May 2019 13:40:16 -0600	[thread overview]
Message-ID: <20190514194018.23420-5-mathieu.poirier@linaro.org> (raw)
In-Reply-To: <20190514194018.23420-1-mathieu.poirier@linaro.org>

When working in snapshot mode function perf_aux_output_begin()
does not set the handle->size because the size is expected to be
deduced by the placement of the "head" and "old" pointers in user
space.  As such there is no point in trying to adjust the amount
of data to copy to the ring buffer.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Reviewed-by: Leo Yan <leo.yan@linaro.org>
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 drivers/hwtracing/coresight/coresight-tmc-etf.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/hwtracing/coresight/coresight-tmc-etf.c b/drivers/hwtracing/coresight/coresight-tmc-etf.c
index d026bd04a6af..31d41e2ad955 100644
--- a/drivers/hwtracing/coresight/coresight-tmc-etf.c
+++ b/drivers/hwtracing/coresight/coresight-tmc-etf.c
@@ -477,9 +477,11 @@ static unsigned long tmc_update_etf_buffer(struct coresight_device *csdev,
 	/*
 	 * The TMC RAM buffer may be bigger than the space available in the
 	 * perf ring buffer (handle->size).  If so advance the RRP so that we
-	 * get the latest trace data.
+	 * get the latest trace data.  In snapshot mode none of that matters
+	 * since we are expected to clobber stale data in favour of the latest
+	 * traces.
 	 */
-	if (to_read > handle->size) {
+	if (!buf->snapshot && to_read > handle->size) {
 		u32 mask = 0;
 
 		/*
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2019-05-14 19:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-14 19:40 [PATCH V2 0/6] coresight: Fix snapshot mode Mathieu Poirier
2019-05-14 19:40 ` [PATCH V2 1/6] coresight: etb10: Properly set AUX buffer head in " Mathieu Poirier
2019-05-15  9:45   ` Suzuki K Poulose
2019-05-15 14:28     ` Mathieu Poirier
2019-05-16  9:41       ` Suzuki K Poulose
2019-05-14 19:40 ` [PATCH V2 2/6] coresight: tmc-etr: " Mathieu Poirier
2019-05-14 19:40 ` [PATCH V2 3/6] coresight: tmc-etf: " Mathieu Poirier
2019-05-14 19:40 ` Mathieu Poirier [this message]
2019-05-14 19:40 ` [PATCH V2 5/6] coresight: perf: Don't set the truncated flag " Mathieu Poirier
2019-05-16 15:22   ` Suzuki K Poulose
2019-05-14 19:40 ` [PATCH V2 6/6] perf tools: Properly set the value of 'old' and 'head' " Mathieu Poirier
2019-05-16 15:00   ` Leo Yan
2019-05-20 19:53     ` Mathieu Poirier
2019-05-21  1:54       ` Leo Yan
2019-05-16 15:09 ` [PATCH V2 0/6] coresight: Fix " Leo Yan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190514194018.23420-5-mathieu.poirier@linaro.org \
    --to=mathieu.poirier@linaro.org \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=coresight@lists.linaro.org \
    --cc=leo.yan@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mike.leach@linaro.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=suzuki.poulose@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.