6531da40f5032975d2dafa1bff8909c185683ad0
[lttng-ust.git] / liblttng-ust / lttng-tracer-core.h
1 #ifndef _LTTNG_TRACER_CORE_H
2 #define _LTTNG_TRACER_CORE_H
3
4 /*
5 * Copyright (C) 2005-2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 *
7 * This contains the core definitions for the Linux Trace Toolkit.
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; version 2.1 of
12 * the License.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23
24 #include <stddef.h>
25 #include <urcu/arch.h>
26 #include <urcu/list.h>
27 #include <lttng/ust-tracer.h>
28 #include <lttng/bug.h>
29 #include <lttng/ringbuffer-config.h>
30 #include <usterr-signal-safe.h>
31 #include <helper.h>
32
33 /*
34 * The longuest possible namespace proc path is with the cgroup ns
35 * and the maximum theoretical linux pid of 536870912 :
36 *
37 * /proc/self/task/536870912/ns/cgroup
38 */
39 #define LTTNG_PROC_NS_PATH_MAX 40
40
41 struct lttng_session;
42 struct lttng_channel;
43 struct lttng_event;
44 struct lttng_ctx_field;
45 struct lttng_ust_lib_ring_buffer_ctx;
46 struct lttng_ctx_value;
47 struct lttng_event_notifier;
48
49 int ust_lock(void) __attribute__ ((warn_unused_result));
50 void ust_lock_nocheck(void);
51 void ust_unlock(void);
52
53 void lttng_fixup_event_tls(void);
54 void lttng_fixup_vtid_tls(void);
55 void lttng_fixup_procname_tls(void);
56 void lttng_fixup_cgroup_ns_tls(void);
57 void lttng_fixup_ipc_ns_tls(void);
58 void lttng_fixup_net_ns_tls(void);
59 LTTNG_HIDDEN
60 void lttng_fixup_time_ns_tls(void);
61 void lttng_fixup_uts_ns_tls(void);
62
63 const char *lttng_ust_obj_get_name(int id);
64
65 int lttng_get_notify_socket(void *owner);
66
67 LTTNG_HIDDEN
68 char* lttng_ust_sockinfo_get_procname(void *owner);
69
70 void lttng_ust_sockinfo_session_enabled(void *owner);
71
72 void lttng_ust_malloc_wrapper_init(void);
73
74 ssize_t lttng_ust_read(int fd, void *buf, size_t len);
75
76 size_t lttng_ust_dummy_get_size(struct lttng_ctx_field *field, size_t offset);
77 void lttng_ust_dummy_record(struct lttng_ctx_field *field,
78 struct lttng_ust_lib_ring_buffer_ctx *ctx,
79 struct lttng_channel *chan);
80 void lttng_ust_dummy_get_value(struct lttng_ctx_field *field,
81 struct lttng_ctx_value *value);
82 int lttng_context_is_app(const char *name);
83 void lttng_ust_fixup_tls(void);
84
85 extern void (*lttng_ust_liburcu_bp_before_fork)(void);
86 extern void (*lttng_ust_liburcu_bp_after_fork_parent)(void);
87 extern void (*lttng_ust_liburcu_bp_after_fork_child)(void);
88
89 LTTNG_HIDDEN
90 void lttng_event_notifier_notification_send(
91 struct lttng_event_notifier *event_notifier,
92 const char *stack_data);
93
94 LTTNG_HIDDEN
95 struct lttng_counter_transport *lttng_counter_transport_find(const char *name);
96 LTTNG_HIDDEN
97 void lttng_counter_transport_register(struct lttng_counter_transport *transport);
98 LTTNG_HIDDEN
99 void lttng_counter_transport_unregister(struct lttng_counter_transport *transport);
100
101 #ifdef LTTNG_UST_HAVE_PERF_EVENT
102 void lttng_ust_fixup_perf_counter_tls(void);
103 void lttng_perf_lock(void);
104 void lttng_perf_unlock(void);
105 #else /* #ifdef LTTNG_UST_HAVE_PERF_EVENT */
106 static inline
107 void lttng_ust_fixup_perf_counter_tls(void)
108 {
109 }
110 static inline
111 void lttng_perf_lock(void)
112 {
113 }
114 static inline
115 void lttng_perf_unlock(void)
116 {
117 }
118 #endif /* #else #ifdef LTTNG_UST_HAVE_PERF_EVENT */
119
120 #endif /* _LTTNG_TRACER_CORE_H */
This page took 0.031183 seconds and 3 git commands to generate.