From 4ab44fbe7377ad603da7dccebf2e0af6b768fa91 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 17 Nov 2011 13:30:00 -0500 Subject: [PATCH] Implement tracepoint-internal.h as LGPLv2.1 (not exported) Signed-off-by: Mathieu Desnoyers --- include/Makefile.am | 1 - include/lttng/ust-events.h | 6 ---- liblttng-ust/Makefile.am | 3 +- liblttng-ust/lttng-ust-abi.c | 6 ++++ liblttng-ust/tracepoint-internal.h | 58 ++++++++++++++++++++++++++++++ 5 files changed, 66 insertions(+), 8 deletions(-) create mode 100644 liblttng-ust/tracepoint-internal.h diff --git a/include/Makefile.am b/include/Makefile.am index cd4619de..9c1a7228 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -34,7 +34,6 @@ noinst_HEADERS = \ lttng/ust-comm.h \ lttng/compat.h \ lttng/marker-internal.h \ - lttng/tracepoint-internal.h \ lttng/clock.h \ lttng/probe-internal.h \ lttng/stringify.h \ diff --git a/include/lttng/ust-events.h b/include/lttng/ust-events.h index 6c272172..1c7140ff 100644 --- a/include/lttng/ust-events.h +++ b/include/lttng/ust-events.h @@ -25,7 +25,6 @@ #include #include #include -#include struct ltt_channel; struct ltt_session; @@ -303,11 +302,6 @@ struct ltt_transport { struct ltt_channel_ops ops; }; -struct ltt_tracepoint_list { - struct tracepoint_iter iter; - int got_first; -}; - struct ltt_session *ltt_session_create(void); int ltt_session_enable(struct ltt_session *session); int ltt_session_disable(struct ltt_session *session); diff --git a/liblttng-ust/Makefile.am b/liblttng-ust/Makefile.am index d98b3f02..9acd241b 100644 --- a/liblttng-ust/Makefile.am +++ b/liblttng-ust/Makefile.am @@ -17,7 +17,8 @@ liblttng_ust_runtime_la_SOURCES = \ lttng-context-procname.c \ ltt-context.c \ ltt-events.c \ - tracepoint.c + tracepoint.c \ + tracepoint-internal.h liblttng_ust_support_la_SOURCES = \ ltt-tracer.h \ diff --git a/liblttng-ust/lttng-ust-abi.c b/liblttng-ust/lttng-ust-abi.c index 435c86a6..e03024f4 100644 --- a/liblttng-ust/lttng-ust-abi.c +++ b/liblttng-ust/lttng-ust-abi.c @@ -31,6 +31,12 @@ #include #include "lttng/core.h" #include "ltt-tracer.h" +#include "tracepoint-internal.h" + +struct ltt_tracepoint_list { + struct tracepoint_iter iter; + int got_first; +}; static int lttng_ust_abi_close_in_progress; diff --git a/liblttng-ust/tracepoint-internal.h b/liblttng-ust/tracepoint-internal.h new file mode 100644 index 00000000..c883c7bd --- /dev/null +++ b/liblttng-ust/tracepoint-internal.h @@ -0,0 +1,58 @@ +#ifndef _LTTNG_TRACEPOINT_INTERNAL_H +#define _LTTNG_TRACEPOINT_INTERNAL_H + +/* + * Copyright (c) 2011 - Mathieu Desnoyers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include + +struct tracepoint_lib { + struct cds_list_head list; + struct tracepoint tracepoints_start; + int tracepoints_count; +}; + +struct tracepoint_iter { + struct tracepoint_lib *lib; + struct tracepoint * const *tracepoint; + +extern int tracepoint_probe_register_noupdate(const char *name, void *callback, void *priv); +extern int tracepoint_probe_unregister_noupdate(const char *name, void *callback, void *priv); +extern int tracepoint_probe_update_all(void); + +extern void tracepoint_iter_start(struct tracepoint_iter *iter); +extern void tracepoint_iter_next(struct tracepoint_iter *iter); +extern void tracepoint_iter_stop(struct tracepoint_iter *iter); +extern void tracepoint_iter_reset(struct tracepoint_iter *iter); +extern int tracepoint_get_iter_range(struct tracepoint * const **tracepoint, + struct tracepoint * const *begin, struct tracepoint * const *end); + +/* + * call after disconnection of last probe implemented within a + * shared object before unmapping the library that contains the probe. + */ +static inline void tracepoint_synchronize_unregister(void) +{ + synchronize_rcu(); +} + +extern void init_tracepoint(void); +extern void exit_tracepoint(void); + +#endif /* _LTTNG_TRACEPOINT_INTERNAL_H */ -- 2.34.1