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