[PATCH 10/11] trace-cmd: add a helper function for stream polling

From: Josef Bacik
Date: Fri Nov 20 2015 - 15:58:11 EST


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@xxxxxx>
---
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/