Use event enabler for event recorder creation for all instrumentation types
[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 bool published; /* published in per-session list. */
226 struct lttng_kernel_channel_buffer *chan;
227 };
228
229 struct lttng_event_notifier_enabler {
230 struct lttng_enabler base;
231 uint64_t error_counter_index;
232 struct list_head node; /* List of event_notifier enablers */
233 struct lttng_event_notifier_group *group;
234
235 /* head list of struct lttng_kernel_bytecode_node */
236 struct list_head capture_bytecode_head;
237 uint64_t num_captures;
238 };
239
240 struct lttng_ctx_value {
241 union {
242 int64_t s64;
243 const char *str;
244 double d;
245 } u;
246 };
247
248 /*
249 * We need to keep this perf counter field separately from struct
250 * lttng_kernel_ctx_field because cpu hotplug needs fixed-location addresses.
251 */
252 struct lttng_perf_counter_field {
253 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0))
254 struct lttng_cpuhp_node cpuhp_prepare;
255 struct lttng_cpuhp_node cpuhp_online;
256 #else
257 struct notifier_block nb;
258 int hp_enable;
259 #endif
260 struct perf_event_attr *attr;
261 struct perf_event **e; /* per-cpu array */
262 char *name;
263 struct lttng_kernel_event_field *event_field;
264 };
265
266 struct lttng_kernel_ctx_field {
267 const struct lttng_kernel_event_field *event_field;
268 size_t (*get_size)(void *priv, struct lttng_kernel_probe_ctx *probe_ctx,
269 size_t offset);
270 void (*record)(void *priv, struct lttng_kernel_probe_ctx *probe_ctx,
271 struct lttng_kernel_ring_buffer_ctx *ctx,
272 struct lttng_kernel_channel_buffer *chan);
273 void (*get_value)(void *priv, struct lttng_kernel_probe_ctx *probe_ctx,
274 struct lttng_ctx_value *value);
275 void (*destroy)(void *priv);
276 void *priv;
277 };
278
279 struct lttng_kernel_ctx {
280 struct lttng_kernel_ctx_field *fields;
281 unsigned int nr_fields;
282 unsigned int allocated_fields;
283 size_t largest_align; /* in bytes */
284 };
285
286 struct lttng_metadata_cache {
287 char *data; /* Metadata cache */
288 unsigned int cache_alloc; /* Metadata allocated size (bytes) */
289 unsigned int metadata_written; /* Number of bytes written in metadata cache */
290 atomic_t producing; /* Metadata being produced (incomplete) */
291 struct kref refcount; /* Metadata cache usage */
292 struct list_head metadata_stream; /* Metadata stream list */
293 uuid_le uuid; /* Trace session unique ID (copy) */
294 struct mutex lock; /* Produce/consume lock */
295 uint64_t version; /* Current version of the metadata */
296 };
297
298 struct lttng_metadata_stream {
299 void *priv; /* Ring buffer private data */
300 struct lttng_metadata_cache *metadata_cache;
301 unsigned int metadata_in; /* Bytes read from the cache */
302 unsigned int metadata_out; /* Bytes consumed from stream */
303 int finalized; /* Has channel been finalized */
304 wait_queue_head_t read_wait; /* Reader buffer-level wait queue */
305 struct list_head list; /* Stream list */
306 struct lttng_transport *transport;
307 uint64_t version; /* Current version of the metadata cache */
308 bool coherent; /* Stream in a coherent state */
309 };
310
311 struct lttng_kernel_channel_buffer_ops_private {
312 struct lttng_kernel_channel_buffer_ops *pub; /* Public channel buffer ops interface */
313
314 struct lttng_kernel_ring_buffer_channel *(*channel_create)(const char *name,
315 void *priv,
316 void *buf_addr,
317 size_t subbuf_size, size_t num_subbuf,
318 unsigned int switch_timer_interval,
319 unsigned int read_timer_interval);
320 void (*channel_destroy)(struct lttng_kernel_ring_buffer_channel *chan);
321 struct lttng_kernel_ring_buffer *(*buffer_read_open)(struct lttng_kernel_ring_buffer_channel *chan);
322 int (*buffer_has_read_closed_stream)(struct lttng_kernel_ring_buffer_channel *chan);
323 void (*buffer_read_close)(struct lttng_kernel_ring_buffer *buf);
324 /*
325 * packet_avail_size returns the available size in the current
326 * packet. Note that the size returned is only a hint, since it
327 * may change due to concurrent writes.
328 */
329 size_t (*packet_avail_size)(struct lttng_kernel_ring_buffer_channel *chan);
330 wait_queue_head_t *(*get_writer_buf_wait_queue)(struct lttng_kernel_ring_buffer_channel *chan, int cpu);
331 wait_queue_head_t *(*get_hp_wait_queue)(struct lttng_kernel_ring_buffer_channel *chan);
332 int (*is_finalized)(struct lttng_kernel_ring_buffer_channel *chan);
333 int (*is_disabled)(struct lttng_kernel_ring_buffer_channel *chan);
334 int (*timestamp_begin) (const struct lttng_kernel_ring_buffer_config *config,
335 struct lttng_kernel_ring_buffer *bufb,
336 uint64_t *timestamp_begin);
337 int (*timestamp_end) (const struct lttng_kernel_ring_buffer_config *config,
338 struct lttng_kernel_ring_buffer *bufb,
339 uint64_t *timestamp_end);
340 int (*events_discarded) (const struct lttng_kernel_ring_buffer_config *config,
341 struct lttng_kernel_ring_buffer *bufb,
342 uint64_t *events_discarded);
343 int (*content_size) (const struct lttng_kernel_ring_buffer_config *config,
344 struct lttng_kernel_ring_buffer *bufb,
345 uint64_t *content_size);
346 int (*packet_size) (const struct lttng_kernel_ring_buffer_config *config,
347 struct lttng_kernel_ring_buffer *bufb,
348 uint64_t *packet_size);
349 int (*stream_id) (const struct lttng_kernel_ring_buffer_config *config,
350 struct lttng_kernel_ring_buffer *bufb,
351 uint64_t *stream_id);
352 int (*current_timestamp) (const struct lttng_kernel_ring_buffer_config *config,
353 struct lttng_kernel_ring_buffer *bufb,
354 uint64_t *ts);
355 int (*sequence_number) (const struct lttng_kernel_ring_buffer_config *config,
356 struct lttng_kernel_ring_buffer *bufb,
357 uint64_t *seq);
358 int (*instance_id) (const struct lttng_kernel_ring_buffer_config *config,
359 struct lttng_kernel_ring_buffer *bufb,
360 uint64_t *id);
361 };
362
363 struct lttng_counter_ops {
364 struct lib_counter *(*counter_create)(size_t nr_dimensions,
365 const size_t *max_nr_elem, /* for each dimension */
366 int64_t global_sum_step);
367 void (*counter_destroy)(struct lib_counter *counter);
368 int (*counter_add)(struct lib_counter *counter, const size_t *dimension_indexes,
369 int64_t v);
370 /*
371 * counter_read reads a specific cpu's counter if @cpu >= 0, or
372 * the global aggregation counter if @cpu == -1.
373 */
374 int (*counter_read)(struct lib_counter *counter, const size_t *dimension_indexes, int cpu,
375 int64_t *value, bool *overflow, bool *underflow);
376 /*
377 * counter_aggregate returns the total sum of all per-cpu counters and
378 * the global aggregation counter.
379 */
380 int (*counter_aggregate)(struct lib_counter *counter, const size_t *dimension_indexes,
381 int64_t *value, bool *overflow, bool *underflow);
382 int (*counter_clear)(struct lib_counter *counter, const size_t *dimension_indexes);
383 };
384
385 struct lttng_counter {
386 struct file *file; /* File associated to counter. */
387 struct file *owner;
388 struct lttng_counter_transport *transport;
389 struct lib_counter *counter;
390 struct lttng_counter_ops *ops;
391 };
392
393 #define LTTNG_EVENT_NOTIFIER_HT_BITS 12
394 #define LTTNG_EVENT_NOTIFIER_HT_SIZE (1U << LTTNG_EVENT_NOTIFIER_HT_BITS)
395
396 struct lttng_event_notifier_ht {
397 struct hlist_head table[LTTNG_EVENT_NOTIFIER_HT_SIZE];
398 };
399
400 struct lttng_event_notifier_group {
401 struct file *file; /* File associated to event notifier group */
402 struct file *notif_file; /* File used to expose notifications to userspace. */
403 struct list_head node; /* event notifier group list */
404 struct list_head enablers_head; /* List of enablers */
405 struct list_head event_notifiers_head; /* List of event notifier */
406 struct lttng_event_notifier_ht event_notifiers_ht; /* Hash table of event notifiers */
407 struct lttng_kernel_channel_buffer_ops *ops;
408 struct lttng_transport *transport;
409 struct lttng_kernel_ring_buffer_channel *chan; /* Ring buffer channel for event notifier group. */
410 struct lttng_kernel_ring_buffer *buf; /* Ring buffer for event notifier group. */
411 wait_queue_head_t read_wait;
412 struct irq_work wakeup_pending; /* Pending wakeup irq work. */
413 struct lttng_kernel_event_notifier *sc_unknown; /* for unknown syscalls */
414 struct lttng_kernel_event_notifier *sc_compat_unknown;
415
416 struct lttng_syscall_filter *sc_filter;
417
418 struct hlist_head *event_notifier_syscall_dispatch;
419 struct hlist_head *event_notifier_compat_syscall_dispatch;
420 struct hlist_head *event_notifier_exit_syscall_dispatch;
421 struct hlist_head *event_notifier_exit_compat_syscall_dispatch;
422
423 struct hlist_head event_notifier_unknown_syscall_dispatch;
424 struct hlist_head event_notifier_compat_unknown_syscall_dispatch;
425 struct hlist_head event_notifier_exit_unknown_syscall_dispatch;
426 struct hlist_head event_notifier_exit_compat_unknown_syscall_dispatch;
427
428 int syscall_all_entry;
429 int syscall_all_exit;
430
431 unsigned int sys_enter_registered:1, sys_exit_registered:1;
432
433 struct lttng_counter *error_counter;
434 size_t error_counter_len;
435 };
436
437 struct lttng_transport {
438 char *name;
439 struct module *owner;
440 struct list_head node;
441 struct lttng_kernel_channel_buffer_ops ops;
442 };
443
444 struct lttng_counter_transport {
445 char *name;
446 struct module *owner;
447 struct list_head node;
448 struct lttng_counter_ops ops;
449 };
450
451 #define LTTNG_EVENT_HT_BITS 12
452 #define LTTNG_EVENT_HT_SIZE (1U << LTTNG_EVENT_HT_BITS)
453
454 struct lttng_event_ht {
455 struct hlist_head table[LTTNG_EVENT_HT_SIZE];
456 };
457
458 struct lttng_kernel_session_private {
459 struct lttng_kernel_session *pub; /* Public session interface */
460
461 int been_active; /* Has trace session been active ? */
462 struct file *file; /* File associated to session */
463 struct list_head chan; /* Channel list head */
464 struct list_head events; /* Event list head */
465 struct list_head list; /* Session list */
466 unsigned int free_chan_id; /* Next chan ID to allocate */
467 uuid_le uuid; /* Trace session unique ID */
468 struct lttng_metadata_cache *metadata_cache;
469 unsigned int metadata_dumped:1,
470 tstate:1; /* Transient enable state */
471 /* List of event enablers */
472 struct list_head enablers_head;
473 /* Hash table of events */
474 struct lttng_event_ht events_ht;
475 char name[LTTNG_KERNEL_ABI_SESSION_NAME_LEN];
476 char creation_time[LTTNG_KERNEL_ABI_SESSION_CREATION_TIME_ISO8601_LEN];
477 };
478
479 struct lttng_id_hash_node {
480 struct hlist_node hlist;
481 int id;
482 };
483
484 enum tracker_type {
485 TRACKER_PID,
486 TRACKER_VPID,
487 TRACKER_UID,
488 TRACKER_VUID,
489 TRACKER_GID,
490 TRACKER_VGID,
491
492 TRACKER_UNKNOWN,
493 };
494
495 struct lttng_kernel_id_tracker_private {
496 struct lttng_kernel_id_tracker *pub; /* Public interface */
497
498 struct lttng_kernel_session *session;
499 enum tracker_type tracker_type;
500 };
501
502 extern struct lttng_kernel_ctx *lttng_static_ctx;
503
504 static inline
505 const struct lttng_kernel_type_integer *lttng_kernel_get_type_integer(const struct lttng_kernel_type_common *type)
506 {
507 if (type->type != lttng_kernel_type_integer)
508 return NULL;
509 return container_of(type, const struct lttng_kernel_type_integer, parent);
510 }
511
512 static inline
513 const struct lttng_kernel_type_string *lttng_kernel_get_type_string(const struct lttng_kernel_type_common *type)
514 {
515 if (type->type != lttng_kernel_type_string)
516 return NULL;
517 return container_of(type, const struct lttng_kernel_type_string, parent);
518 }
519
520 static inline
521 const struct lttng_kernel_type_enum *lttng_kernel_get_type_enum(const struct lttng_kernel_type_common *type)
522 {
523 if (type->type != lttng_kernel_type_enum)
524 return NULL;
525 return container_of(type, const struct lttng_kernel_type_enum, parent);
526 }
527
528 static inline
529 const struct lttng_kernel_type_array *lttng_kernel_get_type_array(const struct lttng_kernel_type_common *type)
530 {
531 if (type->type != lttng_kernel_type_array)
532 return NULL;
533 return container_of(type, const struct lttng_kernel_type_array, parent);
534 }
535
536 static inline
537 const struct lttng_kernel_type_sequence *lttng_kernel_get_type_sequence(const struct lttng_kernel_type_common *type)
538 {
539 if (type->type != lttng_kernel_type_sequence)
540 return NULL;
541 return container_of(type, const struct lttng_kernel_type_sequence, parent);
542 }
543
544 static inline
545 const struct lttng_kernel_type_struct *lttng_kernel_get_type_struct(const struct lttng_kernel_type_common *type)
546 {
547 if (type->type != lttng_kernel_type_struct)
548 return NULL;
549 return container_of(type, const struct lttng_kernel_type_struct, parent);
550 }
551
552 static inline
553 const struct lttng_kernel_type_variant *lttng_kernel_get_type_variant(const struct lttng_kernel_type_common *type)
554 {
555 if (type->type != lttng_kernel_type_variant)
556 return NULL;
557 return container_of(type, const struct lttng_kernel_type_variant, parent);
558 }
559
560 static inline bool lttng_kernel_type_is_bytewise_integer(const struct lttng_kernel_type_common *type)
561 {
562 const struct lttng_kernel_type_integer *type_integer = lttng_kernel_get_type_integer(type);
563
564 if (!type_integer)
565 return false;
566 switch (type_integer->size) {
567 case 8:
568 lttng_fallthrough;
569 case 16:
570 lttng_fallthrough;
571 case 32:
572 lttng_fallthrough;
573 case 64:
574 break;
575 default:
576 return false;
577 }
578 return true;
579 }
580
581 int lttng_kernel_interpret_event_filter(const struct lttng_kernel_event_common *event,
582 const char *interpreter_stack_data,
583 struct lttng_kernel_probe_ctx *probe_ctx,
584 void *event_filter_ctx);
585
586 static inline
587 struct lttng_enabler *lttng_event_enabler_as_enabler(
588 struct lttng_event_enabler *event_enabler)
589 {
590 return &event_enabler->base;
591 }
592
593 static inline
594 struct lttng_enabler *lttng_event_notifier_enabler_as_enabler(
595 struct lttng_event_notifier_enabler *event_notifier_enabler)
596 {
597 return &event_notifier_enabler->base;
598 }
599
600 int lttng_context_init(void);
601 void lttng_context_exit(void);
602 int lttng_kernel_context_append(struct lttng_kernel_ctx **ctx_p,
603 const struct lttng_kernel_ctx_field *f);
604 void lttng_kernel_context_remove_last(struct lttng_kernel_ctx **ctx_p);
605 struct lttng_kernel_ctx_field *lttng_kernel_get_context_field_from_index(struct lttng_kernel_ctx *ctx,
606 size_t index);
607 int lttng_kernel_find_context(struct lttng_kernel_ctx *ctx, const char *name);
608 int lttng_kernel_get_context_index(struct lttng_kernel_ctx *ctx, const char *name);
609 void lttng_kernel_destroy_context(struct lttng_kernel_ctx *ctx);
610 int lttng_add_pid_to_ctx(struct lttng_kernel_ctx **ctx);
611 int lttng_add_cpu_id_to_ctx(struct lttng_kernel_ctx **ctx);
612 int lttng_add_procname_to_ctx(struct lttng_kernel_ctx **ctx);
613 int lttng_add_prio_to_ctx(struct lttng_kernel_ctx **ctx);
614 int lttng_add_nice_to_ctx(struct lttng_kernel_ctx **ctx);
615 int lttng_add_vpid_to_ctx(struct lttng_kernel_ctx **ctx);
616 int lttng_add_tid_to_ctx(struct lttng_kernel_ctx **ctx);
617 int lttng_add_vtid_to_ctx(struct lttng_kernel_ctx **ctx);
618 int lttng_add_ppid_to_ctx(struct lttng_kernel_ctx **ctx);
619 int lttng_add_vppid_to_ctx(struct lttng_kernel_ctx **ctx);
620 int lttng_add_hostname_to_ctx(struct lttng_kernel_ctx **ctx);
621 int lttng_add_interruptible_to_ctx(struct lttng_kernel_ctx **ctx);
622 int lttng_add_need_reschedule_to_ctx(struct lttng_kernel_ctx **ctx);
623 #if defined(CONFIG_PREEMPT_RT_FULL) || defined(CONFIG_PREEMPT)
624 int lttng_add_preemptible_to_ctx(struct lttng_kernel_ctx **ctx);
625 #else
626 static inline
627 int lttng_add_preemptible_to_ctx(struct lttng_kernel_ctx **ctx)
628 {
629 return -ENOSYS;
630 }
631 #endif
632 #ifdef CONFIG_PREEMPT_RT_FULL
633 int lttng_add_migratable_to_ctx(struct lttng_kernel_ctx **ctx);
634 #else
635 static inline
636 int lttng_add_migratable_to_ctx(struct lttng_kernel_ctx **ctx)
637 {
638 return -ENOSYS;
639 }
640 #endif
641
642 int lttng_add_callstack_to_ctx(struct lttng_kernel_ctx **ctx, int type);
643
644 #if defined(CONFIG_CGROUPS) && \
645 ((LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,6,0)) || \
646 LTTNG_UBUNTU_KERNEL_RANGE(4,4,0,0, 4,5,0,0))
647 int lttng_add_cgroup_ns_to_ctx(struct lttng_kernel_ctx **ctx);
648 #else
649 static inline
650 int lttng_add_cgroup_ns_to_ctx(struct lttng_kernel_ctx **ctx)
651 {
652 return -ENOSYS;
653 }
654 #endif
655
656 #if defined(CONFIG_IPC_NS) && \
657 (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
658 int lttng_add_ipc_ns_to_ctx(struct lttng_kernel_ctx **ctx);
659 #else
660 static inline
661 int lttng_add_ipc_ns_to_ctx(struct lttng_kernel_ctx **ctx)
662 {
663 return -ENOSYS;
664 }
665 #endif
666
667 #if !defined(LTTNG_MNT_NS_MISSING_HEADER) && \
668 (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
669 int lttng_add_mnt_ns_to_ctx(struct lttng_kernel_ctx **ctx);
670 #else
671 static inline
672 int lttng_add_mnt_ns_to_ctx(struct lttng_kernel_ctx **ctx)
673 {
674 return -ENOSYS;
675 }
676 #endif
677
678 #if defined(CONFIG_NET_NS) && \
679 (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
680 int lttng_add_net_ns_to_ctx(struct lttng_kernel_ctx **ctx);
681 #else
682 static inline
683 int lttng_add_net_ns_to_ctx(struct lttng_kernel_ctx **ctx)
684 {
685 return -ENOSYS;
686 }
687 #endif
688
689 #if defined(CONFIG_PID_NS) && \
690 (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
691 int lttng_add_pid_ns_to_ctx(struct lttng_kernel_ctx **ctx);
692 #else
693 static inline
694 int lttng_add_pid_ns_to_ctx(struct lttng_kernel_ctx **ctx)
695 {
696 return -ENOSYS;
697 }
698 #endif
699
700 #if defined(CONFIG_USER_NS) && \
701 (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
702 int lttng_add_user_ns_to_ctx(struct lttng_kernel_ctx **ctx);
703 #else
704 static inline
705 int lttng_add_user_ns_to_ctx(struct lttng_kernel_ctx **ctx)
706 {
707 return -ENOSYS;
708 }
709 #endif
710
711 #if defined(CONFIG_UTS_NS) && \
712 (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
713 int lttng_add_uts_ns_to_ctx(struct lttng_kernel_ctx **ctx);
714 #else
715 static inline
716 int lttng_add_uts_ns_to_ctx(struct lttng_kernel_ctx **ctx)
717 {
718 return -ENOSYS;
719 }
720 #endif
721
722 #if defined(CONFIG_TIME_NS) && \
723 (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0) || \
724 LTTNG_RHEL_KERNEL_RANGE(4,18,0,305,0,0, 4,19,0,0,0,0))
725 int lttng_add_time_ns_to_ctx(struct lttng_kernel_ctx **ctx);
726 #else
727 static inline
728 int lttng_add_time_ns_to_ctx(struct lttng_kernel_ctx **ctx)
729 {
730 return -ENOSYS;
731 }
732 #endif
733
734 int lttng_add_uid_to_ctx(struct lttng_kernel_ctx **ctx);
735 int lttng_add_euid_to_ctx(struct lttng_kernel_ctx **ctx);
736 int lttng_add_suid_to_ctx(struct lttng_kernel_ctx **ctx);
737 int lttng_add_gid_to_ctx(struct lttng_kernel_ctx **ctx);
738 int lttng_add_egid_to_ctx(struct lttng_kernel_ctx **ctx);
739 int lttng_add_sgid_to_ctx(struct lttng_kernel_ctx **ctx);
740 int lttng_add_vuid_to_ctx(struct lttng_kernel_ctx **ctx);
741 int lttng_add_veuid_to_ctx(struct lttng_kernel_ctx **ctx);
742 int lttng_add_vsuid_to_ctx(struct lttng_kernel_ctx **ctx);
743 int lttng_add_vgid_to_ctx(struct lttng_kernel_ctx **ctx);
744 int lttng_add_vegid_to_ctx(struct lttng_kernel_ctx **ctx);
745 int lttng_add_vsgid_to_ctx(struct lttng_kernel_ctx **ctx);
746
747 #if defined(CONFIG_PERF_EVENTS)
748 int lttng_add_perf_counter_to_ctx(uint32_t type,
749 uint64_t config,
750 const char *name,
751 struct lttng_kernel_ctx **ctx);
752 int lttng_cpuhp_perf_counter_online(unsigned int cpu,
753 struct lttng_cpuhp_node *node);
754 int lttng_cpuhp_perf_counter_dead(unsigned int cpu,
755 struct lttng_cpuhp_node *node);
756 #else
757 static inline
758 int lttng_add_perf_counter_to_ctx(uint32_t type,
759 uint64_t config,
760 const char *name,
761 struct lttng_kernel_ctx **ctx)
762 {
763 return -ENOSYS;
764 }
765 static inline
766 int lttng_cpuhp_perf_counter_online(unsigned int cpu,
767 struct lttng_cpuhp_node *node)
768 {
769 return 0;
770 }
771 static inline
772 int lttng_cpuhp_perf_counter_dead(unsigned int cpu,
773 struct lttng_cpuhp_node *node)
774 {
775 return 0;
776 }
777 #endif
778
779 struct lttng_event_enabler *lttng_event_enabler_create(
780 enum lttng_enabler_format_type format_type,
781 struct lttng_kernel_abi_event *event_param,
782 struct lttng_kernel_channel_buffer *chan);
783 void lttng_event_enabler_session_add(struct lttng_kernel_session *session,
784 struct lttng_event_enabler *event_enabler);
785 void lttng_event_enabler_destroy(struct lttng_event_enabler *event_enabler);
786
787 int lttng_event_enabler_enable(struct lttng_event_enabler *event_enabler);
788 int lttng_event_enabler_disable(struct lttng_event_enabler *event_enabler);
789 struct lttng_event_notifier_enabler *lttng_event_notifier_enabler_create(
790 struct lttng_event_notifier_group *event_notifier_group,
791 enum lttng_enabler_format_type format_type,
792 struct lttng_kernel_abi_event_notifier *event_notifier_param);
793
794 int lttng_event_notifier_enabler_enable(
795 struct lttng_event_notifier_enabler *event_notifier_enabler);
796 int lttng_event_notifier_enabler_disable(
797 struct lttng_event_notifier_enabler *event_notifier_enabler);
798
799 int lttng_event_enabler_attach_filter_bytecode(struct lttng_event_enabler *event_enabler,
800 struct lttng_kernel_abi_filter_bytecode __user *bytecode);
801 int lttng_event_notifier_enabler_attach_filter_bytecode(
802 struct lttng_event_notifier_enabler *event_notifier_enabler,
803 struct lttng_kernel_abi_filter_bytecode __user *bytecode);
804 int lttng_event_notifier_enabler_attach_capture_bytecode(
805 struct lttng_event_notifier_enabler *event_notifier_enabler,
806 struct lttng_kernel_abi_capture_bytecode __user *bytecode);
807
808 int lttng_desc_match_enabler(const struct lttng_kernel_event_desc *desc,
809 struct lttng_enabler *enabler);
810
811 void lttng_enabler_link_bytecode(const struct lttng_kernel_event_desc *event_desc,
812 struct lttng_kernel_ctx *ctx,
813 struct list_head *instance_bytecode_runtime_head,
814 struct list_head *enabler_bytecode_runtime_head);
815
816 #if defined(CONFIG_HAVE_SYSCALL_TRACEPOINTS)
817 int lttng_syscalls_register_event(struct lttng_event_enabler *event_enabler);
818 int lttng_syscalls_unregister_channel(struct lttng_kernel_channel_buffer *chan);
819 int lttng_syscalls_destroy_event(struct lttng_kernel_channel_buffer *chan);
820 int lttng_syscall_filter_enable_event(
821 struct lttng_kernel_channel_buffer *chan,
822 struct lttng_kernel_event_recorder *event);
823 int lttng_syscall_filter_disable_event(
824 struct lttng_kernel_channel_buffer *chan,
825 struct lttng_kernel_event_recorder *event);
826
827 long lttng_channel_syscall_mask(struct lttng_kernel_channel_buffer *channel,
828 struct lttng_kernel_abi_syscall_mask __user *usyscall_mask);
829
830 int lttng_syscalls_register_event_notifier(
831 struct lttng_event_notifier_enabler *event_notifier_enabler);
832 int lttng_syscalls_create_matching_event_notifiers(
833 struct lttng_event_notifier_enabler *event_notifier_enabler);
834 int lttng_syscalls_unregister_event_notifier_group(struct lttng_event_notifier_group *group);
835 int lttng_syscall_filter_enable_event_notifier(struct lttng_kernel_event_notifier *event_notifier);
836 int lttng_syscall_filter_disable_event_notifier(struct lttng_kernel_event_notifier *event_notifier);
837 #else
838 static inline int lttng_syscalls_register_event(
839 struct lttng_event_enabler *event_enabler)
840 {
841 return -ENOSYS;
842 }
843
844 static inline int lttng_syscalls_unregister_channel(struct lttng_kernel_channel_buffer *chan)
845 {
846 return 0;
847 }
848
849 static inline int lttng_syscalls_destroy(struct lttng_kernel_channel_buffer *chan)
850 {
851 return 0;
852 }
853
854 static inline int lttng_syscall_filter_enable_event(struct lttng_kernel_channel_buffer *chan,
855 struct lttng_kernel_event_recorder *event);
856 {
857 return -ENOSYS;
858 }
859
860 static inline int lttng_syscall_filter_disable_event(struct lttng_kernel_channel_buffer *chan,
861 struct lttng_kernel_event_recorder *event);
862 {
863 return -ENOSYS;
864 }
865
866 static inline long lttng_channel_syscall_mask(struct lttng_kernel_channel_buffer *channel,
867 struct lttng_kernel_syscall_mask __user *usyscall_mask)
868 {
869 return -ENOSYS;
870 }
871
872 static inline int lttng_syscalls_register_event_notifier(
873 struct lttng_event_notifier_group *group)
874 {
875 return -ENOSYS;
876 }
877
878 static inline int lttng_syscalls_unregister_event_notifier_group(
879 struct lttng_event_notifier_group *group)
880 {
881 return 0;
882 }
883
884 static inline int lttng_syscall_filter_enable_event_notifier(
885 struct lttng_event_notifier_group *group,
886 const char *name)
887 {
888 return -ENOSYS;
889 }
890
891 static inline int lttng_syscall_filter_disable_event_notifier(
892 struct lttng_event_notifier_group *group,
893 const char *name)
894 {
895 return -ENOSYS;
896 }
897
898 #endif
899
900 #ifdef CONFIG_KPROBES
901 int lttng_kprobes_register_event(const char *name,
902 const char *symbol_name,
903 uint64_t offset,
904 uint64_t addr,
905 struct lttng_kernel_event_recorder *event);
906 void lttng_kprobes_unregister_event(struct lttng_kernel_event_recorder *event);
907 void lttng_kprobes_destroy_event_private(struct lttng_kernel_event_recorder *event);
908 int lttng_kprobes_register_event_notifier(const char *symbol_name,
909 uint64_t offset,
910 uint64_t addr,
911 struct lttng_kernel_event_notifier *event_notifier);
912 void lttng_kprobes_unregister_event_notifier(struct lttng_kernel_event_notifier *event_notifier);
913 void lttng_kprobes_destroy_event_notifier_private(struct lttng_kernel_event_notifier *event_notifier);
914 #else
915 static inline
916 int lttng_kprobes_register_event(const char *name,
917 const char *symbol_name,
918 uint64_t offset,
919 uint64_t addr,
920 struct lttng_kernel_event_recorder *event)
921 {
922 return -ENOSYS;
923 }
924
925 static inline
926 void lttng_kprobes_unregister_event(struct lttng_kernel_event_recorder *event)
927 {
928 }
929
930 static inline
931 void lttng_kprobes_destroy_event_private(struct lttng_kernel_event_recorder *event)
932 {
933 }
934
935 static inline
936 int lttng_kprobes_register_event_notifier(const char *symbol_name,
937 uint64_t offset,
938 uint64_t addr,
939 struct lttng_kernel_event_notifier *event_notifier)
940 {
941 return -ENOSYS;
942 }
943
944 static inline
945 void lttng_kprobes_unregister_event_notifier(struct lttng_kernel_event_notifier *event_notifier)
946 {
947 }
948
949 static inline
950 void lttng_kprobes_destroy_event_notifier_private(struct lttng_kernel_event_notifier *event_notifier)
951 {
952 }
953 #endif
954
955 int lttng_event_add_callsite(struct lttng_kernel_event_common *event,
956 struct lttng_kernel_abi_event_callsite __user *callsite);
957
958 #ifdef CONFIG_UPROBES
959 int lttng_uprobes_register_event(const char *name,
960 int fd, struct lttng_kernel_event_recorder *event);
961 int lttng_uprobes_event_add_callsite(struct lttng_kernel_event_common *event,
962 struct lttng_kernel_abi_event_callsite __user *callsite);
963 void lttng_uprobes_unregister_event(struct lttng_kernel_event_recorder *event);
964 void lttng_uprobes_destroy_event_private(struct lttng_kernel_event_recorder *event);
965 int lttng_uprobes_register_event_notifier(const char *name,
966 int fd, struct lttng_kernel_event_notifier *event_notifier);
967 void lttng_uprobes_unregister_event_notifier(struct lttng_kernel_event_notifier *event_notifier);
968 void lttng_uprobes_destroy_event_notifier_private(struct lttng_kernel_event_notifier *event_notifier);
969 #else
970 static inline
971 int lttng_uprobes_register_event(const char *name,
972 int fd, struct lttng_kernel_event_recorder *event)
973 {
974 return -ENOSYS;
975 }
976
977 static inline
978 int lttng_uprobes_event_add_callsite(struct lttng_kernel_event_common *event,
979 struct lttng_kernel_abi_event_callsite __user *callsite)
980 {
981 return -ENOSYS;
982 }
983
984 static inline
985 void lttng_uprobes_unregister_event(struct lttng_kernel_event_recorder *event)
986 {
987 }
988
989 static inline
990 void lttng_uprobes_destroy_event_private(struct lttng_kernel_event_recorder *event)
991 {
992 }
993
994 static inline
995 int lttng_uprobes_register_event_notifier(const char *name,
996 int fd, struct lttng_kernel_event_notifier *event_notifier)
997 {
998 return -ENOSYS;
999 }
1000
1001 static inline
1002 void lttng_uprobes_unregister_event_notifier(struct lttng_kernel_event_notifier *event_notifier)
1003 {
1004 }
1005
1006 static inline
1007 void lttng_uprobes_destroy_event_notifier_private(struct lttng_kernel_event_notifier *event_notifier)
1008 {
1009 }
1010 #endif
1011
1012 #ifdef CONFIG_KRETPROBES
1013 int lttng_kretprobes_register(const char *name,
1014 const char *symbol_name,
1015 uint64_t offset,
1016 uint64_t addr,
1017 struct lttng_kernel_event_recorder *event_entry,
1018 struct lttng_kernel_event_recorder *event_exit);
1019 void lttng_kretprobes_unregister(struct lttng_kernel_event_recorder *event);
1020 void lttng_kretprobes_destroy_private(struct lttng_kernel_event_recorder *event);
1021 int lttng_kretprobes_event_enable_state(struct lttng_kernel_event_common *event,
1022 int enable);
1023 #else
1024 static inline
1025 int lttng_kretprobes_register(const char *name,
1026 const char *symbol_name,
1027 uint64_t offset,
1028 uint64_t addr,
1029 struct lttng_kernel_event_recorder *event_entry,
1030 struct lttng_kernel_event_recorder *event_exit)
1031 {
1032 return -ENOSYS;
1033 }
1034
1035 static inline
1036 void lttng_kretprobes_unregister(struct lttng_kernel_event_recorder *event)
1037 {
1038 }
1039
1040 static inline
1041 void lttng_kretprobes_destroy_private(struct lttng_kernel_event_recorder *event)
1042 {
1043 }
1044
1045 static inline
1046 int lttng_kretprobes_event_enable_state(struct lttng_kernel_event_common *event,
1047 int enable)
1048 {
1049 return -ENOSYS;
1050 }
1051 #endif
1052
1053 void lttng_lock_sessions(void);
1054 void lttng_unlock_sessions(void);
1055
1056 struct list_head *lttng_get_probe_list_head(void);
1057
1058 int lttng_fix_pending_events(void);
1059 int lttng_fix_pending_event_notifiers(void);
1060 int lttng_session_active(void);
1061 bool lttng_event_notifier_active(void);
1062
1063 struct lttng_kernel_session *lttng_session_create(void);
1064 int lttng_session_enable(struct lttng_kernel_session *session);
1065 int lttng_session_disable(struct lttng_kernel_session *session);
1066 void lttng_session_destroy(struct lttng_kernel_session *session);
1067 int lttng_session_metadata_regenerate(struct lttng_kernel_session *session);
1068 int lttng_session_statedump(struct lttng_kernel_session *session);
1069 void metadata_cache_destroy(struct kref *kref);
1070
1071 struct lttng_counter *lttng_kernel_counter_create(
1072 const char *counter_transport_name, size_t number_dimensions,
1073 const size_t *dimensions_sizes);
1074 int lttng_kernel_counter_read(struct lttng_counter *counter,
1075 const size_t *dimension_indexes, int32_t cpu,
1076 int64_t *val, bool *overflow, bool *underflow);
1077 int lttng_kernel_counter_aggregate(struct lttng_counter *counter,
1078 const size_t *dimension_indexes, int64_t *val,
1079 bool *overflow, bool *underflow);
1080 int lttng_kernel_counter_clear(struct lttng_counter *counter,
1081 const size_t *dimension_indexes);
1082 struct lttng_event_notifier_group *lttng_event_notifier_group_create(void);
1083 int lttng_event_notifier_group_create_error_counter(
1084 struct file *event_notifier_group_file,
1085 const struct lttng_kernel_abi_counter_conf *error_counter_conf);
1086 void lttng_event_notifier_group_destroy(
1087 struct lttng_event_notifier_group *event_notifier_group);
1088
1089 struct lttng_kernel_channel_buffer *lttng_channel_create(struct lttng_kernel_session *session,
1090 const char *transport_name,
1091 void *buf_addr,
1092 size_t subbuf_size, size_t num_subbuf,
1093 unsigned int switch_timer_interval,
1094 unsigned int read_timer_interval,
1095 enum channel_type channel_type);
1096 struct lttng_kernel_channel_buffer *lttng_global_channel_create(struct lttng_kernel_session *session,
1097 int overwrite, void *buf_addr,
1098 size_t subbuf_size, size_t num_subbuf,
1099 unsigned int switch_timer_interval,
1100 unsigned int read_timer_interval);
1101
1102 void lttng_metadata_channel_destroy(struct lttng_kernel_channel_buffer *chan);
1103 struct lttng_kernel_event_recorder *lttng_kernel_event_recorder_create(struct lttng_event_enabler *event_enabler,
1104 const struct lttng_kernel_event_desc *event_desc);
1105 struct lttng_kernel_event_recorder *_lttng_kernel_event_recorder_create(struct lttng_event_enabler *event_enabler,
1106 const struct lttng_kernel_event_desc *event_desc);
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.085752 seconds and 5 git commands to generate.