4f3bedea5c392d09f94e9fbdd43ab60583e4c9e1
[lttng-tools.git] / src / bin / lttng-sessiond / kernel.h
1 /*
2 * Copyright (C) 2011 David Goulet <david.goulet@polymtl.ca>
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 "session.h"
12 #include "snapshot.h"
13 #include "trace-kernel.h"
14
15 /*
16 * Default size for the event list when kernel_list_events is called. This size
17 * value is based on the initial LTTng 2.0 version set of tracepoints.
18 *
19 * This is NOT an upper bound because if the real event list size is bigger,
20 * dynamic reallocation is performed.
21 */
22 #define KERNEL_EVENT_INIT_LIST_SIZE 64
23 #define KERNEL_TRACKER_IDS_INIT_LIST_SIZE 64
24
25 int kernel_add_channel_context(struct ltt_kernel_channel *chan,
26 struct ltt_kernel_context *ctx);
27 int kernel_create_session(struct ltt_session *session);
28 int kernel_create_channel(struct ltt_kernel_session *session,
29 struct lttng_channel *chan);
30 int kernel_create_event(struct lttng_event *ev, struct ltt_kernel_channel *channel,
31 char *filter_expression, struct lttng_filter_bytecode *filter);
32 int kernel_disable_channel(struct ltt_kernel_channel *chan);
33 int kernel_disable_event(struct ltt_kernel_event *event);
34 int kernel_enable_event(struct ltt_kernel_event *event);
35 int kernel_enable_channel(struct ltt_kernel_channel *chan);
36 int kernel_track_id(enum lttng_tracker_type tracker_type,
37 struct ltt_kernel_session *session,
38 const struct lttng_tracker_id *id);
39 int kernel_untrack_id(enum lttng_tracker_type tracker_type,
40 struct ltt_kernel_session *session,
41 const struct lttng_tracker_id *id);
42 int kernel_open_metadata(struct ltt_kernel_session *session);
43 int kernel_open_metadata_stream(struct ltt_kernel_session *session);
44 int kernel_open_channel_stream(struct ltt_kernel_channel *channel);
45 int kernel_flush_buffer(struct ltt_kernel_channel *channel);
46 int kernel_metadata_flush_buffer(int fd);
47 int kernel_start_session(struct ltt_kernel_session *session);
48 int kernel_stop_session(struct ltt_kernel_session *session);
49 ssize_t kernel_list_events(struct lttng_event **event_list);
50 void kernel_wait_quiescent(void);
51 int kernel_validate_version(struct lttng_kernel_tracer_version *kernel_tracer_version,
52 struct lttng_kernel_tracer_abi_version *kernel_tracer_abi_version);
53 void kernel_destroy_session(struct ltt_kernel_session *ksess);
54 void kernel_free_session(struct ltt_kernel_session *ksess);
55 void kernel_destroy_channel(struct ltt_kernel_channel *kchan);
56 enum lttng_error_code kernel_snapshot_record(
57 struct ltt_kernel_session *ksess,
58 const struct consumer_output *output, int wait,
59 uint64_t nb_packets_per_stream);
60 int kernel_syscall_mask(int chan_fd, char **syscall_mask, uint32_t *nr_bits);
61 enum lttng_error_code kernel_rotate_session(struct ltt_session *session);
62 enum lttng_error_code kernel_clear_session(struct ltt_session *session);
63
64 int init_kernel_workarounds(void);
65 int kernel_list_tracker_ids(enum lttng_tracker_type tracker_type,
66 struct ltt_kernel_session *session,
67 struct lttng_tracker_ids **ids);
68 int kernel_supports_ring_buffer_snapshot_sample_positions(void);
69 int kernel_supports_ring_buffer_packet_sequence_number(void);
70 int init_kernel_tracer(void);
71 void cleanup_kernel_tracer(void);
72 bool kernel_tracer_is_initialized(void);
73
74 enum lttng_error_code kernel_create_channel_subdirectories(
75 const struct ltt_kernel_session *ksess);
76
77 #endif /* _LTT_KERNEL_CTL_H */
This page took 0.044151 seconds and 4 git commands to generate.