Commit | Line | Data |
---|---|---|
d0b96690 | 1 | /* |
ab5be9fa | 2 | * Copyright (C) 2013 David Goulet <dgoulet@efficios.com> |
aeeb48c6 | 3 | * Copyright (C) 2022 Jérémie Galarneau <jeremie.galarneau@efficios.com> |
d0b96690 | 4 | * |
ab5be9fa | 5 | * SPDX-License-Identifier: GPL-2.0-only |
d0b96690 | 6 | * |
d0b96690 DG |
7 | */ |
8 | ||
9 | #ifndef LTTNG_UST_REGISTRY_H | |
10 | #define LTTNG_UST_REGISTRY_H | |
11 | ||
12 | #include <pthread.h> | |
13 | #include <stdint.h> | |
aeeb48c6 JG |
14 | #include <ctime> |
15 | #include <string> | |
16 | #include <memory> | |
d0b96690 | 17 | |
c9e313bc SM |
18 | #include <common/hashtable/hashtable.hpp> |
19 | #include <common/uuid.hpp> | |
d0b96690 | 20 | |
aeeb48c6 JG |
21 | #include <lttng/domain.h> |
22 | ||
c9e313bc | 23 | #include "lttng-ust-ctl.hpp" |
7972aab2 | 24 | |
d0b96690 DG |
25 | #define CTF_SPEC_MAJOR 1 |
26 | #define CTF_SPEC_MINOR 8 | |
27 | ||
28 | struct ust_app; | |
29 | ||
aeeb48c6 JG |
30 | class ust_registry_session { |
31 | public: | |
32 | virtual lttng_buffer_type get_buffering_scheme() const = 0; | |
33 | virtual ~ust_registry_session(); | |
34 | ||
35 | protected: | |
36 | /* Prevent instanciation of this base class. */ | |
37 | ust_registry_session(unsigned int bits_per_long, | |
38 | unsigned int uint8_t_alignment, | |
39 | unsigned int uint16_t_alignment, | |
40 | unsigned int uint32_t_alignment, | |
41 | unsigned int uint64_t_alignment, | |
42 | unsigned int long_alignment, | |
43 | int byte_order, | |
44 | unsigned int app_tracer_version_major, | |
45 | unsigned int app_tracer_version_minor, | |
46 | const char *root_shm_path, | |
47 | const char *shm_path, | |
48 | uid_t euid, | |
49 | gid_t egid, | |
50 | uint64_t tracing_id); | |
51 | ||
52 | void statedump(); | |
53 | ||
54 | public: | |
d0b96690 | 55 | /* |
dc2bbdae MD |
56 | * With multiple writers and readers, use this lock to access |
57 | * the registry. Can nest within the ust app session lock. | |
58 | * Also acts as a registry serialization lock. Used by registry | |
59 | * readers to serialize the registry information sent from the | |
60 | * sessiond to the consumerd. | |
61 | * The consumer socket lock nests within this lock. | |
d0b96690 | 62 | */ |
aeeb48c6 | 63 | pthread_mutex_t _lock; |
d0b96690 | 64 | /* Next channel ID available for a newly registered channel. */ |
aeeb48c6 | 65 | uint32_t _next_channel_id = 0; |
d0b96690 | 66 | /* Once this value reaches UINT32_MAX, no more id can be allocated. */ |
aeeb48c6 | 67 | uint32_t _used_channel_id = 0; |
10b56aef | 68 | /* Next enumeration ID available. */ |
aeeb48c6 | 69 | uint64_t _next_enum_id = 0; |
d0b96690 | 70 | /* Universal unique identifier used by the tracer. */ |
328c2fe7 | 71 | lttng_uuid _uuid = {}; |
d0b96690 DG |
72 | |
73 | /* session ABI description */ | |
74 | ||
75 | /* Size of long, in bits */ | |
aeeb48c6 | 76 | unsigned int _bits_per_long; |
d0b96690 | 77 | /* Alignment, in bits */ |
aeeb48c6 JG |
78 | unsigned int _uint8_t_alignment, _uint16_t_alignment, _uint32_t_alignment, |
79 | _uint64_t_alignment, _long_alignment; | |
80 | /* endianness: BIG_ENDIAN or LITTLE_ENDIAN */ | |
81 | int _byte_order; | |
d0b96690 DG |
82 | |
83 | /* Generated metadata. */ | |
aeeb48c6 JG |
84 | char *_metadata = nullptr; /* NOT null-terminated ! Use memcpy. */ |
85 | size_t _metadata_len = 0, _metadata_alloc_len = 0; | |
d88aee68 | 86 | /* Length of bytes sent to the consumer. */ |
aeeb48c6 | 87 | size_t _metadata_len_sent = 0; |
93ec662e | 88 | /* Current version of the metadata. */ |
aeeb48c6 | 89 | uint64_t _metadata_version = 0; |
d7ba1388 | 90 | |
9aed4377 JG |
91 | /* |
92 | * Those fields are only used when a session is created with | |
93 | * the --shm-path option. In this case, the metadata is output | |
94 | * twice: once to the consumer, as ususal, but a second time | |
95 | * also in the shm path directly. This is done so that a copy | |
96 | * of the metadata that is as fresh as possible is available | |
97 | * on the event of a crash. | |
98 | * | |
99 | * root_shm_path contains the shm-path provided by the user, along with | |
100 | * the session's name and timestamp: | |
101 | * e.g. /tmp/my_shm/my_session-20180612-135822 | |
102 | * | |
103 | * shm_path contains the full path of the memory buffers: | |
104 | * e.g. /tmp/my_shm/my_session-20180612-135822/ust/uid/1000/64-bit | |
105 | * | |
106 | * metadata_path contains the full path to the metadata file that | |
107 | * is kept for the "crash buffer" extraction: | |
aeeb48c6 JG |
108 | * e.g. |
109 | * /tmp/my_shm/my_session-20180612-135822/ust/uid/1000/64-bit/metadata | |
9aed4377 JG |
110 | * |
111 | * Note that this is not the trace's final metadata file. It is | |
112 | * only meant to be used to read the contents of the ring buffers | |
113 | * in the event of a crash. | |
114 | * | |
115 | * metadata_fd is a file descriptor that points to the file at | |
116 | * 'metadata_path'. | |
117 | */ | |
aeeb48c6 JG |
118 | char _root_shm_path[PATH_MAX] = {}; |
119 | char _shm_path[PATH_MAX] = {}; | |
120 | char _metadata_path[PATH_MAX] = {}; | |
121 | /* File-backed metadata FD */ | |
122 | int _metadata_fd = -1; | |
d7ba1388 | 123 | |
45893984 | 124 | /* |
dc2bbdae MD |
125 | * Hash table containing channels sent by the UST tracer. MUST |
126 | * be accessed with a RCU read side lock acquired. | |
45893984 | 127 | */ |
aeeb48c6 JG |
128 | lttng_ht::uptr _channels; |
129 | ||
dc2bbdae MD |
130 | /* |
131 | * Unique key to identify the metadata on the consumer side. | |
132 | */ | |
aeeb48c6 | 133 | uint64_t _metadata_key = 0; |
7972aab2 DG |
134 | /* |
135 | * Indicates if the metadata is closed on the consumer side. This is to | |
136 | * avoid double close of metadata when an application unregisters AND | |
137 | * deletes its sessions. | |
138 | */ | |
aeeb48c6 | 139 | bool _metadata_closed = false; |
4628484a MD |
140 | |
141 | /* User and group owning the session. */ | |
aeeb48c6 JG |
142 | uid_t _uid = -1; |
143 | gid_t _gid = -1; | |
10b56aef MD |
144 | |
145 | /* Enumerations table. */ | |
aeeb48c6 | 146 | lttng_ht::uptr _enums; |
7062f070 JD |
147 | |
148 | /* | |
149 | * Copy of the tracer version when the first app is registered. | |
150 | * It is used if we need to regenerate the metadata. | |
151 | */ | |
aeeb48c6 JG |
152 | uint32_t _app_tracer_version_major = 0; |
153 | uint32_t _app_tracer_version_minor = 0; | |
8de88061 JR |
154 | |
155 | /* The id of the parent session */ | |
aeeb48c6 JG |
156 | uint64_t _tracing_id = -1ULL; |
157 | }; | |
158 | ||
159 | class ust_registry_session_per_uid : public ust_registry_session { | |
160 | public: | |
161 | ust_registry_session_per_uid(uint32_t bits_per_long, | |
162 | uint32_t uint8_t_alignment, | |
163 | uint32_t uint16_t_alignment, | |
164 | uint32_t uint32_t_alignment, | |
165 | uint32_t uint64_t_alignment, | |
166 | uint32_t long_alignment, | |
167 | int byte_order, | |
168 | uint32_t major, | |
169 | uint32_t minor, | |
170 | const char *root_shm_path, | |
171 | const char *shm_path, | |
172 | uid_t euid, | |
173 | gid_t egid, | |
174 | uint64_t tracing_id, | |
175 | uid_t tracing_uid); | |
176 | ||
177 | virtual lttng_buffer_type get_buffering_scheme() const noexcept override final; | |
178 | ||
179 | const uid_t _tracing_uid; | |
180 | }; | |
181 | ||
182 | class ust_registry_session_per_pid : public ust_registry_session { | |
183 | public: | |
184 | ust_registry_session_per_pid(const struct ust_app &app, | |
185 | uint32_t bits_per_long, | |
186 | uint32_t uint8_t_alignment, | |
187 | uint32_t uint16_t_alignment, | |
188 | uint32_t uint32_t_alignment, | |
189 | uint32_t uint64_t_alignment, | |
190 | uint32_t long_alignment, | |
191 | int byte_order, | |
192 | uint32_t major, | |
193 | uint32_t minor, | |
194 | const char *root_shm_path, | |
195 | const char *shm_path, | |
196 | uid_t euid, | |
197 | gid_t egid, | |
198 | uint64_t tracing_id); | |
199 | ||
200 | virtual lttng_buffer_type get_buffering_scheme() const noexcept override final; | |
201 | ||
202 | pid_t get_vpid() const | |
203 | { | |
204 | return _vpid; | |
205 | } | |
206 | ||
207 | const unsigned int _tracer_patch_level_version; | |
208 | const pid_t _vpid; | |
209 | const std::string _procname; | |
210 | const std::time_t _app_creation_time; | |
d0b96690 DG |
211 | }; |
212 | ||
213 | struct ust_registry_channel { | |
45893984 | 214 | uint64_t key; |
e9404c27 | 215 | uint64_t consumer_key; |
d0b96690 DG |
216 | /* Id set when replying to a register channel. */ |
217 | uint32_t chan_id; | |
b623cb6a | 218 | enum lttng_ust_ctl_channel_header header_type; |
d0b96690 | 219 | |
7972aab2 DG |
220 | /* |
221 | * Flag for this channel if the metadata was dumped once during | |
222 | * registration. 0 means no, 1 yes. | |
223 | */ | |
224 | unsigned int metadata_dumped; | |
225 | /* Indicates if this channel registry has already been registered. */ | |
226 | unsigned int register_done; | |
227 | ||
d0b96690 DG |
228 | /* |
229 | * Hash table containing events sent by the UST tracer. MUST be accessed | |
230 | * with a RCU read side lock acquired. | |
231 | */ | |
0d19be9d | 232 | struct lttng_ht *events; |
d0b96690 DG |
233 | /* Next event ID available for a newly registered event. */ |
234 | uint32_t next_event_id; | |
235 | /* Once this value reaches UINT32_MAX, no more id can be allocated. */ | |
236 | uint32_t used_event_id; | |
237 | /* | |
238 | * Context fields of the registry. Context are per channel. Allocated by a | |
239 | * register channel notification from the UST tracer. | |
240 | */ | |
241 | size_t nr_ctx_fields; | |
b623cb6a | 242 | struct lttng_ust_ctl_field *ctx_fields; |
45893984 | 243 | struct lttng_ht_node_u64 node; |
36b588ed MD |
244 | /* For delayed reclaim */ |
245 | struct rcu_head rcu_head; | |
d0b96690 DG |
246 | }; |
247 | ||
248 | /* | |
249 | * Event registered from a UST tracer sent to the session daemon. This is | |
250 | * indexed and matched by <event_name/signature>. | |
251 | */ | |
252 | struct ust_registry_event { | |
253 | int id; | |
254 | /* Both objd are set by the tracer. */ | |
255 | int session_objd; | |
256 | int channel_objd; | |
257 | /* Name of the event returned by the tracer. */ | |
fc4b93fa | 258 | char name[LTTNG_UST_ABI_SYM_NAME_LEN]; |
d0b96690 | 259 | char *signature; |
2106efa0 | 260 | int loglevel_value; |
d0b96690 | 261 | size_t nr_fields; |
b623cb6a | 262 | struct lttng_ust_ctl_field *fields; |
d0b96690 | 263 | char *model_emf_uri; |
7972aab2 DG |
264 | /* |
265 | * Flag for this channel if the metadata was dumped once during | |
266 | * registration. 0 means no, 1 yes. | |
267 | */ | |
268 | unsigned int metadata_dumped; | |
d0b96690 DG |
269 | /* |
270 | * Node in the ust-registry hash table. The event name is used to | |
271 | * initialize the node and the event_name/signature for the match function. | |
272 | */ | |
7972aab2 | 273 | struct lttng_ht_node_u64 node; |
d0b96690 DG |
274 | }; |
275 | ||
10b56aef | 276 | struct ust_registry_enum { |
fc4b93fa | 277 | char name[LTTNG_UST_ABI_SYM_NAME_LEN]; |
b623cb6a | 278 | struct lttng_ust_ctl_enum_entry *entries; |
10b56aef MD |
279 | size_t nr_entries; |
280 | uint64_t id; /* enum id in session */ | |
281 | /* Enumeration node in session hash table. */ | |
282 | struct lttng_ht_node_str node; | |
283 | /* For delayed reclaim. */ | |
284 | struct rcu_head rcu_head; | |
285 | }; | |
286 | ||
d0b96690 DG |
287 | /* |
288 | * Validate that the id has reached the maximum allowed or not. | |
289 | * | |
290 | * Return 0 if NOT else 1. | |
291 | */ | |
292 | static inline int ust_registry_is_max_id(uint32_t id) | |
293 | { | |
294 | return (id == UINT32_MAX) ? 1 : 0; | |
295 | } | |
296 | ||
297 | /* | |
298 | * Return next available event id and increment the used counter. The | |
299 | * ust_registry_is_max_id function MUST be called before in order to validate | |
300 | * if the maximum number of IDs have been reached. If not, it is safe to call | |
301 | * this function. | |
302 | * | |
303 | * Return a unique channel ID. If max is reached, the used_event_id counter is | |
304 | * returned. | |
305 | */ | |
306 | static inline uint32_t ust_registry_get_next_event_id( | |
307 | struct ust_registry_channel *r) | |
308 | { | |
309 | if (ust_registry_is_max_id(r->used_event_id)) { | |
310 | return r->used_event_id; | |
311 | } | |
312 | ||
313 | r->used_event_id++; | |
314 | return r->next_event_id++; | |
315 | } | |
316 | ||
317 | /* | |
318 | * Return next available channel id and increment the used counter. The | |
319 | * ust_registry_is_max_id function MUST be called before in order to validate | |
320 | * if the maximum number of IDs have been reached. If not, it is safe to call | |
321 | * this function. | |
322 | * | |
323 | * Return a unique channel ID. If max is reached, the used_channel_id counter | |
324 | * is returned. | |
325 | */ | |
326 | static inline uint32_t ust_registry_get_next_chan_id( | |
aeeb48c6 | 327 | ust_registry_session *r) |
d0b96690 | 328 | { |
aeeb48c6 JG |
329 | if (ust_registry_is_max_id(r->_used_channel_id)) { |
330 | return r->_used_channel_id; | |
d0b96690 DG |
331 | } |
332 | ||
aeeb48c6 JG |
333 | r->_used_channel_id++; |
334 | return r->_next_channel_id++; | |
d0b96690 DG |
335 | } |
336 | ||
337 | /* | |
338 | * Return registry event count. This is read atomically. | |
339 | */ | |
340 | static inline uint32_t ust_registry_get_event_count( | |
341 | struct ust_registry_channel *r) | |
342 | { | |
343 | return (uint32_t) uatomic_read(&r->used_event_id); | |
344 | } | |
345 | ||
7972aab2 DG |
346 | #ifdef HAVE_LIBLTTNG_UST_CTL |
347 | ||
aeeb48c6 | 348 | void ust_registry_channel_destroy(ust_registry_session *session, |
d0b96690 | 349 | struct ust_registry_channel *chan); |
45893984 | 350 | struct ust_registry_channel *ust_registry_channel_find( |
aeeb48c6 JG |
351 | ust_registry_session *session, uint64_t key); |
352 | int ust_registry_channel_add(ust_registry_session *session, | |
45893984 | 353 | uint64_t key); |
aeeb48c6 | 354 | void ust_registry_channel_del_free(ust_registry_session *session, |
e9404c27 | 355 | uint64_t key, bool notif); |
aeeb48c6 | 356 | void ust_registry_channel_destroy(struct ust_registry_channel *chan, bool notify); |
45893984 | 357 | |
aeeb48c6 JG |
358 | /* |
359 | * Create per-uid registry with default values. | |
360 | * | |
361 | * Return new instance on success, nullptr on error. | |
362 | */ | |
363 | ust_registry_session *ust_registry_session_per_uid_create( | |
d0b96690 DG |
364 | uint32_t bits_per_long, |
365 | uint32_t uint8_t_alignment, | |
366 | uint32_t uint16_t_alignment, | |
367 | uint32_t uint32_t_alignment, | |
368 | uint32_t uint64_t_alignment, | |
369 | uint32_t long_alignment, | |
af6142cf MD |
370 | int byte_order, |
371 | uint32_t major, | |
d7ba1388 | 372 | uint32_t minor, |
3d071855 | 373 | const char *root_shm_path, |
d7ba1388 MD |
374 | const char *shm_path, |
375 | uid_t euid, | |
8de88061 JR |
376 | gid_t egid, |
377 | uint64_t tracing_id, | |
378 | uid_t tracing_uid); | |
d0b96690 | 379 | |
aeeb48c6 JG |
380 | /* |
381 | * Create per-pid registry with default values. | |
382 | * | |
383 | * Return new instance on success, nullptr on error. | |
384 | */ | |
385 | ust_registry_session *ust_registry_session_per_pid_create(struct ust_app *app, | |
386 | uint32_t bits_per_long, | |
387 | uint32_t uint8_t_alignment, | |
388 | uint32_t uint16_t_alignment, | |
389 | uint32_t uint32_t_alignment, | |
390 | uint32_t uint64_t_alignment, | |
391 | uint32_t long_alignment, | |
392 | int byte_order, | |
393 | uint32_t major, | |
394 | uint32_t minor, | |
395 | const char *root_shm_path, | |
396 | const char *shm_path, | |
397 | uid_t euid, | |
398 | gid_t egid, | |
399 | uint64_t tracing_id); | |
400 | void ust_registry_session_destroy(ust_registry_session *session); | |
401 | ||
402 | int ust_registry_create_event(ust_registry_session *session, | |
45893984 | 403 | uint64_t chan_key, int session_objd, int channel_objd, char *name, |
b623cb6a | 404 | char *sig, size_t nr_fields, struct lttng_ust_ctl_field *fields, |
2106efa0 PP |
405 | int loglevel_value, char *model_emf_uri, int buffer_type, |
406 | uint32_t *event_id_p, struct ust_app *app); | |
d0b96690 DG |
407 | struct ust_registry_event *ust_registry_find_event( |
408 | struct ust_registry_channel *chan, char *name, char *sig); | |
409 | void ust_registry_destroy_event(struct ust_registry_channel *chan, | |
410 | struct ust_registry_event *event); | |
411 | ||
412 | /* app can be NULL for registry shared across applications. */ | |
aeeb48c6 JG |
413 | int ust_metadata_session_statedump(ust_registry_session *session); |
414 | int ust_metadata_channel_statedump(ust_registry_session *session, | |
d0b96690 | 415 | struct ust_registry_channel *chan); |
aeeb48c6 | 416 | int ust_metadata_event_statedump(ust_registry_session *session, |
d0b96690 DG |
417 | struct ust_registry_channel *chan, |
418 | struct ust_registry_event *event); | |
aeeb48c6 | 419 | int ust_registry_create_or_find_enum(ust_registry_session *session, |
10b56aef | 420 | int session_objd, char *name, |
b623cb6a | 421 | struct lttng_ust_ctl_enum_entry *entries, size_t nr_entries, |
10b56aef MD |
422 | uint64_t *enum_id); |
423 | struct ust_registry_enum * | |
aeeb48c6 | 424 | ust_registry_lookup_enum_by_id(ust_registry_session *session, |
10b56aef | 425 | const char *name, uint64_t id); |
aeeb48c6 JG |
426 | void ust_registry_destroy_enum(ust_registry_session *reg_session, |
427 | struct ust_registry_enum *reg_enum); | |
d0b96690 | 428 | |
7972aab2 DG |
429 | #else /* HAVE_LIBLTTNG_UST_CTL */ |
430 | ||
aeeb48c6 JG |
431 | static inline void ust_registry_channel_destroy( |
432 | struct ust_registry_channel *chan __attribute__((unused)), | |
433 | bool notify __attribute__((unused))) | |
434 | { | |
435 | } | |
f46376a1 | 436 | |
7972aab2 DG |
437 | static inline |
438 | struct ust_registry_channel *ust_registry_channel_find( | |
aeeb48c6 | 439 | ust_registry_session *session __attribute__((unused)), |
f46376a1 | 440 | uint64_t key __attribute__((unused))) |
7972aab2 DG |
441 | { |
442 | return NULL; | |
443 | } | |
f46376a1 | 444 | |
7972aab2 | 445 | static inline |
f46376a1 | 446 | int ust_registry_channel_add( |
aeeb48c6 | 447 | ust_registry_session *session __attribute__((unused)), |
f46376a1 | 448 | uint64_t key __attribute__((unused))) |
7972aab2 DG |
449 | { |
450 | return 0; | |
451 | } | |
f46376a1 | 452 | |
7972aab2 | 453 | static inline |
f46376a1 | 454 | void ust_registry_channel_del_free( |
aeeb48c6 | 455 | ust_registry_session *session __attribute__((unused)), |
f46376a1 MJ |
456 | uint64_t key __attribute__((unused)), |
457 | bool notif __attribute__((unused))) | |
7972aab2 | 458 | {} |
f46376a1 | 459 | |
7972aab2 | 460 | static inline |
aeeb48c6 | 461 | ust_registry_session *ust_registry_session_per_uid_create( |
f46376a1 MJ |
462 | uint32_t bits_per_long __attribute__((unused)), |
463 | uint32_t uint8_t_alignment __attribute__((unused)), | |
464 | uint32_t uint16_t_alignment __attribute__((unused)), | |
465 | uint32_t uint32_t_alignment __attribute__((unused)), | |
466 | uint32_t uint64_t_alignment __attribute__((unused)), | |
467 | uint32_t long_alignment __attribute__((unused)), | |
468 | int byte_order __attribute__((unused)), | |
469 | uint32_t major __attribute__((unused)), | |
470 | uint32_t minor __attribute__((unused)), | |
471 | const char *root_shm_path __attribute__((unused)), | |
472 | const char *shm_path __attribute__((unused)), | |
473 | uid_t euid __attribute__((unused)), | |
474 | gid_t egid __attribute__((unused)), | |
475 | uint64_t tracing_id __attribute__((unused)), | |
476 | uid_t tracing_uid __attribute__((unused))) | |
7972aab2 | 477 | { |
aeeb48c6 JG |
478 | return nullptr; |
479 | } | |
480 | ||
481 | static inline | |
482 | ust_registry_session *ust_registry_session_per_pid_create( | |
483 | struct ust_app *app __attribute__((unused)), | |
484 | uint32_t bits_per_long __attribute__((unused)), | |
485 | uint32_t uint8_t_alignment __attribute__((unused)), | |
486 | uint32_t uint16_t_alignment __attribute__((unused)), | |
487 | uint32_t uint32_t_alignment __attribute__((unused)), | |
488 | uint32_t uint64_t_alignment __attribute__((unused)), | |
489 | uint32_t long_alignment __attribute__((unused)), | |
490 | int byte_order __attribute__((unused)), | |
491 | uint32_t major __attribute__((unused)), | |
492 | uint32_t minor __attribute__((unused)), | |
493 | const char *root_shm_path __attribute__((unused)), | |
494 | const char *shm_path __attribute__((unused)), | |
495 | uid_t euid __attribute__((unused)), | |
496 | gid_t egid __attribute__((unused)), | |
497 | uint64_t tracing_id __attribute__((unused))) | |
498 | { | |
499 | return nullptr; | |
7972aab2 | 500 | } |
f46376a1 | 501 | |
7972aab2 | 502 | static inline |
f46376a1 | 503 | void ust_registry_session_destroy( |
aeeb48c6 | 504 | ust_registry_session *session __attribute__((unused))) |
7972aab2 | 505 | {} |
f46376a1 | 506 | |
7972aab2 | 507 | static inline |
f46376a1 | 508 | int ust_registry_create_event( |
aeeb48c6 | 509 | ust_registry_session *session __attribute__((unused)), |
f46376a1 MJ |
510 | uint64_t chan_key __attribute__((unused)), |
511 | int session_objd __attribute__((unused)), | |
512 | int channel_objd __attribute__((unused)), | |
513 | char *name __attribute__((unused)), | |
514 | char *sig __attribute__((unused)), | |
515 | size_t nr_fields __attribute__((unused)), | |
516 | struct lttng_ust_ctl_field *fields __attribute__((unused)), | |
517 | int loglevel_value __attribute__((unused)), | |
518 | char *model_emf_uri __attribute__((unused)), | |
519 | int buffer_type __attribute__((unused)), | |
520 | uint32_t *event_id_p __attribute__((unused))) | |
7972aab2 DG |
521 | { |
522 | return 0; | |
523 | } | |
524 | static inline | |
525 | struct ust_registry_event *ust_registry_find_event( | |
f46376a1 MJ |
526 | struct ust_registry_channel *chan __attribute__((unused)), |
527 | char *name __attribute__((unused)), | |
528 | char *sig __attribute__((unused))) | |
7972aab2 DG |
529 | { |
530 | return NULL; | |
531 | } | |
f46376a1 | 532 | |
7972aab2 | 533 | static inline |
f46376a1 MJ |
534 | void ust_registry_destroy_event( |
535 | struct ust_registry_channel *chan __attribute__((unused)), | |
536 | struct ust_registry_event *event __attribute__((unused))) | |
7972aab2 DG |
537 | {} |
538 | ||
539 | /* The app object can be NULL for registry shared across applications. */ | |
540 | static inline | |
f46376a1 | 541 | int ust_metadata_session_statedump( |
aeeb48c6 | 542 | ust_registry_session *session __attribute__((unused))) |
7972aab2 DG |
543 | { |
544 | return 0; | |
545 | } | |
f46376a1 | 546 | |
7972aab2 | 547 | static inline |
f46376a1 | 548 | int ust_metadata_channel_statedump( |
aeeb48c6 | 549 | ust_registry_session *session __attribute__((unused)), |
f46376a1 | 550 | struct ust_registry_channel *chan __attribute__((unused))) |
7972aab2 DG |
551 | { |
552 | return 0; | |
553 | } | |
f46376a1 | 554 | |
7972aab2 | 555 | static inline |
f46376a1 | 556 | int ust_metadata_event_statedump( |
aeeb48c6 | 557 | ust_registry_session *session __attribute__((unused)), |
f46376a1 MJ |
558 | struct ust_registry_channel *chan __attribute__((unused)), |
559 | struct ust_registry_event *event __attribute__((unused))) | |
7972aab2 DG |
560 | { |
561 | return 0; | |
562 | } | |
f46376a1 | 563 | |
10b56aef | 564 | static inline |
f46376a1 | 565 | int ust_registry_create_or_find_enum( |
aeeb48c6 | 566 | ust_registry_session *session __attribute__((unused)), |
f46376a1 MJ |
567 | int session_objd __attribute__((unused)), |
568 | char *name __attribute__((unused)), | |
569 | struct lttng_ust_ctl_enum_entry *entries __attribute__((unused)), | |
570 | size_t nr_entries __attribute__((unused)), | |
571 | uint64_t *enum_id __attribute__((unused))) | |
10b56aef MD |
572 | { |
573 | return 0; | |
574 | } | |
f46376a1 | 575 | |
10b56aef MD |
576 | static inline |
577 | struct ust_registry_enum * | |
f46376a1 | 578 | ust_registry_lookup_enum_by_id( |
aeeb48c6 | 579 | ust_registry_session *session __attribute__((unused)), |
f46376a1 MJ |
580 | const char *name __attribute__((unused)), |
581 | uint64_t id __attribute__((unused))) | |
10b56aef MD |
582 | { |
583 | return NULL; | |
584 | } | |
7972aab2 | 585 | |
aeeb48c6 JG |
586 | static inline |
587 | void ust_registry_destroy_enum(ust_registry_session *reg_session __attribute__((unused)), | |
588 | struct ust_registry_enum *reg_enum __attribute__((unused))) | |
589 | {} | |
590 | ||
7972aab2 DG |
591 | #endif /* HAVE_LIBLTTNG_UST_CTL */ |
592 | ||
d0b96690 | 593 | #endif /* LTTNG_UST_REGISTRY_H */ |