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