fix: Revert "Makefile: Enable -Wimplicit-fallthrough for Clang" (v5.15)
[lttng-modules.git] / include / lttng / events-internal.h
1 /* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
2 *
3 * lttng/events-internal.h
4 *
5 * Copyright (C) 2010-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 */
7
8 #ifndef _LTTNG_EVENTS_INTERNAL_H
9 #define _LTTNG_EVENTS_INTERNAL_H
10
11 #include <wrapper/compiler_attributes.h>
12
13 #include <lttng/events.h>
14
15 struct lttng_syscall_filter;
16 struct lttng_metadata_cache;
17 struct perf_event;
18 struct perf_event_attr;
19 struct lttng_kernel_ring_buffer_config;
20
21 enum lttng_enabler_format_type {
22 LTTNG_ENABLER_FORMAT_STAR_GLOB,
23 LTTNG_ENABLER_FORMAT_NAME,
24 };
25
26 enum channel_type {
27 PER_CPU_CHANNEL,
28 METADATA_CHANNEL,
29 };
30
31 /*
32 * Objects in a linked-list of enablers, owned by an event.
33 */
34 struct lttng_enabler_ref {
35 struct list_head node; /* enabler ref list */
36 struct lttng_enabler *ref; /* backward ref */
37 };
38
39 struct lttng_krp; /* Kretprobe handling */
40
41 struct lttng_uprobe_handler {
42 struct lttng_kernel_event_common *event;
43 loff_t offset;
44 struct uprobe_consumer up_consumer;
45 struct list_head node;
46 };
47
48 struct lttng_kprobe {
49 struct kprobe kp;
50 char *symbol_name;
51 };
52
53 struct lttng_uprobe {
54 struct inode *inode;
55 struct list_head head;
56 };
57
58 enum lttng_syscall_entryexit {
59 LTTNG_SYSCALL_ENTRY,
60 LTTNG_SYSCALL_EXIT,
61 };
62
63 enum lttng_syscall_abi {
64 LTTNG_SYSCALL_ABI_NATIVE,
65 LTTNG_SYSCALL_ABI_COMPAT,
66 };
67
68 struct lttng_kernel_event_common_private {
69 struct lttng_kernel_event_common *pub; /* Public event interface */
70
71 const struct lttng_kernel_event_desc *desc;
72 /* Backward references: list of lttng_enabler_ref (ref to enablers) */
73 struct list_head enablers_ref_head;
74 int registered; /* has reg'd tracepoint probe */
75 uint64_t user_token;
76
77 int has_enablers_without_filter_bytecode;
78 /* list of struct lttng_kernel_bytecode_runtime, sorted by seqnum */
79 struct list_head filter_bytecode_runtime_head;
80 enum lttng_kernel_abi_instrumentation instrumentation;
81 /* Selected by instrumentation */
82 union {
83 struct lttng_kprobe kprobe;
84 struct lttng_uprobe uprobe;
85 struct {
86 struct lttng_krp *lttng_krp;
87 char *symbol_name;
88 } kretprobe;
89 struct {
90 enum lttng_syscall_entryexit entryexit;
91 enum lttng_syscall_abi abi;
92 struct hlist_node node; /* chain registered syscall event_notifier */
93 unsigned int syscall_id;
94 } syscall;
95 } u;
96 };
97
98 struct lttng_kernel_event_recorder_private {
99 struct lttng_kernel_event_common_private parent;
100
101 struct lttng_kernel_event_recorder *pub; /* Public event interface */
102 struct list_head node; /* Event recorder list */
103 struct hlist_node hlist; /* Hash table of event recorders */
104 struct lttng_kernel_ctx *ctx;
105 unsigned int id;
106 unsigned int metadata_dumped:1;
107 };
108
109 struct lttng_kernel_event_notifier_private {
110 struct lttng_kernel_event_common_private parent;
111
112 struct lttng_kernel_event_notifier *pub; /* Public event notifier interface */
113 struct lttng_event_notifier_group *group; /* weak ref */
114 size_t num_captures; /* Needed to allocate the msgpack array. */
115 uint64_t error_counter_index;
116 struct list_head node; /* Event notifier list */
117 struct hlist_node hlist; /* Hash table of event notifiers */
118 struct list_head capture_bytecode_runtime_head;
119
120 };
121
122 struct lttng_kernel_channel_common_private {
123 struct lttng_kernel_channel_common *pub;
124
125 struct file *file; /* File associated to channel */
126 unsigned int sys_enter_registered:1,
127 sys_exit_registered:1,
128 tstate:1; /* Transient enable state */
129
130 struct hlist_head *sc_table; /* for syscall tracing */
131 struct hlist_head *compat_sc_table;
132 struct hlist_head *sc_exit_table; /* for syscall exit tracing */
133 struct hlist_head *compat_sc_exit_table;
134 struct hlist_head sc_unknown; /* for unknown syscalls */
135 struct hlist_head sc_compat_unknown;
136 struct hlist_head sc_exit_unknown;
137 struct hlist_head compat_sc_exit_unknown;
138 struct lttng_syscall_filter *sc_filter;
139 int syscall_all_entry;
140 int syscall_all_exit;
141 };
142
143 struct lttng_kernel_channel_buffer_private {
144 struct lttng_kernel_channel_common_private parent;
145
146 struct lttng_kernel_channel_buffer *pub;
147
148 unsigned int id; /* Channel ID */
149 unsigned int free_event_id; /* Next event ID to allocate */
150 int header_type; /* 0: unset, 1: compact, 2: large */
151
152 enum channel_type channel_type;
153 struct lttng_kernel_ctx *ctx;
154 struct lttng_kernel_ring_buffer_channel *rb_chan; /* Ring buffer channel */
155 unsigned int metadata_dumped:1;
156 struct list_head node; /* Channel list in session */
157 struct lttng_transport *transport;
158 };
159
160 enum lttng_kernel_bytecode_interpreter_ret {
161 LTTNG_KERNEL_BYTECODE_INTERPRETER_ERROR = -1,
162 LTTNG_KERNEL_BYTECODE_INTERPRETER_OK = 0,
163 };
164
165 enum lttng_kernel_bytecode_filter_result {
166 LTTNG_KERNEL_BYTECODE_FILTER_ACCEPT = 0,
167 LTTNG_KERNEL_BYTECODE_FILTER_REJECT = 1,
168 };
169
170 struct lttng_kernel_bytecode_filter_ctx {
171 enum lttng_kernel_bytecode_filter_result result;
172 };
173
174 struct lttng_interpreter_output;
175
176 enum lttng_kernel_bytecode_type {
177 LTTNG_KERNEL_BYTECODE_TYPE_FILTER,
178 LTTNG_KERNEL_BYTECODE_TYPE_CAPTURE,
179 };
180
181 struct lttng_kernel_bytecode_node {
182 enum lttng_kernel_bytecode_type type;
183 struct list_head node;
184 struct lttng_enabler *enabler;
185 struct {
186 uint32_t len;
187 uint32_t reloc_offset;
188 uint64_t seqnum;
189 char data[];
190 } bc;
191 };
192
193 struct lttng_kernel_bytecode_runtime {
194 /* Associated bytecode */
195 enum lttng_kernel_bytecode_type type;
196 struct lttng_kernel_bytecode_node *bc;
197 int (*interpreter_func)(struct lttng_kernel_bytecode_runtime *kernel_bytecode,
198 const char *interpreter_stack_data,
199 struct lttng_kernel_probe_ctx *lttng_probe_ctx,
200 void *caller_ctx);
201 int link_failed;
202 struct list_head node; /* list of bytecode runtime in event */
203 struct lttng_kernel_ctx *ctx;
204 };
205
206 /*
207 * Enabler field, within whatever object is enabling an event. Target of
208 * backward reference.
209 */
210 struct lttng_enabler {
211 enum lttng_enabler_format_type format_type;
212
213 /* head list of struct lttng_kernel_bytecode_node */
214 struct list_head filter_bytecode_head;
215
216 struct lttng_kernel_abi_event event_param;
217 unsigned int enabled:1;
218
219 uint64_t user_token; /* User-provided token. */
220 };
221
222 struct lttng_event_enabler {
223 struct lttng_enabler base;
224 struct list_head node; /* per-session list of enablers */
225 struct lttng_kernel_channel_buffer *chan;
226 };
227
228 struct lttng_event_notifier_enabler {
229 struct lttng_enabler base;
230 uint64_t error_counter_index;
231 struct list_head node; /* List of event_notifier enablers */
232 struct lttng_event_notifier_group *group;
233
234 /* head list of struct lttng_kernel_bytecode_node */
235 struct list_head capture_bytecode_head;
236 uint64_t num_captures;
237 };
238
239 struct lttng_ctx_value {
240 union {
241 int64_t s64;
242 const char *str;
243 double d;
244 } u;
245 };
246
247 /*
248 * We need to keep this perf counter field separately from struct
249 * lttng_kernel_ctx_field because cpu hotplug needs fixed-location addresses.
250 */
251 struct lttng_perf_counter_field {
252 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0))
253 struct lttng_cpuhp_node cpuhp_prepare;
254 struct lttng_cpuhp_node cpuhp_online;
255 #else
256 struct notifier_block nb;
257 int hp_enable;
258 #endif
259 struct perf_event_attr *attr;
260 struct perf_event **e; /* per-cpu array */
261 char *name;
262 struct lttng_kernel_event_field *event_field;
263 };
264
265 struct lttng_kernel_ctx_field {
266 const struct lttng_kernel_event_field *event_field;
267 size_t (*get_size)(void *priv, struct lttng_kernel_probe_ctx *probe_ctx,
268 size_t offset);
269 void (*record)(void *priv, struct lttng_kernel_probe_ctx *probe_ctx,
270 struct lttng_kernel_ring_buffer_ctx *ctx,
271 struct lttng_kernel_channel_buffer *chan);
272 void (*get_value)(void *priv, struct lttng_kernel_probe_ctx *probe_ctx,
273 struct lttng_ctx_value *value);
274 void (*destroy)(void *priv);
275 void *priv;
276 };
277
278 struct lttng_kernel_ctx {
279 struct lttng_kernel_ctx_field *fields;
280 unsigned int nr_fields;
281 unsigned int allocated_fields;
282 size_t largest_align; /* in bytes */
283 };
284
285 struct lttng_metadata_cache {
286 char *data; /* Metadata cache */
287 unsigned int cache_alloc; /* Metadata allocated size (bytes) */
288 unsigned int metadata_written; /* Number of bytes written in metadata cache */
289 atomic_t producing; /* Metadata being produced (incomplete) */
290 struct kref refcount; /* Metadata cache usage */
291 struct list_head metadata_stream; /* Metadata stream list */
292 uuid_le uuid; /* Trace session unique ID (copy) */
293 struct mutex lock; /* Produce/consume lock */
294 uint64_t version; /* Current version of the metadata */
295 };
296
297 struct lttng_metadata_stream {
298 void *priv; /* Ring buffer private data */
299 struct lttng_metadata_cache *metadata_cache;
300 unsigned int metadata_in; /* Bytes read from the cache */
301 unsigned int metadata_out; /* Bytes consumed from stream */
302 int finalized; /* Has channel been finalized */
303 wait_queue_head_t read_wait; /* Reader buffer-level wait queue */
304 struct list_head list; /* Stream list */
305 struct lttng_transport *transport;
306 uint64_t version; /* Current version of the metadata cache */
307 bool coherent; /* Stream in a coherent state */
308 };
309
310 struct lttng_kernel_channel_buffer_ops_private {
311 struct lttng_kernel_channel_buffer_ops *pub; /* Public channel buffer ops interface */
312
313 struct lttng_kernel_ring_buffer_channel *(*channel_create)(const char *name,
314 void *priv,
315 void *buf_addr,
316 size_t subbuf_size, size_t num_subbuf,
317 unsigned int switch_timer_interval,
318 unsigned int read_timer_interval);
319 void (*channel_destroy)(struct lttng_kernel_ring_buffer_channel *chan);
320 struct lttng_kernel_ring_buffer *(*buffer_read_open)(struct lttng_kernel_ring_buffer_channel *chan);
321 int (*buffer_has_read_closed_stream)(struct lttng_kernel_ring_buffer_channel *chan);
322 void (*buffer_read_close)(struct lttng_kernel_ring_buffer *buf);
323 /*
324 * packet_avail_size returns the available size in the current
325 * packet. Note that the size returned is only a hint, since it
326 * may change due to concurrent writes.
327 */
328 size_t (*packet_avail_size)(struct lttng_kernel_ring_buffer_channel *chan);
329 wait_queue_head_t *(*get_writer_buf_wait_queue)(struct lttng_kernel_ring_buffer_channel *chan, int cpu);
330 wait_queue_head_t *(*get_hp_wait_queue)(struct lttng_kernel_ring_buffer_channel *chan);
331 int (*is_finalized)(struct lttng_kernel_ring_buffer_channel *chan);
332 int (*is_disabled)(struct lttng_kernel_ring_buffer_channel *chan);
333 int (*timestamp_begin) (const struct lttng_kernel_ring_buffer_config *config,
334 struct lttng_kernel_ring_buffer *bufb,
335 uint64_t *timestamp_begin);
336 int (*timestamp_end) (const struct lttng_kernel_ring_buffer_config *config,
337 struct lttng_kernel_ring_buffer *bufb,
338 uint64_t *timestamp_end);
339 int (*events_discarded) (const struct lttng_kernel_ring_buffer_config *config,
340 struct lttng_kernel_ring_buffer *bufb,
341 uint64_t *events_discarded);
342 int (*content_size) (const struct lttng_kernel_ring_buffer_config *config,
343 struct lttng_kernel_ring_buffer *bufb,
344 uint64_t *content_size);
345 int (*packet_size) (const struct lttng_kernel_ring_buffer_config *config,
346 struct lttng_kernel_ring_buffer *bufb,
347 uint64_t *packet_size);
348 int (*stream_id) (const struct lttng_kernel_ring_buffer_config *config,
349 struct lttng_kernel_ring_buffer *bufb,
350 uint64_t *stream_id);
351 int (*current_timestamp) (const struct lttng_kernel_ring_buffer_config *config,
352 struct lttng_kernel_ring_buffer *bufb,
353 uint64_t *ts);
354 int (*sequence_number) (const struct lttng_kernel_ring_buffer_config *config,
355 struct lttng_kernel_ring_buffer *bufb,
356 uint64_t *seq);
357 int (*instance_id) (const struct lttng_kernel_ring_buffer_config *config,
358 struct lttng_kernel_ring_buffer *bufb,
359 uint64_t *id);
360 };
361
362 struct lttng_counter_ops {
363 struct lib_counter *(*counter_create)(size_t nr_dimensions,
364 const size_t *max_nr_elem, /* for each dimension */
365 int64_t global_sum_step);
366 void (*counter_destroy)(struct lib_counter *counter);
367 int (*counter_add)(struct lib_counter *counter, const size_t *dimension_indexes,
368 int64_t v);
369 /*
370 * counter_read reads a specific cpu's counter if @cpu >= 0, or
371 * the global aggregation counter if @cpu == -1.
372 */
373 int (*counter_read)(struct lib_counter *counter, const size_t *dimension_indexes, int cpu,
374 int64_t *value, bool *overflow, bool *underflow);
375 /*
376 * counter_aggregate returns the total sum of all per-cpu counters and
377 * the global aggregation counter.
378 */
379 int (*counter_aggregate)(struct lib_counter *counter, const size_t *dimension_indexes,
380 int64_t *value, bool *overflow, bool *underflow);
381 int (*counter_clear)(struct lib_counter *counter, const size_t *dimension_indexes);
382 };
383
384 struct lttng_counter {
385 struct file *file; /* File associated to counter. */
386 struct file *owner;
387 struct lttng_counter_transport *transport;
388 struct lib_counter *counter;
389 struct lttng_counter_ops *ops;
390 };
391
392 #define LTTNG_EVENT_NOTIFIER_HT_BITS 12
393 #define LTTNG_EVENT_NOTIFIER_HT_SIZE (1U << LTTNG_EVENT_NOTIFIER_HT_BITS)
394
395 struct lttng_event_notifier_ht {
396 struct hlist_head table[LTTNG_EVENT_NOTIFIER_HT_SIZE];
397 };
398
399 struct lttng_event_notifier_group {
400 struct file *file; /* File associated to event notifier group */
401 struct file *notif_file; /* File used to expose notifications to userspace. */
402 struct list_head node; /* event notifier group list */
403 struct list_head enablers_head; /* List of enablers */
404 struct list_head event_notifiers_head; /* List of event notifier */
405 struct lttng_event_notifier_ht event_notifiers_ht; /* Hash table of event notifiers */
406 struct lttng_kernel_channel_buffer_ops *ops;
407 struct lttng_transport *transport;
408 struct lttng_kernel_ring_buffer_channel *chan; /* Ring buffer channel for event notifier group. */
409 struct lttng_kernel_ring_buffer *buf; /* Ring buffer for event notifier group. */
410 wait_queue_head_t read_wait;
411 struct irq_work wakeup_pending; /* Pending wakeup irq work. */
412 struct lttng_kernel_event_notifier *sc_unknown; /* for unknown syscalls */
413 struct lttng_kernel_event_notifier *sc_compat_unknown;
414
415 struct lttng_syscall_filter *sc_filter;
416
417 struct hlist_head *event_notifier_syscall_dispatch;
418 struct hlist_head *event_notifier_compat_syscall_dispatch;
419 struct hlist_head *event_notifier_exit_syscall_dispatch;
420 struct hlist_head *event_notifier_exit_compat_syscall_dispatch;
421
422 struct hlist_head event_notifier_unknown_syscall_dispatch;
423 struct hlist_head event_notifier_compat_unknown_syscall_dispatch;
424 struct hlist_head event_notifier_exit_unknown_syscall_dispatch;
425 struct hlist_head event_notifier_exit_compat_unknown_syscall_dispatch;
426
427 int syscall_all_entry;
428 int syscall_all_exit;
429
430 unsigned int sys_enter_registered:1, sys_exit_registered:1;
431
432 struct lttng_counter *error_counter;
433 size_t error_counter_len;
434 };
435
436 struct lttng_transport {
437 char *name;
438 struct module *owner;
439 struct list_head node;
440 struct lttng_kernel_channel_buffer_ops ops;
441 };
442
443 struct lttng_counter_transport {
444 char *name;
445 struct module *owner;
446 struct list_head node;
447 struct lttng_counter_ops ops;
448 };
449
450 #define LTTNG_EVENT_HT_BITS 12
451 #define LTTNG_EVENT_HT_SIZE (1U << LTTNG_EVENT_HT_BITS)
452
453 struct lttng_event_ht {
454 struct hlist_head table[LTTNG_EVENT_HT_SIZE];
455 };
456
457 struct lttng_kernel_session_private {
458 struct lttng_kernel_session *pub; /* Public session interface */
459
460 int been_active; /* Has trace session been active ? */
461 struct file *file; /* File associated to session */
462 struct list_head chan; /* Channel list head */
463 struct list_head events; /* Event list head */
464 struct list_head list; /* Session list */
465 unsigned int free_chan_id; /* Next chan ID to allocate */
466 uuid_le uuid; /* Trace session unique ID */
467 struct lttng_metadata_cache *metadata_cache;
468 unsigned int metadata_dumped:1,
469 tstate:1; /* Transient enable state */
470 /* List of event enablers */
471 struct list_head enablers_head;
472 /* Hash table of events */
473 struct lttng_event_ht events_ht;
474 char name[LTTNG_KERNEL_ABI_SESSION_NAME_LEN];
475 char creation_time[LTTNG_KERNEL_ABI_SESSION_CREATION_TIME_ISO8601_LEN];
476 };
477
478 struct lttng_id_hash_node {
479 struct hlist_node hlist;
480 int id;
481 };
482
483 enum tracker_type {
484 TRACKER_PID,
485 TRACKER_VPID,
486 TRACKER_UID,
487 TRACKER_VUID,
488 TRACKER_GID,
489 TRACKER_VGID,
490
491 TRACKER_UNKNOWN,
492 };
493
494 struct lttng_kernel_id_tracker_private {
495 struct lttng_kernel_id_tracker *pub; /* Public interface */
496
497 struct lttng_kernel_session *session;
498 enum tracker_type tracker_type;
499 };
500
501 extern struct lttng_kernel_ctx *lttng_static_ctx;
502
503 static inline
504 const struct lttng_kernel_type_integer *lttng_kernel_get_type_integer(const struct lttng_kernel_type_common *type)
505 {
506 if (type->type != lttng_kernel_type_integer)
507 return NULL;
508 return container_of(type, const struct lttng_kernel_type_integer, parent);
509 }
510
511 static inline
512 const struct lttng_kernel_type_string *lttng_kernel_get_type_string(const struct lttng_kernel_type_common *type)
513 {
514 if (type->type != lttng_kernel_type_string)
515 return NULL;
516 return container_of(type, const struct lttng_kernel_type_string, parent);
517 }
518
519 static inline
520 const struct lttng_kernel_type_enum *lttng_kernel_get_type_enum(const struct lttng_kernel_type_common *type)
521 {
522 if (type->type != lttng_kernel_type_enum)
523 return NULL;
524 return container_of(type, const struct lttng_kernel_type_enum, parent);
525 }
526
527 static inline
528 const struct lttng_kernel_type_array *lttng_kernel_get_type_array(const struct lttng_kernel_type_common *type)
529 {
530 if (type->type != lttng_kernel_type_array)
531 return NULL;
532 return container_of(type, const struct lttng_kernel_type_array, parent);
533 }
534
535 static inline
536 const struct lttng_kernel_type_sequence *lttng_kernel_get_type_sequence(const struct lttng_kernel_type_common *type)
537 {
538 if (type->type != lttng_kernel_type_sequence)
539 return NULL;
540 return container_of(type, const struct lttng_kernel_type_sequence, parent);
541 }
542
543 static inline
544 const struct lttng_kernel_type_struct *lttng_kernel_get_type_struct(const struct lttng_kernel_type_common *type)
545 {
546 if (type->type != lttng_kernel_type_struct)
547 return NULL;
548 return container_of(type, const struct lttng_kernel_type_struct, parent);
549 }
550
551 static inline
552 const struct lttng_kernel_type_variant *lttng_kernel_get_type_variant(const struct lttng_kernel_type_common *type)
553 {
554 if (type->type != lttng_kernel_type_variant)
555 return NULL;
556 return container_of(type, const struct lttng_kernel_type_variant, parent);
557 }
558
559 static inline bool lttng_kernel_type_is_bytewise_integer(const struct lttng_kernel_type_common *type)
560 {
561 const struct lttng_kernel_type_integer *type_integer = lttng_kernel_get_type_integer(type);
562
563 if (!type_integer)
564 return false;
565 switch (type_integer->size) {
566 case 8:
567 lttng_fallthrough;
568 case 16:
569 lttng_fallthrough;
570 case 32:
571 lttng_fallthrough;
572 case 64:
573 break;
574 default:
575 return false;
576 }
577 return true;
578 }
579
580 int lttng_kernel_interpret_event_filter(const struct lttng_kernel_event_common *event,
581 const char *interpreter_stack_data,
582 struct lttng_kernel_probe_ctx *probe_ctx,
583 void *event_filter_ctx);
584
585 static inline
586 struct lttng_enabler *lttng_event_enabler_as_enabler(
587 struct lttng_event_enabler *event_enabler)
588 {
589 return &event_enabler->base;
590 }
591
592 static inline
593 struct lttng_enabler *lttng_event_notifier_enabler_as_enabler(
594 struct lttng_event_notifier_enabler *event_notifier_enabler)
595 {
596 return &event_notifier_enabler->base;
597 }
598
599 int lttng_context_init(void);
600 void lttng_context_exit(void);
601 int lttng_kernel_context_append(struct lttng_kernel_ctx **ctx_p,
602 const struct lttng_kernel_ctx_field *f);
603 void lttng_kernel_context_remove_last(struct lttng_kernel_ctx **ctx_p);
604 struct lttng_kernel_ctx_field *lttng_kernel_get_context_field_from_index(struct lttng_kernel_ctx *ctx,
605 size_t index);
606 int lttng_kernel_find_context(struct lttng_kernel_ctx *ctx, const char *name);
607 int lttng_kernel_get_context_index(struct lttng_kernel_ctx *ctx, const char *name);
608 void lttng_kernel_destroy_context(struct lttng_kernel_ctx *ctx);
609 int lttng_add_pid_to_ctx(struct lttng_kernel_ctx **ctx);
610 int lttng_add_cpu_id_to_ctx(struct lttng_kernel_ctx **ctx);
611 int lttng_add_procname_to_ctx(struct lttng_kernel_ctx **ctx);
612 int lttng_add_prio_to_ctx(struct lttng_kernel_ctx **ctx);
613 int lttng_add_nice_to_ctx(struct lttng_kernel_ctx **ctx);
614 int lttng_add_vpid_to_ctx(struct lttng_kernel_ctx **ctx);
615 int lttng_add_tid_to_ctx(struct lttng_kernel_ctx **ctx);
616 int lttng_add_vtid_to_ctx(struct lttng_kernel_ctx **ctx);
617 int lttng_add_ppid_to_ctx(struct lttng_kernel_ctx **ctx);
618 int lttng_add_vppid_to_ctx(struct lttng_kernel_ctx **ctx);
619 int lttng_add_hostname_to_ctx(struct lttng_kernel_ctx **ctx);
620 int lttng_add_interruptible_to_ctx(struct lttng_kernel_ctx **ctx);
621 int lttng_add_need_reschedule_to_ctx(struct lttng_kernel_ctx **ctx);
622 #if defined(CONFIG_PREEMPT_RT_FULL) || defined(CONFIG_PREEMPT)
623 int lttng_add_preemptible_to_ctx(struct lttng_kernel_ctx **ctx);
624 #else
625 static inline
626 int lttng_add_preemptible_to_ctx(struct lttng_kernel_ctx **ctx)
627 {
628 return -ENOSYS;
629 }
630 #endif
631 #ifdef CONFIG_PREEMPT_RT_FULL
632 int lttng_add_migratable_to_ctx(struct lttng_kernel_ctx **ctx);
633 #else
634 static inline
635 int lttng_add_migratable_to_ctx(struct lttng_kernel_ctx **ctx)
636 {
637 return -ENOSYS;
638 }
639 #endif
640
641 int lttng_add_callstack_to_ctx(struct lttng_kernel_ctx **ctx, int type);
642
643 #if defined(CONFIG_CGROUPS) && \
644 ((LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,6,0)) || \
645 LTTNG_UBUNTU_KERNEL_RANGE(4,4,0,0, 4,5,0,0))
646 int lttng_add_cgroup_ns_to_ctx(struct lttng_kernel_ctx **ctx);
647 #else
648 static inline
649 int lttng_add_cgroup_ns_to_ctx(struct lttng_kernel_ctx **ctx)
650 {
651 return -ENOSYS;
652 }
653 #endif
654
655 #if defined(CONFIG_IPC_NS) && \
656 (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
657 int lttng_add_ipc_ns_to_ctx(struct lttng_kernel_ctx **ctx);
658 #else
659 static inline
660 int lttng_add_ipc_ns_to_ctx(struct lttng_kernel_ctx **ctx)
661 {
662 return -ENOSYS;
663 }
664 #endif
665
666 #if !defined(LTTNG_MNT_NS_MISSING_HEADER) && \
667 (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
668 int lttng_add_mnt_ns_to_ctx(struct lttng_kernel_ctx **ctx);
669 #else
670 static inline
671 int lttng_add_mnt_ns_to_ctx(struct lttng_kernel_ctx **ctx)
672 {
673 return -ENOSYS;
674 }
675 #endif
676
677 #if defined(CONFIG_NET_NS) && \
678 (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
679 int lttng_add_net_ns_to_ctx(struct lttng_kernel_ctx **ctx);
680 #else
681 static inline
682 int lttng_add_net_ns_to_ctx(struct lttng_kernel_ctx **ctx)
683 {
684 return -ENOSYS;
685 }
686 #endif
687
688 #if defined(CONFIG_PID_NS) && \
689 (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
690 int lttng_add_pid_ns_to_ctx(struct lttng_kernel_ctx **ctx);
691 #else
692 static inline
693 int lttng_add_pid_ns_to_ctx(struct lttng_kernel_ctx **ctx)
694 {
695 return -ENOSYS;
696 }
697 #endif
698
699 #if defined(CONFIG_USER_NS) && \
700 (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
701 int lttng_add_user_ns_to_ctx(struct lttng_kernel_ctx **ctx);
702 #else
703 static inline
704 int lttng_add_user_ns_to_ctx(struct lttng_kernel_ctx **ctx)
705 {
706 return -ENOSYS;
707 }
708 #endif
709
710 #if defined(CONFIG_UTS_NS) && \
711 (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
712 int lttng_add_uts_ns_to_ctx(struct lttng_kernel_ctx **ctx);
713 #else
714 static inline
715 int lttng_add_uts_ns_to_ctx(struct lttng_kernel_ctx **ctx)
716 {
717 return -ENOSYS;
718 }
719 #endif
720
721 #if defined(CONFIG_TIME_NS) && \
722 (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0) || \
723 LTTNG_RHEL_KERNEL_RANGE(4,18,0,305,0,0, 4,19,0,0,0,0))
724 int lttng_add_time_ns_to_ctx(struct lttng_kernel_ctx **ctx);
725 #else
726 static inline
727 int lttng_add_time_ns_to_ctx(struct lttng_kernel_ctx **ctx)
728 {
729 return -ENOSYS;
730 }
731 #endif
732
733 int lttng_add_uid_to_ctx(struct lttng_kernel_ctx **ctx);
734 int lttng_add_euid_to_ctx(struct lttng_kernel_ctx **ctx);
735 int lttng_add_suid_to_ctx(struct lttng_kernel_ctx **ctx);
736 int lttng_add_gid_to_ctx(struct lttng_kernel_ctx **ctx);
737 int lttng_add_egid_to_ctx(struct lttng_kernel_ctx **ctx);
738 int lttng_add_sgid_to_ctx(struct lttng_kernel_ctx **ctx);
739 int lttng_add_vuid_to_ctx(struct lttng_kernel_ctx **ctx);
740 int lttng_add_veuid_to_ctx(struct lttng_kernel_ctx **ctx);
741 int lttng_add_vsuid_to_ctx(struct lttng_kernel_ctx **ctx);
742 int lttng_add_vgid_to_ctx(struct lttng_kernel_ctx **ctx);
743 int lttng_add_vegid_to_ctx(struct lttng_kernel_ctx **ctx);
744 int lttng_add_vsgid_to_ctx(struct lttng_kernel_ctx **ctx);
745
746 #if defined(CONFIG_PERF_EVENTS)
747 int lttng_add_perf_counter_to_ctx(uint32_t type,
748 uint64_t config,
749 const char *name,
750 struct lttng_kernel_ctx **ctx);
751 int lttng_cpuhp_perf_counter_online(unsigned int cpu,
752 struct lttng_cpuhp_node *node);
753 int lttng_cpuhp_perf_counter_dead(unsigned int cpu,
754 struct lttng_cpuhp_node *node);
755 #else
756 static inline
757 int lttng_add_perf_counter_to_ctx(uint32_t type,
758 uint64_t config,
759 const char *name,
760 struct lttng_kernel_ctx **ctx)
761 {
762 return -ENOSYS;
763 }
764 static inline
765 int lttng_cpuhp_perf_counter_online(unsigned int cpu,
766 struct lttng_cpuhp_node *node)
767 {
768 return 0;
769 }
770 static inline
771 int lttng_cpuhp_perf_counter_dead(unsigned int cpu,
772 struct lttng_cpuhp_node *node)
773 {
774 return 0;
775 }
776 #endif
777
778 struct lttng_event_enabler *lttng_event_enabler_create(
779 enum lttng_enabler_format_type format_type,
780 struct lttng_kernel_abi_event *event_param,
781 struct lttng_kernel_channel_buffer *chan);
782
783 int lttng_event_enabler_enable(struct lttng_event_enabler *event_enabler);
784 int lttng_event_enabler_disable(struct lttng_event_enabler *event_enabler);
785 struct lttng_event_notifier_enabler *lttng_event_notifier_enabler_create(
786 struct lttng_event_notifier_group *event_notifier_group,
787 enum lttng_enabler_format_type format_type,
788 struct lttng_kernel_abi_event_notifier *event_notifier_param);
789
790 int lttng_event_notifier_enabler_enable(
791 struct lttng_event_notifier_enabler *event_notifier_enabler);
792 int lttng_event_notifier_enabler_disable(
793 struct lttng_event_notifier_enabler *event_notifier_enabler);
794
795 int lttng_event_enabler_attach_filter_bytecode(struct lttng_event_enabler *event_enabler,
796 struct lttng_kernel_abi_filter_bytecode __user *bytecode);
797 int lttng_event_notifier_enabler_attach_filter_bytecode(
798 struct lttng_event_notifier_enabler *event_notifier_enabler,
799 struct lttng_kernel_abi_filter_bytecode __user *bytecode);
800 int lttng_event_notifier_enabler_attach_capture_bytecode(
801 struct lttng_event_notifier_enabler *event_notifier_enabler,
802 struct lttng_kernel_abi_capture_bytecode __user *bytecode);
803
804 int lttng_desc_match_enabler(const struct lttng_kernel_event_desc *desc,
805 struct lttng_enabler *enabler);
806
807 void lttng_enabler_link_bytecode(const struct lttng_kernel_event_desc *event_desc,
808 struct lttng_kernel_ctx *ctx,
809 struct list_head *instance_bytecode_runtime_head,
810 struct list_head *enabler_bytecode_runtime_head);
811
812 #if defined(CONFIG_HAVE_SYSCALL_TRACEPOINTS)
813 int lttng_syscalls_register_event(struct lttng_event_enabler *event_enabler);
814 int lttng_syscalls_unregister_channel(struct lttng_kernel_channel_buffer *chan);
815 int lttng_syscalls_destroy_event(struct lttng_kernel_channel_buffer *chan);
816 int lttng_syscall_filter_enable_event(
817 struct lttng_kernel_channel_buffer *chan,
818 struct lttng_kernel_event_recorder *event);
819 int lttng_syscall_filter_disable_event(
820 struct lttng_kernel_channel_buffer *chan,
821 struct lttng_kernel_event_recorder *event);
822
823 long lttng_channel_syscall_mask(struct lttng_kernel_channel_buffer *channel,
824 struct lttng_kernel_abi_syscall_mask __user *usyscall_mask);
825
826 int lttng_syscalls_register_event_notifier(
827 struct lttng_event_notifier_enabler *event_notifier_enabler);
828 int lttng_syscalls_create_matching_event_notifiers(
829 struct lttng_event_notifier_enabler *event_notifier_enabler);
830 int lttng_syscalls_unregister_event_notifier_group(struct lttng_event_notifier_group *group);
831 int lttng_syscall_filter_enable_event_notifier(struct lttng_kernel_event_notifier *event_notifier);
832 int lttng_syscall_filter_disable_event_notifier(struct lttng_kernel_event_notifier *event_notifier);
833 #else
834 static inline int lttng_syscalls_register_event(
835 struct lttng_event_enabler *event_enabler)
836 {
837 return -ENOSYS;
838 }
839
840 static inline int lttng_syscalls_unregister_channel(struct lttng_kernel_channel_buffer *chan)
841 {
842 return 0;
843 }
844
845 static inline int lttng_syscalls_destroy(struct lttng_kernel_channel_buffer *chan)
846 {
847 return 0;
848 }
849
850 static inline int lttng_syscall_filter_enable_event(struct lttng_kernel_channel_buffer *chan,
851 struct lttng_kernel_event_recorder *event);
852 {
853 return -ENOSYS;
854 }
855
856 static inline int lttng_syscall_filter_disable_event(struct lttng_kernel_channel_buffer *chan,
857 struct lttng_kernel_event_recorder *event);
858 {
859 return -ENOSYS;
860 }
861
862 static inline long lttng_channel_syscall_mask(struct lttng_kernel_channel_buffer *channel,
863 struct lttng_kernel_syscall_mask __user *usyscall_mask)
864 {
865 return -ENOSYS;
866 }
867
868 static inline int lttng_syscalls_register_event_notifier(
869 struct lttng_event_notifier_group *group)
870 {
871 return -ENOSYS;
872 }
873
874 static inline int lttng_syscalls_unregister_event_notifier_group(
875 struct lttng_event_notifier_group *group)
876 {
877 return 0;
878 }
879
880 static inline int lttng_syscall_filter_enable_event_notifier(
881 struct lttng_event_notifier_group *group,
882 const char *name)
883 {
884 return -ENOSYS;
885 }
886
887 static inline int lttng_syscall_filter_disable_event_notifier(
888 struct lttng_event_notifier_group *group,
889 const char *name)
890 {
891 return -ENOSYS;
892 }
893
894 #endif
895
896 #ifdef CONFIG_KPROBES
897 int lttng_kprobes_register_event(const char *name,
898 const char *symbol_name,
899 uint64_t offset,
900 uint64_t addr,
901 struct lttng_kernel_event_recorder *event);
902 void lttng_kprobes_unregister_event(struct lttng_kernel_event_recorder *event);
903 void lttng_kprobes_destroy_event_private(struct lttng_kernel_event_recorder *event);
904 int lttng_kprobes_register_event_notifier(const char *symbol_name,
905 uint64_t offset,
906 uint64_t addr,
907 struct lttng_kernel_event_notifier *event_notifier);
908 void lttng_kprobes_unregister_event_notifier(struct lttng_kernel_event_notifier *event_notifier);
909 void lttng_kprobes_destroy_event_notifier_private(struct lttng_kernel_event_notifier *event_notifier);
910 #else
911 static inline
912 int lttng_kprobes_register_event(const char *name,
913 const char *symbol_name,
914 uint64_t offset,
915 uint64_t addr,
916 struct lttng_kernel_event_recorder *event)
917 {
918 return -ENOSYS;
919 }
920
921 static inline
922 void lttng_kprobes_unregister_event(struct lttng_kernel_event_recorder *event)
923 {
924 }
925
926 static inline
927 void lttng_kprobes_destroy_event_private(struct lttng_kernel_event_recorder *event)
928 {
929 }
930
931 static inline
932 int lttng_kprobes_register_event_notifier(const char *symbol_name,
933 uint64_t offset,
934 uint64_t addr,
935 struct lttng_kernel_event_notifier *event_notifier)
936 {
937 return -ENOSYS;
938 }
939
940 static inline
941 void lttng_kprobes_unregister_event_notifier(struct lttng_kernel_event_notifier *event_notifier)
942 {
943 }
944
945 static inline
946 void lttng_kprobes_destroy_event_notifier_private(struct lttng_kernel_event_notifier *event_notifier)
947 {
948 }
949 #endif
950
951 int lttng_event_add_callsite(struct lttng_kernel_event_common *event,
952 struct lttng_kernel_abi_event_callsite __user *callsite);
953
954 #ifdef CONFIG_UPROBES
955 int lttng_uprobes_register_event(const char *name,
956 int fd, struct lttng_kernel_event_recorder *event);
957 int lttng_uprobes_event_add_callsite(struct lttng_kernel_event_common *event,
958 struct lttng_kernel_abi_event_callsite __user *callsite);
959 void lttng_uprobes_unregister_event(struct lttng_kernel_event_recorder *event);
960 void lttng_uprobes_destroy_event_private(struct lttng_kernel_event_recorder *event);
961 int lttng_uprobes_register_event_notifier(const char *name,
962 int fd, struct lttng_kernel_event_notifier *event_notifier);
963 void lttng_uprobes_unregister_event_notifier(struct lttng_kernel_event_notifier *event_notifier);
964 void lttng_uprobes_destroy_event_notifier_private(struct lttng_kernel_event_notifier *event_notifier);
965 #else
966 static inline
967 int lttng_uprobes_register_event(const char *name,
968 int fd, struct lttng_kernel_event_recorder *event)
969 {
970 return -ENOSYS;
971 }
972
973 static inline
974 int lttng_uprobes_event_add_callsite(struct lttng_kernel_event_common *event,
975 struct lttng_kernel_abi_event_callsite __user *callsite)
976 {
977 return -ENOSYS;
978 }
979
980 static inline
981 void lttng_uprobes_unregister_event(struct lttng_kernel_event_recorder *event)
982 {
983 }
984
985 static inline
986 void lttng_uprobes_destroy_event_private(struct lttng_kernel_event_recorder *event)
987 {
988 }
989
990 static inline
991 int lttng_uprobes_register_event_notifier(const char *name,
992 int fd, struct lttng_kernel_event_notifier *event_notifier)
993 {
994 return -ENOSYS;
995 }
996
997 static inline
998 void lttng_uprobes_unregister_event_notifier(struct lttng_kernel_event_notifier *event_notifier)
999 {
1000 }
1001
1002 static inline
1003 void lttng_uprobes_destroy_event_notifier_private(struct lttng_kernel_event_notifier *event_notifier)
1004 {
1005 }
1006 #endif
1007
1008 #ifdef CONFIG_KRETPROBES
1009 int lttng_kretprobes_register(const char *name,
1010 const char *symbol_name,
1011 uint64_t offset,
1012 uint64_t addr,
1013 struct lttng_kernel_event_recorder *event_entry,
1014 struct lttng_kernel_event_recorder *event_exit);
1015 void lttng_kretprobes_unregister(struct lttng_kernel_event_recorder *event);
1016 void lttng_kretprobes_destroy_private(struct lttng_kernel_event_recorder *event);
1017 int lttng_kretprobes_event_enable_state(struct lttng_kernel_event_common *event,
1018 int enable);
1019 #else
1020 static inline
1021 int lttng_kretprobes_register(const char *name,
1022 const char *symbol_name,
1023 uint64_t offset,
1024 uint64_t addr,
1025 struct lttng_kernel_event_recorder *event_entry,
1026 struct lttng_kernel_event_recorder *event_exit)
1027 {
1028 return -ENOSYS;
1029 }
1030
1031 static inline
1032 void lttng_kretprobes_unregister(struct lttng_kernel_event_recorder *event)
1033 {
1034 }
1035
1036 static inline
1037 void lttng_kretprobes_destroy_private(struct lttng_kernel_event_recorder *event)
1038 {
1039 }
1040
1041 static inline
1042 int lttng_kretprobes_event_enable_state(struct lttng_kernel_event_common *event,
1043 int enable)
1044 {
1045 return -ENOSYS;
1046 }
1047 #endif
1048
1049 void lttng_lock_sessions(void);
1050 void lttng_unlock_sessions(void);
1051
1052 struct list_head *lttng_get_probe_list_head(void);
1053
1054 int lttng_fix_pending_events(void);
1055 int lttng_fix_pending_event_notifiers(void);
1056 int lttng_session_active(void);
1057 bool lttng_event_notifier_active(void);
1058
1059 struct lttng_kernel_session *lttng_session_create(void);
1060 int lttng_session_enable(struct lttng_kernel_session *session);
1061 int lttng_session_disable(struct lttng_kernel_session *session);
1062 void lttng_session_destroy(struct lttng_kernel_session *session);
1063 int lttng_session_metadata_regenerate(struct lttng_kernel_session *session);
1064 int lttng_session_statedump(struct lttng_kernel_session *session);
1065 void metadata_cache_destroy(struct kref *kref);
1066
1067 struct lttng_counter *lttng_kernel_counter_create(
1068 const char *counter_transport_name, size_t number_dimensions,
1069 const size_t *dimensions_sizes);
1070 int lttng_kernel_counter_read(struct lttng_counter *counter,
1071 const size_t *dimension_indexes, int32_t cpu,
1072 int64_t *val, bool *overflow, bool *underflow);
1073 int lttng_kernel_counter_aggregate(struct lttng_counter *counter,
1074 const size_t *dimension_indexes, int64_t *val,
1075 bool *overflow, bool *underflow);
1076 int lttng_kernel_counter_clear(struct lttng_counter *counter,
1077 const size_t *dimension_indexes);
1078 struct lttng_event_notifier_group *lttng_event_notifier_group_create(void);
1079 int lttng_event_notifier_group_create_error_counter(
1080 struct file *event_notifier_group_file,
1081 const struct lttng_kernel_abi_counter_conf *error_counter_conf);
1082 void lttng_event_notifier_group_destroy(
1083 struct lttng_event_notifier_group *event_notifier_group);
1084
1085 struct lttng_kernel_channel_buffer *lttng_channel_create(struct lttng_kernel_session *session,
1086 const char *transport_name,
1087 void *buf_addr,
1088 size_t subbuf_size, size_t num_subbuf,
1089 unsigned int switch_timer_interval,
1090 unsigned int read_timer_interval,
1091 enum channel_type channel_type);
1092 struct lttng_kernel_channel_buffer *lttng_global_channel_create(struct lttng_kernel_session *session,
1093 int overwrite, void *buf_addr,
1094 size_t subbuf_size, size_t num_subbuf,
1095 unsigned int switch_timer_interval,
1096 unsigned int read_timer_interval);
1097
1098 void lttng_metadata_channel_destroy(struct lttng_kernel_channel_buffer *chan);
1099 struct lttng_kernel_event_recorder *lttng_kernel_event_recorder_create(struct lttng_kernel_channel_buffer *chan,
1100 struct lttng_kernel_abi_event *event_param,
1101 const struct lttng_kernel_event_desc *event_desc,
1102 enum lttng_kernel_abi_instrumentation itype);
1103 struct lttng_kernel_event_recorder *_lttng_kernel_event_recorder_create(struct lttng_kernel_channel_buffer *chan,
1104 struct lttng_kernel_abi_event *event_param,
1105 const struct lttng_kernel_event_desc *event_desc,
1106 enum lttng_kernel_abi_instrumentation itype);
1107 struct lttng_kernel_event_recorder *lttng_event_compat_old_create(struct lttng_kernel_channel_buffer *chan,
1108 struct lttng_kernel_abi_old_event *old_event_param,
1109 const struct lttng_kernel_event_desc *internal_desc);
1110
1111 struct lttng_kernel_event_notifier *lttng_event_notifier_create(
1112 const struct lttng_kernel_event_desc *event_notifier_desc,
1113 uint64_t id,
1114 uint64_t error_counter_idx,
1115 struct lttng_event_notifier_group *event_notifier_group,
1116 struct lttng_kernel_abi_event_notifier *event_notifier_param,
1117 enum lttng_kernel_abi_instrumentation itype);
1118 struct lttng_kernel_event_notifier *_lttng_event_notifier_create(
1119 const struct lttng_kernel_event_desc *event_notifier_desc,
1120 uint64_t id,
1121 uint64_t error_counter_idx,
1122 struct lttng_event_notifier_group *event_notifier_group,
1123 struct lttng_kernel_abi_event_notifier *event_notifier_param,
1124 enum lttng_kernel_abi_instrumentation itype);
1125
1126 int lttng_channel_enable(struct lttng_kernel_channel_buffer *channel);
1127 int lttng_channel_disable(struct lttng_kernel_channel_buffer *channel);
1128 int lttng_event_enable(struct lttng_kernel_event_common *event);
1129 int lttng_event_disable(struct lttng_kernel_event_common *event);
1130
1131 void lttng_transport_register(struct lttng_transport *transport);
1132 void lttng_transport_unregister(struct lttng_transport *transport);
1133
1134 void lttng_counter_transport_register(struct lttng_counter_transport *transport);
1135 void lttng_counter_transport_unregister(struct lttng_counter_transport *transport);
1136
1137 void synchronize_trace(void);
1138 int lttng_abi_init(void);
1139 int lttng_abi_compat_old_init(void);
1140 void lttng_abi_exit(void);
1141 void lttng_abi_compat_old_exit(void);
1142
1143 const struct lttng_kernel_event_desc *lttng_event_desc_get(const char *name);
1144 void lttng_event_desc_put(const struct lttng_kernel_event_desc *desc);
1145 int lttng_probes_init(void);
1146 void lttng_probes_exit(void);
1147
1148 int lttng_metadata_output_channel(struct lttng_metadata_stream *stream,
1149 struct lttng_kernel_ring_buffer_channel *chan, bool *coherent);
1150
1151 int lttng_id_tracker_get_node_id(const struct lttng_id_hash_node *node);
1152 int lttng_id_tracker_empty_set(struct lttng_kernel_id_tracker *lf);
1153 int lttng_id_tracker_init(struct lttng_kernel_id_tracker *lf,
1154 struct lttng_kernel_session *session,
1155 enum tracker_type type);
1156 void lttng_id_tracker_fini(struct lttng_kernel_id_tracker *lf);
1157 void lttng_id_tracker_destroy(struct lttng_kernel_id_tracker *lf, bool rcu);
1158 int lttng_id_tracker_add(struct lttng_kernel_id_tracker *lf, int id);
1159 int lttng_id_tracker_del(struct lttng_kernel_id_tracker *lf, int id);
1160
1161 int lttng_session_track_id(struct lttng_kernel_session *session,
1162 enum tracker_type tracker_type, int id);
1163 int lttng_session_untrack_id(struct lttng_kernel_session *session,
1164 enum tracker_type tracker_type, int id);
1165
1166 int lttng_session_list_tracker_ids(struct lttng_kernel_session *session,
1167 enum tracker_type tracker_type);
1168
1169 void lttng_clock_ref(void);
1170 void lttng_clock_unref(void);
1171
1172 void lttng_free_event_filter_runtime(struct lttng_kernel_event_common *event);
1173
1174 int lttng_probes_init(void);
1175
1176 int lttng_logger_init(void);
1177 void lttng_logger_exit(void);
1178
1179 extern int lttng_statedump_start(struct lttng_kernel_session *session);
1180
1181 int lttng_calibrate(struct lttng_kernel_abi_calibrate *calibrate);
1182
1183 extern const struct file_operations lttng_tracepoint_list_fops;
1184 extern const struct file_operations lttng_syscall_list_fops;
1185
1186 #define lttng_kernel_static_ctx_field(_event_field, _get_size, _record, _get_value, _destroy, _priv) \
1187 __LTTNG_COMPOUND_LITERAL(const struct lttng_kernel_ctx_field, { \
1188 .event_field = (_event_field), \
1189 .get_size = (_get_size), \
1190 .record = (_record), \
1191 .get_value = (_get_value), \
1192 .destroy = (_destroy), \
1193 .priv = (_priv), \
1194 })
1195
1196 #endif /* _LTTNG_EVENTS_INTERNAL_H */
This page took 0.074748 seconds and 4 git commands to generate.