Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761160AbbKTU6G (ORCPT ); Fri, 20 Nov 2015 15:58:06 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:57507 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761028AbbKTU6B (ORCPT ); Fri, 20 Nov 2015 15:58:01 -0500 From: Josef Bacik To: , , Subject: [PATCH 10/11] trace-cmd: add a helper function for stream polling Date: Fri, 20 Nov 2015 15:57:32 -0500 Message-ID: <1448053053-24188-11-git-send-email-jbacik@fb.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1448053053-24188-1-git-send-email-jbacik@fb.com> References: <1448053053-24188-1-git-send-email-jbacik@fb.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [192.168.52.123] X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2015-11-20_12:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1440 Lines: 45 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 --- 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/