refactor: session: provide an iterator over consumer data channel keys
[lttng-tools.git] / src / bin / lttng-sessiond / ust-app.hpp
1 /*
2 * Copyright (C) 2011 EfficiOS Inc.
3 * Copyright (C) 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
4 *
5 * SPDX-License-Identifier: GPL-2.0-only
6 *
7 */
8
9 #ifndef _LTT_UST_APP_H
10 #define _LTT_UST_APP_H
11
12 #include "trace-class.hpp"
13 #include "trace-ust.hpp"
14 #include "ust-field-quirks.hpp"
15
16 #include <common/format.hpp>
17 #include <common/index-allocator.hpp>
18 #include <common/reference.hpp>
19 #include <common/scope-exit.hpp>
20 #include <common/uuid.hpp>
21
22 #include <stdint.h>
23
24 #define UST_APP_EVENT_LIST_SIZE 32
25
26 /* Process name (short). */
27 #define UST_APP_PROCNAME_LEN 16
28
29 struct lttng_bytecode;
30 struct lttng_ust_filter_bytecode;
31
32 namespace lttng {
33 namespace sessiond {
34 namespace ust {
35 class registry_session;
36 } /* namespace ust */
37 } /* namespace sessiond */
38 } /* namespace lttng */
39
40 extern int the_ust_consumerd64_fd, the_ust_consumerd32_fd;
41
42 /*
43 * Object used to close the notify socket in a call_rcu(). Since the
44 * application might not be found, we need an independant object containing the
45 * notify socket fd.
46 */
47 struct ust_app_notify_sock_obj {
48 int fd;
49 struct rcu_head head;
50 };
51
52 struct ust_app_ht_key {
53 const char *name;
54 const struct lttng_bytecode *filter;
55 enum lttng_ust_abi_loglevel_type loglevel_type;
56 int loglevel_value;
57 const struct lttng_event_exclusion *exclusion;
58 };
59
60 /*
61 * Application registration data structure.
62 */
63 struct ust_register_msg {
64 enum lttng_ust_ctl_socket_type type;
65 uint32_t major;
66 uint32_t minor;
67 uint32_t abi_major;
68 uint32_t abi_minor;
69 pid_t pid;
70 pid_t ppid;
71 uid_t uid;
72 gid_t gid;
73 uint32_t bits_per_long;
74 uint32_t uint8_t_alignment;
75 uint32_t uint16_t_alignment;
76 uint32_t uint32_t_alignment;
77 uint32_t uint64_t_alignment;
78 uint32_t long_alignment;
79 int byte_order; /* BIG_ENDIAN or LITTLE_ENDIAN */
80 char name[LTTNG_UST_ABI_PROCNAME_LEN];
81 };
82
83 /*
84 * Global applications HT used by the session daemon. This table is indexed by
85 * PID using the pid_n node and pid value of an ust_app.
86 */
87 extern struct lttng_ht *ust_app_ht;
88
89 /*
90 * Global applications HT used by the session daemon. This table is indexed by
91 * socket using the sock_n node and sock value of an ust_app.
92 *
93 * The 'sock' in question here is the 'command' socket.
94 */
95 extern struct lttng_ht *ust_app_ht_by_sock;
96
97 /*
98 * Global applications HT used by the session daemon. This table is indexed by
99 * socket using the notify_sock_n node and notify_sock value of an ust_app.
100 */
101 extern struct lttng_ht *ust_app_ht_by_notify_sock;
102
103 /* Stream list containing ust_app_stream. */
104 struct ust_app_stream_list {
105 unsigned int count;
106 struct cds_list_head head;
107 };
108
109 struct ust_app_ctx {
110 int handle;
111 struct lttng_ust_context_attr ctx;
112 struct lttng_ust_abi_object_data *obj;
113 struct lttng_ht_node_ulong node;
114 struct cds_list_head list;
115 };
116
117 struct ust_app_event {
118 bool enabled;
119 int handle;
120 struct lttng_ust_abi_object_data *obj;
121 struct lttng_ust_abi_event attr;
122 char name[LTTNG_UST_ABI_SYM_NAME_LEN];
123 struct lttng_ht_node_str node;
124 struct lttng_bytecode *filter;
125 struct lttng_event_exclusion *exclusion;
126 };
127
128 struct ust_app_event_notifier_rule {
129 bool enabled;
130 uint64_t error_counter_index;
131 int handle;
132 struct lttng_ust_abi_object_data *obj;
133 /* Holds a strong reference. */
134 struct lttng_trigger *trigger;
135 /* Unique ID returned by the tracer to identify this event notifier. */
136 uint64_t token;
137 struct lttng_ht_node_u64 node;
138 /* The trigger object owns the filter. */
139 const struct lttng_bytecode *filter;
140 /* Owned by this. */
141 struct lttng_event_exclusion *exclusion;
142 /* For delayed reclaim. */
143 struct rcu_head rcu_head;
144 };
145
146 struct ust_app_stream {
147 int handle;
148 char pathname[PATH_MAX];
149 /* Format is %s_%d respectively channel name and CPU number. */
150 char name[DEFAULT_STREAM_NAME_LEN];
151 struct lttng_ust_abi_object_data *obj;
152 /* Using a list of streams to keep order. */
153 struct cds_list_head list;
154 };
155
156 struct ust_app_channel {
157 bool enabled;
158 int handle;
159 /*
160 * Unique key used to identify the channel on the consumer side.
161 * 0 is a reserved 'invalid' value used to indicate that the consumer
162 * does not know about this channel (i.e. an error occurred).
163 */
164 uint64_t key;
165 /* Id of the tracing channel set on creation. */
166 uint64_t tracing_channel_id;
167 /* Number of stream that this channel is expected to receive. */
168 unsigned int expected_stream_count;
169 char name[LTTNG_UST_ABI_SYM_NAME_LEN];
170 struct lttng_ust_abi_object_data *obj;
171 struct lttng_ust_ctl_consumer_channel_attr attr;
172 struct ust_app_stream_list streams;
173 /* Session pointer that owns this object. */
174 struct ust_app_session *session;
175 /*
176 * Contexts are kept in a hash table for fast lookup and in an ordered list
177 * so we are able to enable them on the tracer side in the same order the
178 * user added them.
179 */
180 struct lttng_ht *ctx;
181 struct cds_list_head ctx_list;
182
183 struct lttng_ht *events;
184 uint64_t tracefile_size;
185 uint64_t tracefile_count;
186 uint64_t monitor_timer_interval;
187 /*
188 * Node indexed by channel name in the channels' hash table of a session.
189 */
190 struct lttng_ht_node_str node;
191 /*
192 * Node indexed by UST channel object descriptor (handle). Stored in the
193 * ust_objd hash table in the ust_app object.
194 */
195 struct lttng_ht_node_ulong ust_objd_node;
196 /* For delayed reclaim */
197 struct rcu_head rcu_head;
198 };
199
200 struct ust_app_session {
201 private:
202 static void _session_unlock(ust_app_session *session)
203 {
204 _const_session_unlock(session);
205 }
206
207 static void _const_session_unlock(const ust_app_session *session)
208 {
209 pthread_mutex_unlock(&session->_lock);
210 }
211
212 public:
213 using locked_weak_ref = lttng::non_copyable_reference<
214 ust_app_session,
215 lttng::memory::create_deleter_class<ust_app_session,
216 ust_app_session::_session_unlock>::deleter>;
217 using const_locked_weak_ref = lttng::non_copyable_reference<
218 const ust_app_session,
219 lttng::memory::create_deleter_class<const ust_app_session,
220 ust_app_session::_const_session_unlock>::deleter>;
221
222 static locked_weak_ref make_locked_weak_ref(ust_app_session& ua_session)
223 {
224 return lttng::make_non_copyable_reference<locked_weak_ref::referenced_type,
225 locked_weak_ref::deleter>(ua_session);
226 }
227
228 static const_locked_weak_ref make_locked_weak_ref(const ust_app_session& ua_session)
229 {
230 return lttng::make_non_copyable_reference<const_locked_weak_ref::referenced_type,
231 const_locked_weak_ref::deleter>(
232 ua_session);
233 }
234
235 ust_app_session::const_locked_weak_ref lock() const noexcept
236 {
237 pthread_mutex_lock(&_lock);
238 return ust_app_session::make_locked_weak_ref(*this);
239 }
240
241 ust_app_session::locked_weak_ref lock() noexcept
242 {
243 pthread_mutex_lock(&_lock);
244 return ust_app_session::make_locked_weak_ref(*this);
245 }
246
247 struct identifier {
248 enum class application_abi : std::uint8_t { ABI_32 = 32, ABI_64 = 64 };
249 enum class buffer_allocation_policy : std::uint8_t { PER_PID, PER_UID };
250
251 /* Unique identifier of the ust_app_session. */
252 std::uint64_t id;
253 /* Unique identifier of the ltt_session. */
254 std::uint64_t session_id;
255 /* Credentials of the application which owns the ust_app_session. */
256 lttng_credentials app_credentials;
257 application_abi abi;
258 buffer_allocation_policy allocation_policy;
259 };
260
261 identifier get_identifier() const noexcept
262 {
263 /*
264 * To work around synchro design issues, this method allows the sampling
265 * of a ust_app_session's identifying properties without taking its lock.
266 *
267 * Since those properties are immutable, it is safe to sample them without
268 * holding the lock (as long as the existence of the instance is somehow
269 * guaranteed).
270 *
271 * The locking issue that motivates this method is that the application
272 * notitication handling thread needs to access the registry_session in response to
273 * a message from the application. The ust_app_session's ID is needed to look-up the
274 * registry session.
275 *
276 * The application's message can be emited in response to a command from the
277 * session daemon that is emited by the client thread.
278 *
279 * During that command, the client thread holds the ust_app_session lock until
280 * the application replies to the command. This causes the notification thread
281 * to block when it attempts to sample the ust_app_session's ID properties.
282 */
283 LTTNG_ASSERT(bits_per_long == 32 || bits_per_long == 64);
284 LTTNG_ASSERT(buffer_type == LTTNG_BUFFER_PER_PID ||
285 buffer_type == LTTNG_BUFFER_PER_UID);
286
287 return { .id = id,
288 .session_id = tracing_id,
289 .app_credentials = real_credentials,
290 .abi = bits_per_long == 32 ? identifier::application_abi::ABI_32 :
291 identifier::application_abi::ABI_64,
292 .allocation_policy = buffer_type == LTTNG_BUFFER_PER_PID ?
293 identifier::buffer_allocation_policy::PER_PID :
294 identifier::buffer_allocation_policy::PER_UID };
295 }
296
297 bool enabled = false;
298 /* started: has the session been in started state at any time ? */
299 bool started = false; /* allows detection of start vs restart. */
300 int handle = 0; /* used has unique identifier for app session */
301
302 bool deleted = false; /* Session deleted flag. Check with lock held. */
303
304 /*
305 * Tracing session ID. Multiple ust app session can have the same tracing
306 * session id making this value NOT unique to the object.
307 */
308 uint64_t tracing_id = 0;
309 uint64_t id = 0; /* Unique session identifier */
310 struct lttng_ht *channels = nullptr; /* Registered channels */
311 struct lttng_ht_node_u64 node = {};
312 /*
313 * Node indexed by UST session object descriptor (handle). Stored in the
314 * ust_sessions_objd hash table in the ust_app object.
315 */
316 struct lttng_ht_node_ulong ust_objd_node = {};
317 /* Starts with 'ust'; no leading slash. */
318 char path[PATH_MAX] = {};
319 /* UID/GID of the application owning the session */
320 struct lttng_credentials real_credentials = {};
321 /* Effective UID and GID. Same as the tracing session. */
322 struct lttng_credentials effective_credentials = {};
323 struct cds_list_head teardown_node = {};
324 /*
325 * Once at least *one* session is created onto the application, the
326 * corresponding consumer is set so we can use it on unregistration.
327 */
328 struct consumer_output *consumer = nullptr;
329 enum lttng_buffer_type buffer_type = LTTNG_BUFFER_PER_PID;
330 /* ABI of the session. Same value as the application. */
331 uint32_t bits_per_long = 0;
332 /* For delayed reclaim */
333 struct rcu_head rcu_head = {};
334 /* If the channel's streams have to be outputed or not. */
335 unsigned int output_traces = 0;
336 unsigned int live_timer_interval = 0; /* usec */
337
338 /* Metadata channel attributes. */
339 struct lttng_ust_ctl_consumer_channel_attr metadata_attr = {};
340
341 char root_shm_path[PATH_MAX] = {};
342 char shm_path[PATH_MAX] = {};
343
344 private:
345 /*
346 * Lock protecting this session's ust app interaction. Held
347 * across command send/recv to/from app. Never nests within the
348 * session registry lock.
349 */
350 mutable pthread_mutex_t _lock = PTHREAD_MUTEX_INITIALIZER;
351 };
352
353 /*
354 * Registered traceable applications. Libust registers to the session daemon
355 * and a linked list is kept of all running traceable app.
356 */
357 struct ust_app {
358 /*
359 * The lifetime of 'sock' holds a reference to the application; the
360 * application management thread will release a reference to the
361 * application if the application dies.
362 */
363 urcu_ref ref;
364
365 /* Traffic initiated from the session daemon to the application. */
366 int sock;
367 pthread_mutex_t sock_lock; /* Protects sock protocol. */
368
369 /* Traffic initiated from the application to the session daemon. */
370 int notify_sock;
371 pid_t pid;
372 pid_t ppid;
373 uid_t uid; /* User ID that owns the apps */
374 gid_t gid; /* Group ID that owns the apps */
375
376 /* App ABI. */
377 lttng::sessiond::trace::abi abi;
378
379 int compatible; /* If the lttng-ust tracer version does not match the
380 supported version of the session daemon, this flag is
381 set to 0 (NOT compatible) else 1. */
382 struct lttng_ust_abi_tracer_version version;
383 uint32_t v_major; /* Version major number */
384 uint32_t v_minor; /* Version minor number */
385 /* Extra for the NULL byte. */
386 char name[UST_APP_PROCNAME_LEN + 1];
387
388 struct lttng_ht *sessions;
389 struct lttng_ht_node_ulong pid_n;
390 struct lttng_ht_node_ulong sock_n;
391 struct lttng_ht_node_ulong notify_sock_n;
392 /*
393 * This is a list of ust app session that, once the app is going into
394 * teardown mode, in the RCU call, each node in this list is removed and
395 * deleted.
396 *
397 * Element of the list are added when an application unregisters after each
398 * ht_del of ust_app_session associated to this app. This list is NOT used
399 * when a session is destroyed.
400 */
401 struct cds_list_head teardown_head;
402 /*
403 * Hash table containing ust_app_channel indexed by channel objd.
404 */
405 struct lttng_ht *ust_objd;
406 /*
407 * Hash table containing ust_app_session indexed by objd.
408 */
409 struct lttng_ht *ust_sessions_objd;
410
411 /*
412 * If this application is of the agent domain and this is non negative then
413 * a lookup MUST be done to acquire a read side reference to the
414 * corresponding agent app object. If the lookup fails, this should be set
415 * to a negative value indicating that the agent application is gone.
416 */
417 int agent_app_sock;
418 /*
419 * Time at which the app is registred.
420 * Used for path creation
421 */
422 time_t registration_time;
423 /*
424 * Event notifier
425 */
426 struct {
427 /*
428 * Handle to the lttng_ust object representing the event
429 * notifier group.
430 */
431 struct lttng_ust_abi_object_data *object;
432 struct lttng_pipe *event_pipe;
433 struct lttng_ust_abi_object_data *counter;
434 struct lttng_ust_abi_object_data **counter_cpu;
435 int nr_counter_cpu;
436 } event_notifier_group;
437 /*
438 * Hashtable indexing the application's event notifier rule's
439 * (ust_app_event_notifier_rule) by their token's value.
440 */
441 struct lttng_ht *token_to_event_notifier_rule_ht;
442
443 lttng::sessiond::ust::ctl_field_quirks ctl_field_quirks() const;
444 };
445
446 /*
447 * Due to a bug in g++ < 7.1, this specialization must be enclosed in the fmt namespace,
448 * see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480.
449 */
450 namespace fmt {
451 template <>
452 struct formatter<ust_app> : formatter<std::string> {
453 template <typename FormatContextType>
454 typename FormatContextType::iterator format(const ust_app& app, FormatContextType& ctx)
455 {
456 return format_to(
457 ctx.out(),
458 "{{ procname = `{}`, ppid = {}, pid = {}, uid = {}, gid = {}, version = {}.{}, registration time = {} }}",
459 app.name,
460 app.ppid,
461 app.pid,
462 app.uid,
463 app.gid,
464 app.v_major,
465 app.v_minor,
466 lttng::utils::time_to_iso8601_str(app.registration_time));
467 }
468 };
469 } /* namespace fmt */
470
471 #ifdef HAVE_LIBLTTNG_UST_CTL
472
473 int ust_app_register(struct ust_register_msg *msg, int sock);
474 int ust_app_register_done(struct ust_app *app);
475 int ust_app_version(struct ust_app *app);
476 void ust_app_unregister_by_socket(int sock);
477 int ust_app_start_trace_all(struct ltt_ust_session *usess);
478 int ust_app_stop_trace_all(struct ltt_ust_session *usess);
479 int ust_app_destroy_trace_all(struct ltt_ust_session *usess);
480 int ust_app_list_events(struct lttng_event **events);
481 int ust_app_list_event_fields(struct lttng_event_field **fields);
482 int ust_app_create_event_glb(struct ltt_ust_session *usess,
483 struct ltt_ust_channel *uchan,
484 struct ltt_ust_event *uevent);
485 int ust_app_disable_channel_glb(struct ltt_ust_session *usess, struct ltt_ust_channel *uchan);
486 int ust_app_enable_channel_glb(struct ltt_ust_session *usess, struct ltt_ust_channel *uchan);
487 int ust_app_enable_event_glb(struct ltt_ust_session *usess,
488 struct ltt_ust_channel *uchan,
489 struct ltt_ust_event *uevent);
490 int ust_app_disable_event_glb(struct ltt_ust_session *usess,
491 struct ltt_ust_channel *uchan,
492 struct ltt_ust_event *uevent);
493 int ust_app_add_ctx_channel_glb(struct ltt_ust_session *usess,
494 struct ltt_ust_channel *uchan,
495 struct ltt_ust_context *uctx);
496 void ust_app_global_update(struct ltt_ust_session *usess, struct ust_app *app);
497 void ust_app_global_update_all(struct ltt_ust_session *usess);
498 void ust_app_global_update_event_notifier_rules(struct ust_app *app);
499 void ust_app_global_update_all_event_notifier_rules();
500
501 void ust_app_clean_list();
502 int ust_app_ht_alloc();
503 struct ust_app *ust_app_find_by_pid(pid_t pid);
504 struct ust_app_stream *ust_app_alloc_stream();
505 int ust_app_recv_registration(int sock, struct ust_register_msg *msg);
506 int ust_app_recv_notify(int sock);
507 void ust_app_add(struct ust_app *app);
508 struct ust_app *ust_app_create(struct ust_register_msg *msg, int sock);
509 void ust_app_notify_sock_unregister(int sock);
510
511 enum lttng_error_code ust_app_snapshot_record(const struct ltt_ust_session *usess,
512 const struct consumer_output *output,
513 uint64_t nb_packets_per_stream);
514 uint64_t ust_app_get_size_one_more_packet_per_stream(const struct ltt_ust_session *usess,
515 uint64_t cur_nr_packets);
516 struct ust_app *ust_app_find_by_sock(int sock);
517 int ust_app_uid_get_channel_runtime_stats(uint64_t ust_session_id,
518 struct cds_list_head *buffer_reg_uid_list,
519 struct consumer_output *consumer,
520 uint64_t uchan_id,
521 int overwrite,
522 uint64_t *discarded,
523 uint64_t *lost);
524 int ust_app_pid_get_channel_runtime_stats(struct ltt_ust_session *usess,
525 struct ltt_ust_channel *uchan,
526 struct consumer_output *consumer,
527 int overwrite,
528 uint64_t *discarded,
529 uint64_t *lost);
530 int ust_app_regenerate_statedump_all(struct ltt_ust_session *usess);
531 enum lttng_error_code ust_app_create_channel_subdirectories(const struct ltt_ust_session *session);
532 int ust_app_release_object(struct ust_app *app, struct lttng_ust_abi_object_data *data);
533
534 int ust_app_setup_event_notifier_group(struct ust_app *app);
535
536 static inline int ust_app_supported()
537 {
538 return 1;
539 }
540
541 ust_app_session *ust_app_lookup_app_session(const struct ltt_ust_session *usess,
542 const struct ust_app *app);
543 lttng::sessiond::ust::registry_session *
544 ust_app_get_session_registry(const ust_app_session::identifier& identifier);
545
546 lttng_ht *ust_app_get_all();
547
548 bool ust_app_supports_notifiers(const struct ust_app *app);
549 bool ust_app_supports_counters(const struct ust_app *app);
550
551 bool ust_app_get(ust_app& app);
552 void ust_app_put(ust_app *app);
553
554 using ust_app_reference =
555 std::unique_ptr<ust_app, lttng::memory::create_deleter_class<ust_app, ust_app_put>::deleter>;
556
557 #else /* HAVE_LIBLTTNG_UST_CTL */
558
559 static inline int ust_app_destroy_trace_all(struct ltt_ust_session *usess __attribute__((unused)))
560 {
561 return 0;
562 }
563
564 static inline int ust_app_start_trace(struct ltt_ust_session *usess __attribute__((unused)),
565 struct ust_app *app __attribute__((unused)))
566 {
567 return 0;
568 }
569
570 static inline int ust_app_start_trace_all(struct ltt_ust_session *usess __attribute__((unused)))
571 {
572 return 0;
573 }
574
575 static inline int ust_app_stop_trace_all(struct ltt_ust_session *usess __attribute__((unused)))
576 {
577 return 0;
578 }
579
580 static inline int ust_app_list_events(struct lttng_event **events __attribute__((unused)))
581 {
582 return -ENOSYS;
583 }
584
585 static inline int ust_app_list_event_fields(struct lttng_event_field **fields
586 __attribute__((unused)))
587 {
588 return -ENOSYS;
589 }
590
591 static inline int ust_app_register(struct ust_register_msg *msg __attribute__((unused)),
592 int sock __attribute__((unused)))
593 {
594 return -ENOSYS;
595 }
596
597 static inline int ust_app_register_done(struct ust_app *app __attribute__((unused)))
598 {
599 return -ENOSYS;
600 }
601
602 static inline int ust_app_version(struct ust_app *app __attribute__((unused)))
603 {
604 return -ENOSYS;
605 }
606
607 static inline void ust_app_unregister_by_socket(int sock __attribute__((unused)))
608 {
609 }
610
611 static inline void ust_app_clean_list(void)
612 {
613 }
614
615 static inline struct ust_app_list *ust_app_get_list(void)
616 {
617 return NULL;
618 }
619
620 static inline struct ust_app *ust_app_get_by_pid(pid_t pid __attribute__((unused)))
621 {
622 return NULL;
623 }
624
625 static inline int ust_app_ht_alloc(void)
626 {
627 return 0;
628 }
629
630 static inline void ust_app_global_update(struct ltt_ust_session *usess __attribute__((unused)),
631 struct ust_app *app __attribute__((unused)))
632 {
633 }
634
635 static inline void ust_app_global_update_event_notifier_rules(struct ust_app *app
636 __attribute__((unused)))
637 {
638 }
639
640 static inline void ust_app_global_update_all_event_notifier_rules(void)
641 {
642 }
643
644 static inline int ust_app_setup_event_notifier_group(struct ust_app *app __attribute__((unused)))
645 {
646 return 0;
647 }
648
649 static inline int ust_app_disable_channel_glb(struct ltt_ust_session *usess __attribute__((unused)),
650 struct ltt_ust_channel *uchan __attribute__((unused)))
651 {
652 return 0;
653 }
654
655 static inline int ust_app_enable_channel_glb(struct ltt_ust_session *usess __attribute__((unused)),
656 struct ltt_ust_channel *uchan __attribute__((unused)))
657 {
658 return 0;
659 }
660
661 static inline int ust_app_create_event_glb(struct ltt_ust_session *usess __attribute__((unused)),
662 struct ltt_ust_channel *uchan __attribute__((unused)),
663 struct ltt_ust_event *uevent __attribute__((unused)))
664 {
665 return 0;
666 }
667
668 static inline int ust_app_disable_event_glb(struct ltt_ust_session *usess __attribute__((unused)),
669 struct ltt_ust_channel *uchan __attribute__((unused)),
670 struct ltt_ust_event *uevent __attribute__((unused)))
671 {
672 return 0;
673 }
674
675 static inline int ust_app_enable_event_glb(struct ltt_ust_session *usess __attribute__((unused)),
676 struct ltt_ust_channel *uchan __attribute__((unused)),
677 struct ltt_ust_event *uevent __attribute__((unused)))
678 {
679 return 0;
680 }
681
682 static inline int ust_app_add_ctx_channel_glb(struct ltt_ust_session *usess __attribute__((unused)),
683 struct ltt_ust_channel *uchan __attribute__((unused)),
684 struct ltt_ust_context *uctx __attribute__((unused)))
685 {
686 return 0;
687 }
688
689 static inline int ust_app_enable_event_pid(struct ltt_ust_session *usess __attribute__((unused)),
690 struct ltt_ust_channel *uchan __attribute__((unused)),
691 struct ltt_ust_event *uevent __attribute__((unused)),
692 pid_t pid __attribute__((unused)))
693 {
694 return 0;
695 }
696
697 static inline int ust_app_recv_registration(int sock __attribute__((unused)),
698 struct ust_register_msg *msg __attribute__((unused)))
699 {
700 return 0;
701 }
702
703 static inline int ust_app_recv_notify(int sock __attribute__((unused)))
704 {
705 return 0;
706 }
707
708 static inline struct ust_app *ust_app_create(struct ust_register_msg *msg __attribute__((unused)),
709 int sock __attribute__((unused)))
710 {
711 return NULL;
712 }
713
714 static inline void ust_app_add(struct ust_app *app __attribute__((unused)))
715 {
716 }
717
718 static inline void ust_app_notify_sock_unregister(int sock __attribute__((unused)))
719 {
720 }
721
722 static inline enum lttng_error_code
723 ust_app_snapshot_record(struct ltt_ust_session *usess __attribute__((unused)),
724 const struct consumer_output *output __attribute__((unused)),
725 uint64_t max_stream_size __attribute__((unused)))
726 {
727 return LTTNG_ERR_UNK;
728 }
729
730 static inline unsigned int ust_app_get_nb_stream(struct ltt_ust_session *usess
731 __attribute__((unused)))
732 {
733 return 0;
734 }
735
736 static inline void ust_app_update_event_notifier_error_count(struct lttng_trigger *lttng_trigger
737 __attribute__((unused)))
738 {
739 return;
740 }
741
742 static inline int ust_app_supported(void)
743 {
744 return 0;
745 }
746
747 static inline bool ust_app_supports_notifiers(const struct ust_app *app __attribute__((unused)))
748 {
749 return false;
750 }
751
752 static inline bool ust_app_supports_counters(const struct ust_app *app __attribute__((unused)))
753 {
754 return false;
755 }
756
757 static inline struct ust_app *ust_app_find_by_sock(int sock __attribute__((unused)))
758 {
759 return NULL;
760 }
761
762 static inline struct ust_app *ust_app_find_by_pid(pid_t pid __attribute__((unused)))
763 {
764 return NULL;
765 }
766
767 static inline uint64_t
768 ust_app_get_size_one_more_packet_per_stream(const struct ltt_ust_session *usess
769 __attribute__((unused)),
770 uint64_t cur_nr_packets __attribute__((unused)))
771 {
772 return 0;
773 }
774
775 static inline int ust_app_uid_get_channel_runtime_stats(uint64_t ust_session_id
776 __attribute__((unused)),
777 struct cds_list_head *buffer_reg_uid_list
778 __attribute__((unused)),
779 struct consumer_output *consumer
780 __attribute__((unused)),
781 int overwrite __attribute__((unused)),
782 uint64_t uchan_id __attribute__((unused)),
783 uint64_t *discarded __attribute__((unused)),
784 uint64_t *lost __attribute__((unused)))
785 {
786 return 0;
787 }
788
789 static inline int
790 ust_app_pid_get_channel_runtime_stats(struct ltt_ust_session *usess __attribute__((unused)),
791 struct ltt_ust_channel *uchan __attribute__((unused)),
792 struct consumer_output *consumer __attribute__((unused)),
793 int overwrite __attribute__((unused)),
794 uint64_t *discarded __attribute__((unused)),
795 uint64_t *lost __attribute__((unused)))
796 {
797 return 0;
798 }
799
800 static inline int ust_app_regenerate_statedump_all(struct ltt_ust_session *usess
801 __attribute__((unused)))
802 {
803 return 0;
804 }
805
806 static inline enum lttng_error_code
807 ust_app_create_channel_subdirectories(const struct ltt_ust_session *session __attribute__((unused)))
808 {
809 return LTTNG_ERR_UNK;
810 }
811
812 static inline ust_app_session *ust_app_lookup_app_session(const ltt_ust_session *, const ust_app *)
813 {
814 return nullptr;
815 }
816
817 static inline lttng::sessiond::ust::registry_session *
818 ust_app_get_session_registry(const ust_app_session::identifier&)
819 {
820 return nullptr;
821 }
822
823 static inline lttng_ht *ust_app_get_all()
824 {
825 return nullptr;
826 }
827
828 static inline int ust_app_release_object(struct ust_app *app __attribute__((unused)),
829 struct lttng_ust_abi_object_data *data
830 __attribute__((unused)))
831 {
832 return 0;
833 }
834
835 static inline void ust_app_get(ust_app& app __attribute__((unused)))
836 {
837 }
838
839 static inline void ust_app_put(ust_app *app __attribute__((unused)))
840 {
841 }
842
843 #endif /* HAVE_LIBLTTNG_UST_CTL */
844
845 #endif /* _LTT_UST_APP_H */
This page took 0.045749 seconds and 4 git commands to generate.