From baa0e4a9ab389b078f46d4bfe6ab36c41541387f Mon Sep 17 00:00:00 2001 From: David Goulet Date: Thu, 26 May 2011 13:17:58 -0400 Subject: [PATCH] Create ust-ctl.c/.h files for user-space control Remove trace.c which was only user-space tracer control and move it to ust-ctl.c. Signed-off-by: David Goulet --- ltt-sessiond/Makefile.am | 2 +- ltt-sessiond/{trace.c => ust-ctl.c} | 14 ++++++------- ltt-sessiond/ust-ctl.h | 31 +++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 9 deletions(-) rename ltt-sessiond/{trace.c => ust-ctl.c} (97%) create mode 100644 ltt-sessiond/ust-ctl.h diff --git a/ltt-sessiond/Makefile.am b/ltt-sessiond/Makefile.am index 525851b42..4d634a90a 100644 --- a/ltt-sessiond/Makefile.am +++ b/ltt-sessiond/Makefile.am @@ -3,7 +3,7 @@ AM_CFLAGS = -fno-strict-aliasing bin_PROGRAMS = ltt-sessiond -ltt_sessiond_SOURCES = session.c trace.c traceable-app.c kernel-ctl.c main.c +ltt_sessiond_SOURCES = session.c traceable-app.c ust-ctl.c kernel-ctl.c main.c ltt_sessiond_LDADD = \ $(top_builddir)/liblttsessiondcomm/liblttsessiondcomm.la \ diff --git a/ltt-sessiond/trace.c b/ltt-sessiond/ust-ctl.c similarity index 97% rename from ltt-sessiond/trace.c rename to ltt-sessiond/ust-ctl.c index 1cddb31fa..7bdf7967b 100644 --- a/ltt-sessiond/trace.c +++ b/ltt-sessiond/ust-ctl.c @@ -18,21 +18,19 @@ #define _GNU_SOURCE #include -#include -#include #include +#include #include -#include +#include + #include #include "liblttsessiondcomm.h" #include "lttngerr.h" -#include "trace.h" -#include "session.h" #include "ltt-sessiond.h" - -static struct ltt_ust_trace *find_session_ust_trace_by_pid( - struct ltt_session *session, pid_t pid); +#include "session.h" +#include "ust-ctl.h" +#include "trace.h" /* * find_session_ust_trace_by_pid diff --git a/ltt-sessiond/ust-ctl.h b/ltt-sessiond/ust-ctl.h new file mode 100644 index 000000000..36a3e8794 --- /dev/null +++ b/ltt-sessiond/ust-ctl.h @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2011 - David Goulet + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef _LTT_UST_CTL_H +#define _LTT_UST_CTL_H + +#include "ltt-sessiond.h" +#include "session.h" + +int get_trace_count_per_session(struct ltt_session *session); +void get_traces_per_session(struct ltt_session *session, struct lttng_trace *traces); +int ust_create_trace(struct command_ctx *cmd_ctx); +int ust_start_trace(struct command_ctx *cmd_ctx); +int ust_stop_trace(struct command_ctx *cmd_ctx); + +#endif /* _LTT_TRACE_H */ -- 2.34.1