[lkml]   [2020]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[RFC 09/11] coresight: etm-perf: Disable the path before capturing the trace data
perf handle structure needs to be shared with the TRBE IRQ handler for
capturing trace data and restarting the handle. There is a probability
of an undefined reference based crash when etm event is being stopped
while a TRBE IRQ also getting processed. This happens due the release
of perf handle via perf_aux_output_end(). This stops the sinks via the
link before releasing the handle, which will ensure that a simultaneous
TRBE IRQ could not happen.

Signed-off-by: Anshuman Khandual <>
This might cause problem with traditional sink devices which can be
operated in both sysfs and perf mode. This needs to be addressed
correctly. One option would be to move the update_buffer callback
into the respective sink devices. e.g, disable().

drivers/hwtracing/coresight/coresight-etm-perf.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/hwtracing/coresight/coresight-etm-perf.c b/drivers/hwtracing/coresight/coresight-etm-perf.c
index 534e205..1a37991 100644
--- a/drivers/hwtracing/coresight/coresight-etm-perf.c
+++ b/drivers/hwtracing/coresight/coresight-etm-perf.c
@@ -429,7 +429,9 @@ static void etm_event_stop(struct perf_event *event, int mode)

size = sink_ops(sink)->update_buffer(sink, handle,
+ coresight_disable_path(path);
perf_aux_output_end(handle, size);
+ return;

/* Disabling the path make its elements available to other sessions */
 \ /
  Last update: 2020-11-10 13:46    [W:0.187 / U:5.696 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site