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