Commit | Line | Data |
---|---|---|
20fe2104 | 1 | /* |
21cf9b6b | 2 | * Copyright (C) 2011 EfficiOS Inc. |
20fe2104 | 3 | * |
ab5be9fa | 4 | * SPDX-License-Identifier: GPL-2.0-only |
20fe2104 | 5 | * |
20fe2104 DG |
6 | */ |
7 | ||
8 | #ifndef _LTT_KERNEL_CTL_H | |
9 | #define _LTT_KERNEL_CTL_H | |
10 | ||
159b042f JG |
11 | #include "lttng/lttng-error.h" |
12 | #include "lttng/tracker.h" | |
8c0faa1d | 13 | #include "session.h" |
6dc3064a | 14 | #include "snapshot.h" |
62499ad6 | 15 | #include "trace-kernel.h" |
f34daff7 | 16 | |
2ef84c95 DG |
17 | /* |
18 | * Default size for the event list when kernel_list_events is called. This size | |
050349bb DG |
19 | * value is based on the initial LTTng 2.0 version set of tracepoints. |
20 | * | |
21 | * This is NOT an upper bound because if the real event list size is bigger, | |
22 | * dynamic reallocation is performed. | |
2ef84c95 | 23 | */ |
6725fe19 | 24 | #define KERNEL_EVENT_INIT_LIST_SIZE 64 |
2ef84c95 | 25 | |
d65106b1 | 26 | int kernel_add_channel_context(struct ltt_kernel_channel *chan, |
645328ae | 27 | struct ltt_kernel_context *ctx); |
7d268848 | 28 | int kernel_create_session(struct ltt_session *session); |
b082db07 | 29 | int kernel_create_channel(struct ltt_kernel_session *session, |
fdd9eb17 | 30 | struct lttng_channel *chan); |
00a62084 | 31 | int kernel_create_event(struct lttng_event *ev, struct ltt_kernel_channel *channel, |
2b00d462 | 32 | char *filter_expression, struct lttng_bytecode *filter); |
26cc6b4e | 33 | int kernel_disable_channel(struct ltt_kernel_channel *chan); |
19e70852 DG |
34 | int kernel_disable_event(struct ltt_kernel_event *event); |
35 | int kernel_enable_event(struct ltt_kernel_event *event); | |
d36b8583 | 36 | int kernel_enable_channel(struct ltt_kernel_channel *chan); |
159b042f | 37 | enum lttng_error_code kernel_process_attr_tracker_set_tracking_policy( |
55c9e7ca | 38 | struct ltt_kernel_session *session, |
159b042f JG |
39 | enum lttng_process_attr process_attr, |
40 | enum lttng_tracking_policy policy); | |
41 | enum lttng_error_code kernel_process_attr_tracker_inclusion_set_add_value( | |
55c9e7ca | 42 | struct ltt_kernel_session *session, |
159b042f JG |
43 | enum lttng_process_attr process_attr, |
44 | const struct process_attr_value *value); | |
45 | enum lttng_error_code kernel_process_attr_tracker_inclusion_set_remove_value( | |
46 | struct ltt_kernel_session *session, | |
47 | enum lttng_process_attr process_attr, | |
48 | const struct process_attr_value *value); | |
49 | const struct process_attr_tracker *kernel_get_process_attr_tracker( | |
50 | struct ltt_kernel_session *session, | |
51 | enum lttng_process_attr process_attr); | |
a4b92340 | 52 | int kernel_open_metadata(struct ltt_kernel_session *session); |
f3ed775e DG |
53 | int kernel_open_metadata_stream(struct ltt_kernel_session *session); |
54 | int kernel_open_channel_stream(struct ltt_kernel_channel *channel); | |
55 | int kernel_flush_buffer(struct ltt_kernel_channel *channel); | |
56 | int kernel_metadata_flush_buffer(int fd); | |
8c0faa1d DG |
57 | int kernel_start_session(struct ltt_kernel_session *session); |
58 | int kernel_stop_session(struct ltt_kernel_session *session); | |
7d268848 MD |
59 | ssize_t kernel_list_events(struct lttng_event **event_list); |
60 | void kernel_wait_quiescent(void); | |
b8e2fb80 FD |
61 | int kernel_validate_version(struct lttng_kernel_abi_tracer_version *kernel_tracer_version, |
62 | struct lttng_kernel_abi_tracer_abi_version *kernel_tracer_abi_version); | |
2f77fc4b | 63 | void kernel_destroy_session(struct ltt_kernel_session *ksess); |
d070c424 | 64 | void kernel_free_session(struct ltt_kernel_session *ksess); |
fb5f35b6 | 65 | void kernel_destroy_channel(struct ltt_kernel_channel *kchan); |
fb9a95c4 JG |
66 | enum lttng_error_code kernel_snapshot_record( |
67 | struct ltt_kernel_session *ksess, | |
348a81dc | 68 | const struct consumer_output *output, int wait, |
d07ceecd | 69 | uint64_t nb_packets_per_stream); |
834978fd | 70 | int kernel_syscall_mask(int chan_fd, char **syscall_mask, uint32_t *nr_bits); |
d5a1b7aa | 71 | enum lttng_error_code kernel_rotate_session(struct ltt_session *session); |
bca212a2 | 72 | enum lttng_error_code kernel_clear_session(struct ltt_session *session); |
20fe2104 | 73 | |
335a95b7 | 74 | int init_kernel_workarounds(void); |
7d268848 | 75 | int kernel_supports_ring_buffer_snapshot_sample_positions(void); |
a40a503f | 76 | int kernel_supports_ring_buffer_packet_sequence_number(void); |
959e3c66 | 77 | int kernel_supports_event_notifiers(void); |
7d268848 MD |
78 | int init_kernel_tracer(void); |
79 | void cleanup_kernel_tracer(void); | |
80 | bool kernel_tracer_is_initialized(void); | |
335a95b7 | 81 | |
d2956687 JG |
82 | enum lttng_error_code kernel_create_channel_subdirectories( |
83 | const struct ltt_kernel_session *ksess); | |
84 | ||
352b58f5 JR |
85 | enum lttng_error_code kernel_create_event_notifier_group_notification_fd( |
86 | int *event_notifier_group_notification_fd); | |
87 | enum lttng_error_code kernel_destroy_event_notifier_group_notification_fd( | |
88 | int event_notifier_group_notification_fd); | |
89 | ||
90 | enum lttng_error_code kernel_register_event_notifier( | |
91 | struct lttng_trigger *trigger, | |
92 | const struct lttng_credentials *cmd_creds); | |
93 | enum lttng_error_code kernel_unregister_event_notifier( | |
94 | const struct lttng_trigger *trigger); | |
95 | ||
96 | int kernel_get_notification_fd(void); | |
97 | ||
20fe2104 | 98 | #endif /* _LTT_KERNEL_CTL_H */ |