From 1e307fab325060d9db4e989c0fdc3cddf46f50f6 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Thu, 25 Aug 2011 14:12:04 -0400 Subject: [PATCH] Fix headers include and rename kernctl.h header Move kernctl.h to lttng-kernel-ctl.h into the include directory. Signed-off-by: David Goulet --- .../kernelctl.h => include/lttng-kernel-ctl.h | 3 +- include/lttng-share.h | 8 ----- include/lttng/lttng-kconsumerd.h | 1 + include/lttng/lttng.h | 5 ++-- libkernelctl/Makefile.am | 2 +- libkernelctl/kernelctl.c | 3 +- liblttng-sessiond-comm/lttng-sessiond-comm.c | 2 +- liblttngctl/lttngctl.c | 9 +++--- liblttngkconsumerd/Makefile.am | 2 +- liblttngkconsumerd/lttngkconsumerd.c | 10 +++---- ltt-kconsumerd/Makefile.am | 2 +- ltt-kconsumerd/ltt-kconsumerd.c | 9 +++--- ltt-sessiond/Makefile.am | 3 +- ltt-sessiond/context.c | 24 ++++++++------- ltt-sessiond/context.h | 29 +++++++------------ ltt-sessiond/kernel-ctl.c | 5 ++-- ltt-sessiond/main.c | 18 ++++-------- ltt-sessiond/session.c | 4 +-- ltt-sessiond/trace.c | 4 +-- ltt-sessiond/trace.h | 3 +- ltt-sessiond/traceable-app.c | 4 +-- ltt-sessiond/traceable-app.h | 2 ++ ltt-sessiond/utils.c | 2 +- lttng/Makefile.am | 3 +- 24 files changed, 68 insertions(+), 89 deletions(-) rename libkernelctl/kernelctl.h => include/lttng-kernel-ctl.h (98%) diff --git a/libkernelctl/kernelctl.h b/include/lttng-kernel-ctl.h similarity index 98% rename from libkernelctl/kernelctl.h rename to include/lttng-kernel-ctl.h index 783f1258d..b51273fac 100644 --- a/libkernelctl/kernelctl.h +++ b/include/lttng-kernel-ctl.h @@ -21,8 +21,7 @@ #define _LTT_LIBKERNELCTL_H #include - -#include "lttng-kernel.h" +#include int kernctl_create_session(int fd); int kernctl_open_metadata(int fd, struct lttng_channel_attr *chops); diff --git a/include/lttng-share.h b/include/lttng-share.h index b3495e196..4172c0a2f 100644 --- a/include/lttng-share.h +++ b/include/lttng-share.h @@ -19,14 +19,6 @@ #ifndef _LTTNG_SHARE_H #define _LTTNG_SHARE_H -#include -#include - -typedef uint32_t u32; -typedef uint64_t u64; - -typedef __s64 s64; - /* Default channel attributes */ #define DEFAULT_CHANNEL_NAME "channel0" #define DEFAULT_CHANNEL_OVERWRITE 0 /* usec */ diff --git a/include/lttng/lttng-kconsumerd.h b/include/lttng/lttng-kconsumerd.h index e09bdc3bd..2aa337fa6 100644 --- a/include/lttng/lttng-kconsumerd.h +++ b/include/lttng/lttng-kconsumerd.h @@ -21,6 +21,7 @@ #include #include +#include /* * When the receiving thread dies, we need to have a way to make the polling diff --git a/include/lttng/lttng.h b/include/lttng/lttng.h index 0811d594d..3e5b05562 100644 --- a/include/lttng/lttng.h +++ b/include/lttng/lttng.h @@ -23,10 +23,9 @@ #ifndef _LTTNG_H #define _LTTNG_H -#include -#include -#include #include +#include +#include /* Default unix group name for tracing. */ #define LTTNG_DEFAULT_TRACING_GROUP "tracing" diff --git a/libkernelctl/Makefile.am b/libkernelctl/Makefile.am index 97a2c9711..cabdeedd9 100644 --- a/libkernelctl/Makefile.am +++ b/libkernelctl/Makefile.am @@ -2,4 +2,4 @@ AM_CPPFLAGS = -I$(top_srcdir)/include noinst_LTLIBRARIES = libkernelctl.la -libkernelctl_la_SOURCES = kernelctl.c kernelctl.h kernel-ioctl.h +libkernelctl_la_SOURCES = kernelctl.c kernel-ioctl.h diff --git a/libkernelctl/kernelctl.c b/libkernelctl/kernelctl.c index afb0e012b..7936b2742 100644 --- a/libkernelctl/kernelctl.c +++ b/libkernelctl/kernelctl.c @@ -19,8 +19,9 @@ #include +#include + #include "kernel-ioctl.h" -#include "kernelctl.h" int kernctl_create_session(int fd) { diff --git a/liblttng-sessiond-comm/lttng-sessiond-comm.c b/liblttng-sessiond-comm/lttng-sessiond-comm.c index 9a540f0a6..b293ac0b0 100644 --- a/liblttng-sessiond-comm/lttng-sessiond-comm.c +++ b/liblttng-sessiond-comm/lttng-sessiond-comm.c @@ -17,6 +17,7 @@ */ #define _GNU_SOURCE +#include #include #include #include @@ -26,7 +27,6 @@ #include #include #include -#include #include diff --git a/liblttngctl/lttngctl.c b/liblttngctl/lttngctl.c index 42f3ad2ae..b83d5ca92 100644 --- a/liblttngctl/lttngctl.c +++ b/liblttngctl/lttngctl.c @@ -21,18 +21,17 @@ */ #define _GNU_SOURCE -#include #include +#include #include #include #include #include -#include - #include -#include "lttngerr.h" -#include "lttng-share.h" +#include +#include +#include /* Socket to session daemon for communication */ static int sessiond_socket; diff --git a/liblttngkconsumerd/Makefile.am b/liblttngkconsumerd/Makefile.am index edd005930..e8c5741b3 100644 --- a/liblttngkconsumerd/Makefile.am +++ b/liblttngkconsumerd/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/libkernelctl +AM_CPPFLAGS = -I$(top_srcdir)/include lib_LTLIBRARIES = liblttngkconsumerd.la diff --git a/liblttngkconsumerd/lttngkconsumerd.c b/liblttngkconsumerd/lttngkconsumerd.c index 5c9f613b1..78291d56b 100644 --- a/liblttngkconsumerd/lttngkconsumerd.c +++ b/liblttngkconsumerd/lttngkconsumerd.c @@ -18,6 +18,7 @@ */ #define _GNU_SOURCE +#include #include #include #include @@ -27,14 +28,11 @@ #include #include #include -#include -#include +#include +#include #include - -#include "kernelctl.h" -#include "lttngerr.h" -#include "lttng-sessiond-comm.h" +#include static struct lttng_kconsumerd_global_data { /* diff --git a/ltt-kconsumerd/Makefile.am b/ltt-kconsumerd/Makefile.am index 9ba16549b..068c55544 100644 --- a/ltt-kconsumerd/Makefile.am +++ b/ltt-kconsumerd/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/libkernelctl +AM_CPPFLAGS = -I$(top_srcdir)/include bin_PROGRAMS = ltt-kconsumerd diff --git a/ltt-kconsumerd/ltt-kconsumerd.c b/ltt-kconsumerd/ltt-kconsumerd.c index 7eab42e52..d562c1729 100644 --- a/ltt-kconsumerd/ltt-kconsumerd.c +++ b/ltt-kconsumerd/ltt-kconsumerd.c @@ -38,12 +38,11 @@ #include #include +#include +#include +#include #include - -#include "lttngerr.h" -#include "kernelctl.h" -#include "ltt-kconsumerd.h" -#include "lttng-sessiond-comm.h" +#include /* the two threads (receive fd and poll) */ static pthread_t threads[2]; diff --git a/ltt-sessiond/Makefile.am b/ltt-sessiond/Makefile.am index daa4265c1..80c6b81e2 100644 --- a/ltt-sessiond/Makefile.am +++ b/ltt-sessiond/Makefile.am @@ -1,6 +1,5 @@ AM_CPPFLAGS = -I$(top_srcdir)/include \ - -I$(top_srcdir)/libkernelctl -I$(top_srcdir)/libustctl \ - -DINSTALL_BIN_PATH=\"$(bindir)\" + -DINSTALL_BIN_PATH=\""$(bindir)"\" AM_CFLAGS = -fno-strict-aliasing diff --git a/ltt-sessiond/context.c b/ltt-sessiond/context.c index dc7712270..7ec75ffaf 100644 --- a/ltt-sessiond/context.c +++ b/ltt-sessiond/context.c @@ -1,19 +1,18 @@ /* * 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; only version 2 - * of the License. + * 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; only version 2 of the License. * - * 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. + * 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. + * 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. */ #define _GNU_SOURCE @@ -21,10 +20,13 @@ #include #include #include + +#include #include #include "lttngerr.h" #include "context.h" +#include "kernel-ctl.h" /* * Add kernel context to an event of a specific channel. diff --git a/ltt-sessiond/context.h b/ltt-sessiond/context.h index 28586521b..c8cd62776 100644 --- a/ltt-sessiond/context.h +++ b/ltt-sessiond/context.h @@ -1,32 +1,25 @@ /* * 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; only version 2 - * of the License. + * 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; only version 2 of the License. * - * 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. + * 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. + * 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_CONTEXT_H #define _LTT_CONTEXT_H -#include -#include +#include -#include -#include - -#include "lttng-kernel.h" -#include "kernel-ctl.h" #include "trace.h" int add_kernel_context(struct ltt_kernel_session *ksession, diff --git a/ltt-sessiond/kernel-ctl.c b/ltt-sessiond/kernel-ctl.c index 5c452ca92..6247ce6bd 100644 --- a/ltt-sessiond/kernel-ctl.c +++ b/ltt-sessiond/kernel-ctl.c @@ -24,8 +24,9 @@ #include #include -#include "lttngerr.h" -#include "kernelctl.h" +#include +#include + #include "kernel-ctl.h" /* diff --git a/ltt-sessiond/main.c b/ltt-sessiond/main.c index 70c194b22..dd9f221de 100644 --- a/ltt-sessiond/main.c +++ b/ltt-sessiond/main.c @@ -29,29 +29,23 @@ #include #include #include -#include #include -#include +#include #include #include #include -#include -#include #include -#include /* URCU list library (-lurcu) */ -#include -#include +#include #include +#include +#include #include "context.h" -#include "ltt-sessiond.h" -#include "lttngerr.h" #include "kernel-ctl.h" -#include "ust-ctl.h" -#include "session.h" +#include "ltt-sessiond.h" #include "traceable-app.h" -#include "ltt-kconsumerd.h" +#include "ust-ctl.h" #include "utils.h" /* Const values */ diff --git a/ltt-sessiond/session.c b/ltt-sessiond/session.c index 1ffe1d8e7..9ca6a69ad 100644 --- a/ltt-sessiond/session.c +++ b/ltt-sessiond/session.c @@ -22,10 +22,10 @@ #include #include #include -#include #include -#include "lttngerr.h" +#include + #include "session.h" /* diff --git a/ltt-sessiond/trace.c b/ltt-sessiond/trace.c index 0ae80adbc..8b123a79d 100644 --- a/ltt-sessiond/trace.c +++ b/ltt-sessiond/trace.c @@ -21,9 +21,9 @@ #include #include #include -#include -#include "lttngerr.h" +#include + #include "trace.h" /* diff --git a/ltt-sessiond/trace.h b/ltt-sessiond/trace.h index ac070908a..6fd36d61c 100644 --- a/ltt-sessiond/trace.h +++ b/ltt-sessiond/trace.h @@ -23,8 +23,7 @@ #include #include - -#include "lttng-kernel.h" +#include /* Kernel event list */ struct ltt_kernel_event_list { diff --git a/ltt-sessiond/traceable-app.c b/ltt-sessiond/traceable-app.c index cce8a5827..ad4212e7d 100644 --- a/ltt-sessiond/traceable-app.c +++ b/ltt-sessiond/traceable-app.c @@ -21,9 +21,9 @@ #include #include #include -#include -#include "lttngerr.h" +#include + #include "traceable-app.h" /* Number of element for the list below. */ diff --git a/ltt-sessiond/traceable-app.h b/ltt-sessiond/traceable-app.h index 4a9e11493..b43d1b044 100644 --- a/ltt-sessiond/traceable-app.h +++ b/ltt-sessiond/traceable-app.h @@ -19,6 +19,8 @@ #ifndef _TRACEABLE_APP_H #define _TRACEABLE_APP_H +#include + /* Traceable application list */ struct ltt_traceable_app_list { struct cds_list_head head; diff --git a/ltt-sessiond/utils.c b/ltt-sessiond/utils.c index 6b22d9693..91972e9a8 100644 --- a/ltt-sessiond/utils.c +++ b/ltt-sessiond/utils.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2011 - David Goulet - * Copyright (C) 2011 - Mathieu Desnoyers + * Mathieu Desnoyers * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/lttng/Makefile.am b/lttng/Makefile.am index 8dc68e45b..1105143f3 100644 --- a/lttng/Makefile.am +++ b/lttng/Makefile.am @@ -1,4 +1,5 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include -DINSTALL_BIN_PATH=\""$(bindir)"\" +AM_CPPFLAGS = -I$(top_srcdir)/include \ + -DINSTALL_BIN_PATH=\""$(bindir)"\" bin_PROGRAMS = lttng -- 2.34.1