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" | |
c9e313bc SM |
13 | #include "session.hpp" |
14 | #include "snapshot.hpp" | |
15 | #include "trace-kernel.hpp" | |
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 | |
28f23191 | 26 | int kernel_add_channel_context(struct ltt_kernel_channel *chan, struct ltt_kernel_context *ctx); |
7d268848 | 27 | int kernel_create_session(struct ltt_session *session); |
28f23191 JG |
28 | int kernel_create_channel(struct ltt_kernel_session *session, struct lttng_channel *chan); |
29 | int kernel_create_event(struct lttng_event *ev, | |
30 | struct ltt_kernel_channel *channel, | |
31 | char *filter_expression, | |
32 | 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); |
28f23191 JG |
37 | enum lttng_error_code |
38 | kernel_process_attr_tracker_set_tracking_policy(struct ltt_kernel_session *session, | |
39 | enum lttng_process_attr process_attr, | |
40 | enum lttng_tracking_policy policy); | |
41 | enum lttng_error_code | |
42 | kernel_process_attr_tracker_inclusion_set_add_value(struct ltt_kernel_session *session, | |
43 | enum lttng_process_attr process_attr, | |
44 | const struct process_attr_value *value); | |
45 | enum lttng_error_code | |
46 | kernel_process_attr_tracker_inclusion_set_remove_value(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 * | |
50 | kernel_get_process_attr_tracker(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 | 61 | int kernel_validate_version(struct lttng_kernel_abi_tracer_version *kernel_tracer_version, |
28f23191 | 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); |
28f23191 JG |
66 | enum lttng_error_code kernel_snapshot_record(struct ltt_kernel_session *ksess, |
67 | const struct consumer_output *output, | |
68 | uint64_t nb_packets_per_stream); | |
834978fd | 69 | int kernel_syscall_mask(int chan_fd, char **syscall_mask, uint32_t *nr_bits); |
d5a1b7aa | 70 | enum lttng_error_code kernel_rotate_session(struct ltt_session *session); |
bca212a2 | 71 | enum lttng_error_code kernel_clear_session(struct ltt_session *session); |
20fe2104 | 72 | |
335a95b7 | 73 | int init_kernel_workarounds(void); |
7d268848 | 74 | int kernel_supports_ring_buffer_snapshot_sample_positions(void); |
a40a503f | 75 | int kernel_supports_ring_buffer_packet_sequence_number(void); |
959e3c66 | 76 | int kernel_supports_event_notifiers(void); |
7d268848 MD |
77 | int init_kernel_tracer(void); |
78 | void cleanup_kernel_tracer(void); | |
79 | bool kernel_tracer_is_initialized(void); | |
335a95b7 | 80 | |
28f23191 | 81 | enum lttng_error_code kernel_create_channel_subdirectories(const struct ltt_kernel_session *ksess); |
d2956687 | 82 | |
28f23191 JG |
83 | enum lttng_error_code |
84 | kernel_create_event_notifier_group_notification_fd(int *event_notifier_group_notification_fd); | |
85 | enum lttng_error_code | |
86 | kernel_destroy_event_notifier_group_notification_fd(int event_notifier_group_notification_fd); | |
352b58f5 | 87 | |
28f23191 JG |
88 | enum lttng_error_code kernel_register_event_notifier(struct lttng_trigger *trigger, |
89 | const struct lttng_credentials *cmd_creds); | |
90 | enum lttng_error_code kernel_unregister_event_notifier(const struct lttng_trigger *trigger); | |
352b58f5 JR |
91 | |
92 | int kernel_get_notification_fd(void); | |
93 | ||
20fe2104 | 94 | #endif /* _LTT_KERNEL_CTL_H */ |