From: David Goulet Date: Thu, 25 Aug 2011 18:12:04 +0000 (-0400) Subject: Fix headers include and rename kernctl.h header X-Git-Tag: v2.0-pre12~6 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=1e307fab325060d9db4e989c0fdc3cddf46f50f6;p=lttng-tools.git 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 --- diff --git a/include/lttng-kernel-ctl.h b/include/lttng-kernel-ctl.h new file mode 100644 index 000000000..b51273fac --- /dev/null +++ b/include/lttng-kernel-ctl.h @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2011 - Julien Desfossez + * Mathieu Desnoyers + * + * 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. + * + * 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_LIBKERNELCTL_H +#define _LTT_LIBKERNELCTL_H + +#include +#include + +int kernctl_create_session(int fd); +int kernctl_open_metadata(int fd, struct lttng_channel_attr *chops); +int kernctl_create_channel(int fd, struct lttng_channel_attr *chops); +int kernctl_create_stream(int fd); +int kernctl_create_event(int fd, struct lttng_kernel_event *ev); +int kernctl_add_context(int fd, struct lttng_kernel_context *ctx); + +int kernctl_enable(int fd); +int kernctl_disable(int fd); +int kernctl_start_session(int fd); +int kernctl_stop_session(int fd); + +int kernctl_tracepoint_list(int fd); +int kernctl_tracer_version(int fd, struct lttng_kernel_tracer_version *v); +int kernctl_wait_quiescent(int fd); +int kernctl_calibrate(int fd, struct lttng_kernel_calibrate *calibrate); + + +/* Buffer operations */ + +/* For mmap mode, readable without "get" operation */ +int kernctl_get_mmap_len(int fd, unsigned long *len); +int kernctl_get_max_subbuf_size(int fd, unsigned long *len); + +/* + * For mmap mode, operate on the current packet (between get/put or + * get_next/put_next). + */ +int kernctl_get_mmap_read_offset(int fd, unsigned long *len); +int kernctl_get_subbuf_size(int fd, unsigned long *len); +int kernctl_get_padded_subbuf_size(int fd, unsigned long *len); + +int kernctl_get_next_subbuf(int fd); +int kernctl_put_next_subbuf(int fd); + +/* snapshot */ +int kernctl_snapshot(int fd); +int kernctl_snapshot_get_consumed(int fd, unsigned long *pos); +int kernctl_snapshot_get_produced(int fd, unsigned long *pos); +int kernctl_get_subbuf(int fd, unsigned long *pos); +int kernctl_put_subbuf(int fd); + +int kernctl_buffer_flush(int fd); + +#endif /* _LTT_LIBKERNELCTL_H */ 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/libkernelctl/kernelctl.h b/libkernelctl/kernelctl.h deleted file mode 100644 index 783f1258d..000000000 --- a/libkernelctl/kernelctl.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2011 - Julien Desfossez - * Mathieu Desnoyers - * - * 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. - * - * 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_LIBKERNELCTL_H -#define _LTT_LIBKERNELCTL_H - -#include - -#include "lttng-kernel.h" - -int kernctl_create_session(int fd); -int kernctl_open_metadata(int fd, struct lttng_channel_attr *chops); -int kernctl_create_channel(int fd, struct lttng_channel_attr *chops); -int kernctl_create_stream(int fd); -int kernctl_create_event(int fd, struct lttng_kernel_event *ev); -int kernctl_add_context(int fd, struct lttng_kernel_context *ctx); - -int kernctl_enable(int fd); -int kernctl_disable(int fd); -int kernctl_start_session(int fd); -int kernctl_stop_session(int fd); - -int kernctl_tracepoint_list(int fd); -int kernctl_tracer_version(int fd, struct lttng_kernel_tracer_version *v); -int kernctl_wait_quiescent(int fd); -int kernctl_calibrate(int fd, struct lttng_kernel_calibrate *calibrate); - - -/* Buffer operations */ - -/* For mmap mode, readable without "get" operation */ -int kernctl_get_mmap_len(int fd, unsigned long *len); -int kernctl_get_max_subbuf_size(int fd, unsigned long *len); - -/* - * For mmap mode, operate on the current packet (between get/put or - * get_next/put_next). - */ -int kernctl_get_mmap_read_offset(int fd, unsigned long *len); -int kernctl_get_subbuf_size(int fd, unsigned long *len); -int kernctl_get_padded_subbuf_size(int fd, unsigned long *len); - -int kernctl_get_next_subbuf(int fd); -int kernctl_put_next_subbuf(int fd); - -/* snapshot */ -int kernctl_snapshot(int fd); -int kernctl_snapshot_get_consumed(int fd, unsigned long *pos); -int kernctl_snapshot_get_produced(int fd, unsigned long *pos); -int kernctl_get_subbuf(int fd, unsigned long *pos); -int kernctl_put_subbuf(int fd); - -int kernctl_buffer_flush(int fd); - -#endif /* _LTT_LIBKERNELCTL_H */ 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