Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1565186

[PATCH 3/3] coresight: etm4x: Fix timestamp configuration when working from perf

From Mathieu Poirier <mathieu.poirier@linaro.org>
Newsgroups linux.kernel
Subject [PATCH 3/3] coresight: etm4x: Fix timestamp configuration when working from perf
Date 2017-01-23 18:50 +0100
Message-ID <t2QUG-XY-9@gated-at.bofh.it> (permalink)
References <t2QUF-XY-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


When using the ETM4x tracers from the perf interface two trace options are
available: cycle accurate and timestamp.

Enabling the timestamp feature is done by setting TRCCONFIGR.TS (bit 11).
The position of the timestamp bit in that register coincidentally happens
to be the same as what was chosen to enable timestamping from the 'mode'
sysFS entry.  The code does the right thing but the semantic is wrong.

This patch sets TRCCONFIGR.TS explicitly, as it is done from the sysFS
interface.  That way timestamps are set the same way from both perf and
sysFS and there is no misunderstanding as to what is intended.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
---
 drivers/hwtracing/coresight/coresight-etm4x.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c
index f432febdda49..d1340fb4e457 100644
--- a/drivers/hwtracing/coresight/coresight-etm4x.c
+++ b/drivers/hwtracing/coresight/coresight-etm4x.c
@@ -222,7 +222,8 @@ static int etm4_parse_event_config(struct etmv4_drvdata *drvdata,
 		config->ccctlr = ETM_CYC_THRESHOLD_DEFAULT;
 	}
 	if (attr->config & BIT(ETM_OPT_TS))
-		config->cfg |= ETMv4_MODE_TIMESTAMP;
+		/* bit[11], Global timestamp tracing bit */
+		config->cfg |= BIT(11);
 
 out:
 	return ret;
-- 
2.7.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/3] coresight: next v4.10-rc5 Mathieu Poirier <mathieu.poirier@linaro.org> - 2017-01-23 18:50 +0100
  [PATCH 1/3] coresight: fix kernel panic caused by invalid CPU Mathieu Poirier <mathieu.poirier@linaro.org> - 2017-01-23 18:50 +0100
    Re: [PATCH 1/3] coresight: fix kernel panic caused by invalid CPU Greg KH <gregkh@linuxfoundation.org> - 2017-01-25 11:50 +0100
  [PATCH 3/3] coresight: etm4x: Fix timestamp configuration when working from perf Mathieu Poirier <mathieu.poirier@linaro.org> - 2017-01-23 18:50 +0100
  [PATCH 2/3] coresight: etm4x: Fix enabling of cycle accurate tracing in perf. Mathieu Poirier <mathieu.poirier@linaro.org> - 2017-01-23 18:50 +0100

csiph-web