!59 trace-cmd record: Set sleep_time to zero at end of recording

From: @meiyang666 
Reviewed-by: @Charlie_li 
Signed-off-by: @Charlie_li
This commit is contained in:
openeuler-ci-bot 2023-12-26 07:59:05 +00:00 committed by Gitee
commit 94b366d0fa
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 36 additions and 1 deletions

View File

@ -0,0 +1,32 @@
From be207b060775c9841d7e3c1c240e74de63df3040 Mon Sep 17 00:00:00 2001
From: wangmeiyang <wangmeiyang@xfusion.com>
Date: Tue, 26 Dec 2023 11:15:29 +0800
Subject: [PATCH 2/2] trace-cmd record: Set sleep_time to zero at end of
recording
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 --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c
index 826d1e7..9a7cba2 100644
--- a/tracecmd/trace-record.c
+++ b/tracecmd/trace-record.c
@@ -3066,6 +3066,8 @@ static void expand_event_list(void)
static void finish(int sig)
{
+ sleep_time = 0;
+
/* all done */
if (recorder)
tracecmd_stop_recording(recorder);
--
2.37.0.windows.1

View File

@ -1,6 +1,6 @@
Name: trace-cmd
Version: 2.9.2
Release: 10
Release: 11
Summary: A front-end for Ftrace
License: GPLv2 and LGPLv2
URL: http://git.kernel.org/?p=linux/kernel/git/rostedt/trace-cmd.git;a=summary
@ -72,6 +72,9 @@ echo "%{_bindir}/%{name}" > $RPM_BUILD_ROOT/etc/ld.so.conf.d/%{name}-%{_arch}.co
%{_mandir}/man5/*
%changelog
* Thu Dec 26 2023 meiyang666 <wangmeiyang@xfusion.com> - 2.9.2-11
- trace-cmd record: Set sleep_time to zero at end of recording
* Thu Dec 26 2023 meiyang666 <wangmeiyang@xfusion.com> - 2.9.2-10
- trace-cmd stream: Set default sleep time to half a second