Messages in this thread Patch in this message | | | From | Josef Bacik <> | Subject | [PATCH 10/11] trace-cmd: add a helper function for stream polling | Date | Fri, 20 Nov 2015 15:57:32 -0500 |
| |
Since the pids stuff is local to trace-record, add a helper function that will poll the stream fd's for new data so that external apps can poll it.
Signed-off-by: Josef Bacik <jbacik@fb.com> --- trace-cmd.h | 1 + trace-record.c | 5 +++++ 2 files changed, 6 insertions(+)
diff --git a/trace-cmd.h b/trace-cmd.h index d2e4f11..08cb774 100644 --- a/trace-cmd.h +++ b/trace-cmd.h @@ -293,6 +293,7 @@ void tracecmd_enable_tracing(void); void tracecmd_start_threads(enum tracecmd_trace_type type, tracecmd_handle_init_func handle_init, int global); void tracecmd_stop_threads(enum tracecmd_trace_type type); +int tracecmd_stream_loop(struct timeval *tv); /* --- Plugin handling --- */ extern struct pevent_plugin_option trace_ftrace_options[]; diff --git a/trace-record.c b/trace-record.c index 337445d..3c8eb58 100644 --- a/trace-record.c +++ b/trace-record.c @@ -2563,6 +2563,11 @@ static void finish_network(void) free(host); } +int tracecmd_stream_loop(struct timeval *tv) +{ + return trace_stream_read(pids, recorder_threads, tv); +} + void tracecmd_start_threads(enum tracecmd_trace_type type, tracecmd_handle_init_func handle_init, int global) { -- 2.1.0
| |