From: Suzuki K Poulose <suzuki.poulose@arm.com>
To: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org, mathieu.poirier@linaro.org,
coresight@lists.linaro.org, robert.walker@arm.com,
mike.leach@linaro.org, Suzuki K Poulose <suzuki.poulose@arm.com>
Subject: [PATCH 3/6] coresight: tmc-etr: Relax collection of trace from sysfs mode
Date: Wed, 11 Jul 2018 15:16:36 +0100 [thread overview]
Message-ID: <1531318599-8840-4-git-send-email-suzuki.poulose@arm.com> (raw)
In-Reply-To: <1531318599-8840-1-git-send-email-suzuki.poulose@arm.com>
Since the ETR now uses mode specific buffers, we can reliably
provide the trace data captured in sysfs mode, even when the ETR
is operating in PERF mode.
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
drivers/hwtracing/coresight/coresight-tmc-etr.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b/drivers/hwtracing/coresight/coresight-tmc-etr.c
index edbfeaa..e54c8a4 100644
--- a/drivers/hwtracing/coresight/coresight-tmc-etr.c
+++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c
@@ -1168,19 +1168,17 @@ int tmc_read_prepare_etr(struct tmc_drvdata *drvdata)
goto out;
}
- /* Don't interfere if operated from Perf */
- if (drvdata->mode == CS_MODE_PERF) {
- ret = -EINVAL;
- goto out;
- }
-
- /* If sysfs_buf is NULL the trace data has been read already */
+ /*
+ * We can safely allow reads even if the ETR is operating in PERF mode,
+ * since the sysfs session is captured in mode specific data.
+ * If drvdata::sysfs_data is NULL the trace data has been read already.
+ */
if (!drvdata->sysfs_buf) {
ret = -EINVAL;
goto out;
}
- /* Disable the TMC if we are trying to read from a running session */
+ /* Disable the TMC if we are trying to read from a running session. */
if (drvdata->mode == CS_MODE_SYSFS)
tmc_etr_disable_hw(drvdata);
--
2.7.4
next prev parent reply other threads:[~2018-07-11 14:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-11 14:16 [PATCH 0/6] coresight: perf: Support for tmc-etr backed buffers Suzuki K Poulose
2018-07-11 14:16 ` [PATCH 1/6] coresight: Fix handling of sinks Suzuki K Poulose
2018-07-11 14:16 ` [PATCH 2/6] coresight: tmc-etr: Handle driver mode specific ETR buffers Suzuki K Poulose
2018-07-11 14:16 ` Suzuki K Poulose [this message]
2018-07-11 14:16 ` [PATCH 4/6] coresight: Convert driver messages to dev_dbg Suzuki K Poulose
2018-07-11 14:16 ` [PATCH 5/6] coresight: perf: Remove reset_buffer call back for sinks Suzuki K Poulose
2018-07-11 14:16 ` [PATCH 6/6] coresight: etm-perf: Add support for ETR backend Suzuki K Poulose
2018-07-12 20:57 ` Mathieu Poirier
2018-07-13 11:23 ` Suzuki K Poulose
2018-07-16 15:05 ` Mathieu Poirier
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=1531318599-8840-4-git-send-email-suzuki.poulose@arm.com \
--to=suzuki.poulose@arm.com \
--cc=coresight@lists.linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
--cc=mike.leach@linaro.org \
--cc=robert.walker@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).