From: "Steven Rostedt (Google)" <rostedt@xxxxxxxxxxx> Add functions that allow applications to read the trace_pipe_raw files: tracefs_cpu_create_fd() tracefs_cpu_open() tracefs_cpu_close() tracefs_cpu_read_size() tracefs_cpu_read() tracefs_cpu_buffered_read() tracefs_cpu_write() tracefs_cpu_stop() tracefs_cpu_flush() tracefs_cpu_flush_write() tracefs_cpu_pipe() Changes since v1: https://lore.kernel.org/all/20221021182345.092cdb50@xxxxxxxxxxxxxxxxxx/ - Changed the names of tracefs_cpu_pipe_read() to tracefs_cpu_buffered_read() and tracefs_cpu_pipe_write() to just tracefs_cpu_write() - Added tracefs_cpu_create_fd() to attach to an already opened file descriptor that could be just a copy of a trace_pipe_raw file, or to a socket for remote tracing. - Added tracefs_cpu_pipe() to write directly into a pipe (saves on a splice). - Fixed some blocking issues. - Added unit tests Steven Rostedt (Google) (5): libtracefs: Add reading of per cpu files libtracefs: Add tracefs_cpu_create_fd() libtracefs: Add tracefs_cpu_pipe() libtracefs utest: Make helper functions for affinity libtracefs: Add unit tests for tracefs_cpu functions Documentation/libtracefs-cpu.txt | 239 +++++++++++++ Documentation/libtracefs.txt | 12 + include/tracefs.h | 15 + samples/Makefile | 1 + scripts/utils.mk | 2 +- src/Makefile | 1 + src/tracefs-record.c | 586 +++++++++++++++++++++++++++++++ utest/tracefs-utest.c | 372 +++++++++++++++++++- 8 files changed, 1213 insertions(+), 15 deletions(-) create mode 100644 Documentation/libtracefs-cpu.txt create mode 100644 src/tracefs-record.c -- 2.35.1