[PATCH 1/4] libtracefs: Unmap mmap mapping on tracefs_cpu close

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

 



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

The tracefs_cpu_open_mapped() will mmap the ring buffer if it is supported,
but it does not unmap it when it is closed.

Fixes: 2ed14b59 ("libtracefs: Add ring buffer memory mapping APIs")
Signed-off-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>
---
 src/tracefs-record.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/tracefs-record.c b/src/tracefs-record.c
index f51e18420bc7..4a59c61c195f 100644
--- a/src/tracefs-record.c
+++ b/src/tracefs-record.c
@@ -276,6 +276,7 @@ void tracefs_cpu_free_fd(struct tracefs_cpu *tcpu)
 	close_fd(tcpu->splice_pipe[0]);
 	close_fd(tcpu->splice_pipe[1]);
 
+	trace_unmap(tcpu->mapping);
 	kbuffer_free(tcpu->kbuf);
 	free(tcpu);
 }
-- 
2.43.0





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

  Powered by Linux