Remove fcntl wrapper
[lttng-tools.git] / src / bin / lttng-sessiond / kernel.hpp
1 /*
2 * Copyright (C) 2011 EfficiOS Inc.
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 */
7
8 #ifndef _LTT_KERNEL_CTL_H
9 #define _LTT_KERNEL_CTL_H
10
11 #include "lttng/lttng-error.h"
12 #include "lttng/tracker.h"
13 #include "session.hpp"
14 #include "snapshot.hpp"
15 #include "trace-kernel.hpp"
16
17 /*
18 * Default size for the event list when kernel_list_events is called. This size
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.
23 */
24 #define KERNEL_EVENT_INIT_LIST_SIZE 64
25
26 int kernel_add_channel_context(struct ltt_kernel_channel *chan, struct ltt_kernel_context *ctx);
27 int kernel_create_session(struct ltt_session *session);
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);
33 int kernel_disable_channel(struct ltt_kernel_channel *chan);
34 int kernel_disable_event(struct ltt_kernel_event *event);
35 int kernel_enable_event(struct ltt_kernel_event *event);
36 int kernel_enable_channel(struct ltt_kernel_channel *chan);
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);
52 int kernel_open_metadata(struct ltt_kernel_session *session);
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);
57 int kernel_start_session(struct ltt_kernel_session *session);
58 int kernel_stop_session(struct ltt_kernel_session *session);
59 ssize_t kernel_list_events(struct lttng_event **event_list);
60 void kernel_wait_quiescent(void);
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);
63 void kernel_destroy_session(struct ltt_kernel_session *ksess);
64 void kernel_free_session(struct ltt_kernel_session *ksess);
65 void kernel_destroy_channel(struct ltt_kernel_channel *kchan);
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);
69 int kernel_syscall_mask(int chan_fd, char **syscall_mask, uint32_t *nr_bits);
70 enum lttng_error_code kernel_rotate_session(struct ltt_session *session);
71 enum lttng_error_code kernel_clear_session(struct ltt_session *session);
72
73 int init_kernel_workarounds(void);
74 int kernel_supports_ring_buffer_snapshot_sample_positions(void);
75 int kernel_supports_ring_buffer_packet_sequence_number(void);
76 int kernel_supports_event_notifiers(void);
77 int init_kernel_tracer(void);
78 void cleanup_kernel_tracer(void);
79 bool kernel_tracer_is_initialized(void);
80
81 enum lttng_error_code kernel_create_channel_subdirectories(const struct ltt_kernel_session *ksess);
82
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);
87
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);
91
92 int kernel_get_notification_fd(void);
93
94 #endif /* _LTT_KERNEL_CTL_H */
This page took 0.031561 seconds and 4 git commands to generate.