2 * SPDX-License-Identifier: LGPL-2.1-only
4 * Copyright (C) 2005-2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 * This contains the core definitions for the Linux Trace Toolkit.
9 #ifndef _LTTNG_TRACER_CORE_H
10 #define _LTTNG_TRACER_CORE_H
13 #include <urcu/arch.h>
14 #include <urcu/list.h>
15 #include <lttng/ust-tracer.h>
16 #include <lttng/ringbuffer-context.h>
17 #include <usterr-signal-safe.h>
20 * The longuest possible namespace proc path is with the cgroup ns
21 * and the maximum theoretical linux pid of 536870912 :
23 * /proc/self/task/536870912/ns/cgroup
25 #define LTTNG_PROC_NS_PATH_MAX 40
27 struct lttng_ust_session
;
28 struct lttng_ust_channel_buffer
;
29 struct lttng_ust_ctx_field
;
30 struct lttng_ust_lib_ring_buffer_ctx
;
31 struct lttng_ust_ctx_value
;
32 struct lttng_ust_event_recorder
;
33 struct lttng_ust_event_notifier
;
34 struct lttng_ust_notification_ctx
;
36 __attribute__((visibility("hidden")))
37 int ust_lock(void) __attribute__ ((warn_unused_result
));
39 __attribute__((visibility("hidden")))
40 void ust_lock_nocheck(void);
42 __attribute__((visibility("hidden")))
43 void ust_unlock(void);
45 __attribute__((visibility("hidden")))
46 void lttng_ust_fixup_tls(void);
48 __attribute__((visibility("hidden")))
49 void lttng_fixup_event_tls(void);
51 __attribute__((visibility("hidden")))
52 void lttng_fixup_vtid_tls(void);
54 __attribute__((visibility("hidden")))
55 void lttng_fixup_procname_tls(void);
57 __attribute__((visibility("hidden")))
58 void lttng_fixup_cgroup_ns_tls(void);
60 __attribute__((visibility("hidden")))
61 void lttng_fixup_ipc_ns_tls(void);
63 __attribute__((visibility("hidden")))
64 void lttng_fixup_net_ns_tls(void);
66 __attribute__((visibility("hidden")))
67 void lttng_fixup_time_ns_tls(void);
69 __attribute__((visibility("hidden")))
70 void lttng_fixup_uts_ns_tls(void);
72 __attribute__((visibility("hidden")))
73 void lttng_ust_fixup_fd_tracker_tls(void);
75 __attribute__((visibility("hidden")))
76 const char *lttng_ust_obj_get_name(int id
);
78 __attribute__((visibility("hidden")))
79 int lttng_get_notify_socket(void *owner
);
81 __attribute__((visibility("hidden")))
82 char* lttng_ust_sockinfo_get_procname(void *owner
);
84 __attribute__((visibility("hidden")))
85 void lttng_ust_sockinfo_session_enabled(void *owner
);
87 __attribute__((visibility("hidden")))
88 ssize_t
lttng_ust_read(int fd
, void *buf
, size_t len
);
90 __attribute__((visibility("hidden")))
91 size_t lttng_ust_dummy_get_size(struct lttng_ust_ctx_field
*field
, size_t offset
);
93 __attribute__((visibility("hidden")))
94 void lttng_ust_dummy_record(struct lttng_ust_ctx_field
*field
,
95 struct lttng_ust_lib_ring_buffer_ctx
*ctx
,
96 struct lttng_ust_channel_buffer
*chan
);
97 __attribute__((visibility("hidden")))
98 void lttng_ust_dummy_get_value(struct lttng_ust_ctx_field
*field
,
99 struct lttng_ust_ctx_value
*value
);
101 __attribute__((visibility("hidden")))
102 void lttng_event_notifier_notification_send(
103 struct lttng_ust_event_notifier
*event_notifier
,
104 const char *stack_data
,
105 struct lttng_ust_notification_ctx
*notif_ctx
);
107 __attribute__((visibility("hidden")))
108 struct lttng_counter_transport
*lttng_counter_transport_find(const char *name
);
110 __attribute__((visibility("hidden")))
111 void lttng_counter_transport_register(struct lttng_counter_transport
*transport
);
113 __attribute__((visibility("hidden")))
114 void lttng_counter_transport_unregister(struct lttng_counter_transport
*transport
);
116 #ifdef HAVE_LINUX_PERF_EVENT_H
117 __attribute__((visibility("hidden")))
118 void lttng_ust_fixup_perf_counter_tls(void);
120 __attribute__((visibility("hidden")))
121 void lttng_perf_lock(void);
123 __attribute__((visibility("hidden")))
124 void lttng_perf_unlock(void);
125 #else /* #ifdef HAVE_LINUX_PERF_EVENT_H */
127 void lttng_ust_fixup_perf_counter_tls(void)
131 void lttng_perf_lock(void)
135 void lttng_perf_unlock(void)
138 #endif /* #else #ifdef HAVE_LINUX_PERF_EVENT_H */
140 #endif /* _LTTNG_TRACER_CORE_H */