Skip to content

Commit

Permalink
coresight: etm4x: Fix timestamp configuration when working from perf
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Mathieu Poirier authored and Greg Kroah-Hartman committed Jan 25, 2017
1 parent ae3fabc commit 27a7e2a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/hwtracing/coresight/coresight-etm4x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 27a7e2a

Please sign in to comment.