* [PATCH] trace-cmd: Fix left open file descriptor in recording of date
@ 2018-12-06 3:38 Steven Rostedt
0 siblings, 0 replies; only message in thread
From: Steven Rostedt @ 2018-12-06 3:38 UTC (permalink / raw)
To: linux-trace-devel@vger.kernel.org
Cc: Tzvetomir Stoyanov, Slavomir Kaslev, Yordan Karadzhov
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
When running the --date option of trace-cmd record it loops through
writing to the trace_marker and reading the timestamp from
trace_pipe_raw. But it never closes the file descriptor it used to open
trace_pipe_raw with. This prevents other parts of trace-cmd from working
like writing "function" into current_tracer, because the trace_pipe_raw will
hold a ref count and not let different tracers be set if that file is open.
Fixes: e09a5db1a ("trace-cmd: Add trace-cmd record --date option")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
tracecmd/trace-record.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c
index 038b2313..24580a40 100644
--- a/tracecmd/trace-record.c
+++ b/tracecmd/trace-record.c
@@ -3421,6 +3421,7 @@ static unsigned long long find_time_stamp(struct tep_handle *pevent)
if (ts)
break;
} while (r > 0);
+ close(fd);
if (ts)
break;
}
--
2.19.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2018-12-06 3:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-06 3:38 [PATCH] trace-cmd: Fix left open file descriptor in recording of date Steven Rostedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).