[PATCH] trace-cmd: Fix left open file descriptor in recording of date

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

 



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

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@xxxxxxxxxxx>
---
 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




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

  Powered by Linux