[PATCH 04/10] trace-cmd stream: Do one last flush when finished

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Steven Rostedt (Google)" <rostedt@xxxxxxxxxxx>

When trace-cmd stream is finished, the trace_or_sleep() will exit before
waiting for the pipes to flush. Call trace_stream_read() one more time, and
with indefinite blocking, as the pipes should finish everything and then
close (which will stop the polling).

Signed-off-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>
---
 tracecmd/trace-record.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c
index a03d334a65d5..83ae8e60d7cb 100644
--- a/tracecmd/trace-record.c
+++ b/tracecmd/trace-record.c
@@ -7019,6 +7019,9 @@ static void record_trace(int argc, char **argv,
 		}
 		while (!finished && wait_indefinitely)
 			trace_or_sleep(type, pwait);
+		/* Streams need to be flushed one more time */
+		if (type & TRACE_TYPE_STREAM)
+			trace_stream_read(pids, recorder_threads, NULL);
 	}
 
 	tell_guests_to_stop(ctx);
-- 
2.35.1




[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux