diff mbox series

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

Message ID 20240109205112.74225-2-rostedt@goodmis.org (mailing list archive)
State Accepted
Commit f43b293378663639985f41f325a9b8c3bdeff52b
Headers show
Series libtracefs: More updates and fixes to mmap code | expand

Commit Message

Steven Rostedt Jan. 9, 2024, 8:48 p.m. UTC
From: "Steven Rostedt (Google)" <rostedt@goodmis.org>

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@goodmis.org>
---
 src/tracefs-record.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

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);
 }