libtracefs: Add tracefs_cpu_alloc_fd() and tracefs_cpu_free_fd()
PATCH 1/1 libtracefs: Add tracefs_cpu_alloc_fd() and tracefs_cpu_free_fd()
From: "Steven Rostedt (Google)" <[email protected]>
Add tracefs_cpu_alloc_fd() to attach a tracefs_cpu descriptor to an already opened file descriptor, and tracefs_cpu_free_fd() to clean up the descriptor that tracefs_cpu_alloc_fd() created.
Signed-off-by Steven Rostedt (Google) <[email protected]>
---
Changes since v1: https://lore.kernel.org/linux-trace-devel/[email protected]
- Renamed tracefs_cpu_create_fd() to tracefs_cpu_alloc_fd()
- Added tracefs_cpu_free_fd() to clean up the descriptor created.
include/tracefs.h | 2 + src/tracefs-record.c | 118 +++++++++++++++++++++++++++++-------------- 2 files changed, 83 insertions(+), 37 deletions(-)
include/tracefs.h +2 -0
@@ -597,9 +597,11 @@ tracefs_synth_get_event(struct tep_handle *tep, struct tracefs_synth *synth);struct tracefs_cpu ; +struct tracefs_cpu *tracefs_cpu_alloc_fd (int fd,int subbuf_size,bool nonblock);struct tracefs_cpu *tracefs_cpu_open (struct tracefs_instance *instance,int cpu,bool nonblock);void tracefs_cpu_close (struct tracefs_cpu *tcpu); +void tracefs_cpu_free_fd (struct tracefs_cpu *tcpu);int tracefs_cpu_read_size (struct tracefs_cpu *tcpu);int tracefs_cpu_read (struct tracefs_cpu *tcpu,void *buffer,bool nonblock);int tracefs_cpu_buffered_read (struct tracefs_cpu *tcpu,void *buffer,bool nonblock);
src/tracefs-record.c +81 -37
174 lines not on this page · raw message
Signature · 1 line
2.35.1