coresight: tmc-etr: Decouple buffer sync and barrier packet insertion
authorMathieu Poirier <mathieu.poirier@linaro.org>
Thu, 29 Aug 2019 20:28:41 +0000 (14:28 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 Sep 2019 20:01:18 +0000 (22:01 +0200)
commit3507d231a499e27c4bac8a47169b74ec7ef87292
treef9c036ecc04318588a7ce78c4c5f4f4ba6f45133
parent00bb485ce7b8d1186a5166fc9e38822797fae7d4
coresight: tmc-etr: Decouple buffer sync and barrier packet insertion

If less space is available in the perf ring buffer than the ETR buffer,
barrier packets inserted in the trace stream by tmc_sync_etr_buf() are
skipped over when the head of the buffer is moved forward, resulting in
traces that can't be decoded.

This patch decouples the process of syncing ETR buffers and the addition
of barrier packets in order to perform the latter once the offset in the
trace buffer has been properly computed.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Reviewed-by: Leo Yan <leo.yan@linaro.org>
Link: https://lore.kernel.org/r/20190829202842.580-17-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwtracing/coresight/coresight-tmc-etr.c