Fix: pass private data to context callbacks
[lttng-ust.git] / liblttng-ust / lttng-tracer-core.h
index ba232f32acf5dc20067a41d15b496653ca1ee1a8..7714dbf4baad2f744acb3f17686c6c84b17a1cf8 100644 (file)
-#ifndef _LTTNG_TRACER_CORE_H
-#define _LTTNG_TRACER_CORE_H
-
 /*
+ * SPDX-License-Identifier: LGPL-2.1-only
+ *
  * Copyright (C) 2005-2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
  *
  * This contains the core definitions for the Linux Trace Toolkit.
- *
- * 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 <stdint.h>
+#ifndef _LTTNG_TRACER_CORE_H
+#define _LTTNG_TRACER_CORE_H
+
 #include <stddef.h>
 #include <urcu/arch.h>
 #include <urcu/list.h>
 #include <lttng/ust-tracer.h>
-#include <lttng/bug.h>
-#include <lttng/ringbuffer-config.h>
+#include <lttng/ringbuffer-context.h>
 #include <usterr-signal-safe.h>
 
-struct lttng_session;
-struct lttng_channel;
-struct lttng_event;
-struct lttng_ctx_field;
+/*
+ * The longuest possible namespace proc path is with the cgroup ns
+ * and the maximum theoretical linux pid of 536870912 :
+ *
+ *  /proc/self/task/536870912/ns/cgroup
+ */
+#define LTTNG_PROC_NS_PATH_MAX 40
+
+struct lttng_ust_session;
+struct lttng_ust_channel_buffer;
+struct lttng_ust_ctx_field;
 struct lttng_ust_lib_ring_buffer_ctx;
-struct lttng_ctx_value;
+struct lttng_ust_ctx_value;
+struct lttng_ust_event_recorder;
+struct lttng_ust_event_notifier;
+struct lttng_ust_notification_ctx;
+
+int ust_lock(void) __attribute__ ((warn_unused_result))
+       __attribute__((visibility("hidden")));
+
+void ust_lock_nocheck(void)
+       __attribute__((visibility("hidden")));
+
+void ust_unlock(void)
+       __attribute__((visibility("hidden")));
+
+void lttng_ust_fixup_tls(void)
+       __attribute__((visibility("hidden")));
+
+void lttng_fixup_event_tls(void)
+       __attribute__((visibility("hidden")));
+
+void lttng_fixup_vtid_tls(void)
+       __attribute__((visibility("hidden")));
+
+void lttng_fixup_procname_tls(void)
+       __attribute__((visibility("hidden")));
+
+void lttng_fixup_cgroup_ns_tls(void)
+       __attribute__((visibility("hidden")));
+
+void lttng_fixup_ipc_ns_tls(void)
+       __attribute__((visibility("hidden")));
+
+void lttng_fixup_net_ns_tls(void)
+       __attribute__((visibility("hidden")));
+
+void lttng_fixup_time_ns_tls(void)
+       __attribute__((visibility("hidden")));
+
+void lttng_fixup_uts_ns_tls(void)
+       __attribute__((visibility("hidden")));
+
+void lttng_ust_fixup_fd_tracker_tls(void)
+       __attribute__((visibility("hidden")));
+
+const char *lttng_ust_obj_get_name(int id)
+       __attribute__((visibility("hidden")));
+
+int lttng_get_notify_socket(void *owner)
+       __attribute__((visibility("hidden")));
+
+char* lttng_ust_sockinfo_get_procname(void *owner)
+       __attribute__((visibility("hidden")));
+
+void lttng_ust_sockinfo_session_enabled(void *owner)
+       __attribute__((visibility("hidden")));
+
+ssize_t lttng_ust_read(int fd, void *buf, size_t len)
+       __attribute__((visibility("hidden")));
+
+size_t lttng_ust_dummy_get_size(void *priv, size_t offset)
+       __attribute__((visibility("hidden")));
+
+void lttng_ust_dummy_record(void *priv, struct lttng_ust_lib_ring_buffer_ctx *ctx,
+                struct lttng_ust_channel_buffer *chan)
+       __attribute__((visibility("hidden")));
 
-int ust_lock(void) __attribute__ ((warn_unused_result));
-void ust_lock_nocheck(void);
-void ust_unlock(void);
+void lttng_ust_dummy_get_value(void *priv, struct lttng_ust_ctx_value *value)
+       __attribute__((visibility("hidden")));
 
-void lttng_fixup_event_tls(void);
-void lttng_fixup_vtid_tls(void);
-void lttng_fixup_procname_tls(void);
+void lttng_event_notifier_notification_send(
+               struct lttng_ust_event_notifier *event_notifier,
+               const char *stack_data,
+               struct lttng_ust_notification_ctx *notif_ctx)
+       __attribute__((visibility("hidden")));
 
-const char *lttng_ust_obj_get_name(int id);
+struct lttng_counter_transport *lttng_counter_transport_find(const char *name)
+       __attribute__((visibility("hidden")));
 
-int lttng_get_notify_socket(void *owner);
+void lttng_counter_transport_register(struct lttng_counter_transport *transport)
+       __attribute__((visibility("hidden")));
 
-void lttng_ust_sockinfo_session_enabled(void *owner);
+void lttng_counter_transport_unregister(struct lttng_counter_transport *transport)
+       __attribute__((visibility("hidden")));
 
-void lttng_ust_malloc_wrapper_init(void);
+#ifdef HAVE_LINUX_PERF_EVENT_H
+void lttng_ust_fixup_perf_counter_tls(void)
+       __attribute__((visibility("hidden")));
 
-ssize_t lttng_ust_read(int fd, void *buf, size_t len);
+void lttng_perf_lock(void)
+       __attribute__((visibility("hidden")));
 
-size_t lttng_ust_dummy_get_size(struct lttng_ctx_field *field, size_t offset);
-void lttng_ust_dummy_record(struct lttng_ctx_field *field,
-                struct lttng_ust_lib_ring_buffer_ctx *ctx,
-                struct lttng_channel *chan);
-void lttng_ust_dummy_get_value(struct lttng_ctx_field *field,
-               struct lttng_ctx_value *value);
-int lttng_context_is_app(const char *name);
-void lttng_ust_fixup_tls(void);
+void lttng_perf_unlock(void)
+       __attribute__((visibility("hidden")));
+#else /* #ifdef HAVE_LINUX_PERF_EVENT_H */
+static inline
+void lttng_ust_fixup_perf_counter_tls(void)
+{
+}
+static inline
+void lttng_perf_lock(void)
+{
+}
+static inline
+void lttng_perf_unlock(void)
+{
+}
+#endif /* #else #ifdef HAVE_LINUX_PERF_EVENT_H */
 
 #endif /* _LTTNG_TRACER_CORE_H */
This page took 0.023974 seconds and 4 git commands to generate.