SoW-2019-0002: Dynamic Snapshot
[lttng-tools.git] / src / bin / lttng-sessiond / kernel.h
CommitLineData
20fe2104 1/*
ab5be9fa 2 * Copyright (C) 2011 David Goulet <david.goulet@polymtl.ca>
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
8c0faa1d 11#include "session.h"
6dc3064a 12#include "snapshot.h"
62499ad6 13#include "trace-kernel.h"
f34daff7 14
2ef84c95
DG
15/*
16 * Default size for the event list when kernel_list_events is called. This size
050349bb
DG
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.
2ef84c95 21 */
6725fe19 22#define KERNEL_EVENT_INIT_LIST_SIZE 64
55c9e7ca 23#define KERNEL_TRACKER_IDS_INIT_LIST_SIZE 64
2ef84c95 24
d65106b1 25int kernel_add_channel_context(struct ltt_kernel_channel *chan,
645328ae 26 struct ltt_kernel_context *ctx);
7d268848 27int kernel_create_session(struct ltt_session *session);
b082db07 28int kernel_create_channel(struct ltt_kernel_session *session,
fdd9eb17 29 struct lttng_channel *chan);
00a62084
MD
30int kernel_create_event(struct lttng_event *ev, struct ltt_kernel_channel *channel,
31 char *filter_expression, struct lttng_filter_bytecode *filter);
26cc6b4e 32int kernel_disable_channel(struct ltt_kernel_channel *chan);
19e70852
DG
33int kernel_disable_event(struct ltt_kernel_event *event);
34int kernel_enable_event(struct ltt_kernel_event *event);
d36b8583 35int kernel_enable_channel(struct ltt_kernel_channel *chan);
55c9e7ca
JR
36int kernel_track_id(enum lttng_tracker_type tracker_type,
37 struct ltt_kernel_session *session,
38 const struct lttng_tracker_id *id);
39int kernel_untrack_id(enum lttng_tracker_type tracker_type,
40 struct ltt_kernel_session *session,
41 const struct lttng_tracker_id *id);
a4b92340 42int kernel_open_metadata(struct ltt_kernel_session *session);
f3ed775e
DG
43int kernel_open_metadata_stream(struct ltt_kernel_session *session);
44int kernel_open_channel_stream(struct ltt_kernel_channel *channel);
45int kernel_flush_buffer(struct ltt_kernel_channel *channel);
46int kernel_metadata_flush_buffer(int fd);
8c0faa1d
DG
47int kernel_start_session(struct ltt_kernel_session *session);
48int kernel_stop_session(struct ltt_kernel_session *session);
7d268848
MD
49ssize_t kernel_list_events(struct lttng_event **event_list);
50void kernel_wait_quiescent(void);
51int kernel_validate_version(struct lttng_kernel_tracer_version *kernel_tracer_version,
88076e89 52 struct lttng_kernel_tracer_abi_version *kernel_tracer_abi_version);
2f77fc4b 53void kernel_destroy_session(struct ltt_kernel_session *ksess);
d070c424 54void kernel_free_session(struct ltt_kernel_session *ksess);
fb5f35b6 55void kernel_destroy_channel(struct ltt_kernel_channel *kchan);
fb9a95c4
JG
56enum lttng_error_code kernel_snapshot_record(
57 struct ltt_kernel_session *ksess,
348a81dc 58 const struct consumer_output *output, int wait,
d07ceecd 59 uint64_t nb_packets_per_stream);
834978fd 60int kernel_syscall_mask(int chan_fd, char **syscall_mask, uint32_t *nr_bits);
d5a1b7aa 61enum lttng_error_code kernel_rotate_session(struct ltt_session *session);
bca212a2 62enum lttng_error_code kernel_clear_session(struct ltt_session *session);
20fe2104 63
335a95b7 64int init_kernel_workarounds(void);
a7a533cd 65int kernel_list_tracker_ids(enum lttng_tracker_type tracker_type,
55c9e7ca 66 struct ltt_kernel_session *session,
a7a533cd 67 struct lttng_tracker_ids **ids);
7d268848 68int kernel_supports_ring_buffer_snapshot_sample_positions(void);
a40a503f 69int kernel_supports_ring_buffer_packet_sequence_number(void);
7d268848
MD
70int init_kernel_tracer(void);
71void cleanup_kernel_tracer(void);
72bool kernel_tracer_is_initialized(void);
335a95b7 73
d2956687
JG
74enum lttng_error_code kernel_create_channel_subdirectories(
75 const struct ltt_kernel_session *ksess);
76
1831ae68
FD
77enum lttng_error_code kernel_create_trigger_group_notification_fd(
78 int *trigger_group_notification_fd);
79enum lttng_error_code kernel_destroy_trigger_group_notification_fd(
80 int trigger_group_notification_fd);
81enum lttng_error_code kernel_update_tokens(void);
82int kernel_get_notification_fd(void);
83
20fe2104 84#endif /* _LTT_KERNEL_CTL_H */
This page took 0.121262 seconds and 5 git commands to generate.