Commit | Line | Data |
---|---|---|
4fbf9cd1 | 1 | /* |
c0c0989a MJ |
2 | * SPDX-License-Identifier: LGPL-2.1-only |
3 | * | |
4fbf9cd1 MD |
4 | * Copyright (C) 2005-2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
5 | * | |
6 | * This contains the core definitions for the Linux Trace Toolkit. | |
4fbf9cd1 MD |
7 | */ |
8 | ||
c0c0989a MJ |
9 | #ifndef _LTTNG_TRACER_CORE_H |
10 | #define _LTTNG_TRACER_CORE_H | |
11 | ||
b728d87e MD |
12 | #include <stddef.h> |
13 | #include <urcu/arch.h> | |
4fbf9cd1 | 14 | #include <urcu/list.h> |
44c72f10 MD |
15 | #include <lttng/ust-tracer.h> |
16 | #include <lttng/bug.h> | |
4318ae1b | 17 | #include <lttng/ringbuffer-config.h> |
44c72f10 | 18 | #include <usterr-signal-safe.h> |
864a1eda | 19 | #include <ust-helper.h> |
4fbf9cd1 | 20 | |
735bef47 MJ |
21 | /* |
22 | * The longuest possible namespace proc path is with the cgroup ns | |
23 | * and the maximum theoretical linux pid of 536870912 : | |
24 | * | |
25 | * /proc/self/task/536870912/ns/cgroup | |
26 | */ | |
27 | #define LTTNG_PROC_NS_PATH_MAX 40 | |
28 | ||
7dd08bec MD |
29 | struct lttng_session; |
30 | struct lttng_channel; | |
31 | struct lttng_event; | |
ce7352a2 MD |
32 | struct lttng_ctx_field; |
33 | struct lttng_ust_lib_ring_buffer_ctx; | |
34 | struct lttng_ctx_value; | |
850550e0 | 35 | struct lttng_event_notifier; |
4fbf9cd1 | 36 | |
8aa76003 | 37 | LTTNG_HIDDEN |
3327ac33 | 38 | int ust_lock(void) __attribute__ ((warn_unused_result)); |
8aa76003 | 39 | LTTNG_HIDDEN |
3327ac33 | 40 | void ust_lock_nocheck(void); |
8aa76003 | 41 | LTTNG_HIDDEN |
17dfb34b | 42 | void ust_unlock(void); |
8165c8da | 43 | |
472b4adf MJ |
44 | LTTNG_HIDDEN |
45 | void lttng_ust_fixup_tls(void); | |
46 | LTTNG_HIDDEN | |
eddd8d5d | 47 | void lttng_fixup_event_tls(void); |
472b4adf | 48 | LTTNG_HIDDEN |
4158a15a | 49 | void lttng_fixup_vtid_tls(void); |
472b4adf | 50 | LTTNG_HIDDEN |
009745db | 51 | void lttng_fixup_procname_tls(void); |
472b4adf | 52 | LTTNG_HIDDEN |
735bef47 | 53 | void lttng_fixup_cgroup_ns_tls(void); |
472b4adf | 54 | LTTNG_HIDDEN |
735bef47 | 55 | void lttng_fixup_ipc_ns_tls(void); |
472b4adf | 56 | LTTNG_HIDDEN |
735bef47 | 57 | void lttng_fixup_net_ns_tls(void); |
3046e0bf | 58 | LTTNG_HIDDEN |
cefef7a7 | 59 | void lttng_fixup_time_ns_tls(void); |
472b4adf | 60 | LTTNG_HIDDEN |
735bef47 | 61 | void lttng_fixup_uts_ns_tls(void); |
eddd8d5d | 62 | |
cdcd2ecd MJ |
63 | LTTNG_HIDDEN |
64 | void lttng_ust_fixup_fd_tracker_tls(void); | |
65 | ||
74d81a6c MD |
66 | const char *lttng_ust_obj_get_name(int id); |
67 | ||
32ce8569 MD |
68 | int lttng_get_notify_socket(void *owner); |
69 | ||
94be38e8 JR |
70 | LTTNG_HIDDEN |
71 | char* lttng_ust_sockinfo_get_procname(void *owner); | |
72 | ||
246be17e | 73 | void lttng_ust_sockinfo_session_enabled(void *owner); |
95c25348 | 74 | |
79f3848b MD |
75 | void lttng_ust_malloc_wrapper_init(void); |
76 | ||
405be658 MD |
77 | ssize_t lttng_ust_read(int fd, void *buf, size_t len); |
78 | ||
ce7352a2 MD |
79 | size_t lttng_ust_dummy_get_size(struct lttng_ctx_field *field, size_t offset); |
80 | void lttng_ust_dummy_record(struct lttng_ctx_field *field, | |
81 | struct lttng_ust_lib_ring_buffer_ctx *ctx, | |
82 | struct lttng_channel *chan); | |
83 | void lttng_ust_dummy_get_value(struct lttng_ctx_field *field, | |
84 | struct lttng_ctx_value *value); | |
85 | int lttng_context_is_app(const char *name); | |
86 | ||
cab88ff8 MD |
87 | LTTNG_HIDDEN |
88 | void lttng_event_notifier_notification_send( | |
89 | struct lttng_event_notifier *event_notifier, | |
90 | const char *stack_data); | |
91 | ||
23d128de MJ |
92 | LTTNG_HIDDEN |
93 | struct lttng_counter_transport *lttng_counter_transport_find(const char *name); | |
94 | LTTNG_HIDDEN | |
95 | void lttng_counter_transport_register(struct lttng_counter_transport *transport); | |
96 | LTTNG_HIDDEN | |
97 | void lttng_counter_transport_unregister(struct lttng_counter_transport *transport); | |
98 | ||
bd8c1787 | 99 | #ifdef HAVE_PERF_EVENT |
472b4adf | 100 | LTTNG_HIDDEN |
20142124 MD |
101 | void lttng_ust_fixup_perf_counter_tls(void); |
102 | void lttng_perf_lock(void); | |
103 | void lttng_perf_unlock(void); | |
bd8c1787 | 104 | #else /* #ifdef HAVE_PERF_EVENT */ |
20142124 MD |
105 | static inline |
106 | void lttng_ust_fixup_perf_counter_tls(void) | |
107 | { | |
108 | } | |
109 | static inline | |
110 | void lttng_perf_lock(void) | |
111 | { | |
112 | } | |
113 | static inline | |
114 | void lttng_perf_unlock(void) | |
115 | { | |
116 | } | |
bd8c1787 | 117 | #endif /* #else #ifdef HAVE_PERF_EVENT */ |
20142124 | 118 | |
7dd08bec | 119 | #endif /* _LTTNG_TRACER_CORE_H */ |