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