From: "Steven Rostedt (Google)" <rostedt@xxxxxxxxxxx> When the trace-cmd stream is exiting, it flushes the data. But it does so in a blocking way, where it can block when there's nothing to read. Set the timeout of trace_stream_read() to zero in order to return immediately. Signed-off-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx> --- tracecmd/trace-record.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c index 361524b58772..cc6f27bf22e8 100644 --- a/tracecmd/trace-record.c +++ b/tracecmd/trace-record.c @@ -798,7 +798,8 @@ static void stop_threads(enum trace_type type) /* Flush out the pipes */ if (type & TRACE_TYPE_STREAM) { do { - ret = trace_stream_read(pids, recorder_threads, NULL); + struct timeval tv = { 0, 0 }; + ret = trace_stream_read(pids, recorder_threads, &tv); } while (ret > 0); } } -- 2.35.1