diff mbox series

[09/10] trace-cmd record: Set sleep_time to zero at end of recording

Message ID 20230106183930.12565-10-rostedt@goodmis.org (mailing list archive)
State Accepted
Commit 53bb1122b719d76cccebff50154ff5490dcf12d8
Headers show
Series trace-cmd: Fix trace-cmd stream | expand

Commit Message

Steven Rostedt Jan. 6, 2023, 6:39 p.m. UTC
From: "Steven Rostedt (Google)" <rostedt@goodmis.org>

When the recording (of trace-cmd record) or streaming (of trace-cmd stream)
is finished, set sleep_time to zero. This will cause various calls to read
the buffer to not block, as the sleep_time is used in some instances to
determine how long to wait if there's no data.

Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 tracecmd/trace-record.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c
index 9eb10cd8ccdf..b3614b0706de 100644
--- a/tracecmd/trace-record.c
+++ b/tracecmd/trace-record.c
@@ -3164,6 +3164,8 @@  static void expand_event_list(void)
 
 static void finish(void)
 {
+	sleep_time = 0;
+
 	/* all done */
 	if (recorder)
 		tracecmd_stop_recording(recorder);