Fix: consumerd: consumed size miscomputed during statistics sampling
[lttng-tools.git] / src / bin / lttng-sessiond / kernel.hpp
CommitLineData
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 26int kernel_add_channel_context(struct ltt_kernel_channel *chan, struct ltt_kernel_context *ctx);
7d268848 27int kernel_create_session(struct ltt_session *session);
28f23191
JG
28int kernel_create_channel(struct ltt_kernel_session *session, struct lttng_channel *chan);
29int kernel_create_event(struct lttng_event *ev,
30 struct ltt_kernel_channel *channel,
31 char *filter_expression,
32 struct lttng_bytecode *filter);
26cc6b4e 33int kernel_disable_channel(struct ltt_kernel_channel *chan);
19e70852
DG
34int kernel_disable_event(struct ltt_kernel_event *event);
35int kernel_enable_event(struct ltt_kernel_event *event);
d36b8583 36int kernel_enable_channel(struct ltt_kernel_channel *chan);
28f23191
JG
37enum lttng_error_code
38kernel_process_attr_tracker_set_tracking_policy(struct ltt_kernel_session *session,
39 enum lttng_process_attr process_attr,
40 enum lttng_tracking_policy policy);
41enum lttng_error_code
42kernel_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);
45enum lttng_error_code
46kernel_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);
49const struct process_attr_tracker *
50kernel_get_process_attr_tracker(struct ltt_kernel_session *session,
51 enum lttng_process_attr process_attr);
a4b92340 52int kernel_open_metadata(struct ltt_kernel_session *session);
f3ed775e
DG
53int kernel_open_metadata_stream(struct ltt_kernel_session *session);
54int kernel_open_channel_stream(struct ltt_kernel_channel *channel);
55int kernel_flush_buffer(struct ltt_kernel_channel *channel);
56int kernel_metadata_flush_buffer(int fd);
8c0faa1d
DG
57int kernel_start_session(struct ltt_kernel_session *session);
58int kernel_stop_session(struct ltt_kernel_session *session);
7d268848 59ssize_t kernel_list_events(struct lttng_event **event_list);
0f4aa1a8 60void kernel_wait_quiescent();
b8e2fb80 61int 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 63void kernel_destroy_session(struct ltt_kernel_session *ksess);
d070c424 64void kernel_free_session(struct ltt_kernel_session *ksess);
fb5f35b6 65void kernel_destroy_channel(struct ltt_kernel_channel *kchan);
28f23191
JG
66enum 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 69int kernel_syscall_mask(int chan_fd, char **syscall_mask, uint32_t *nr_bits);
d5a1b7aa 70enum lttng_error_code kernel_rotate_session(struct ltt_session *session);
bca212a2 71enum lttng_error_code kernel_clear_session(struct ltt_session *session);
20fe2104 72
0f4aa1a8
JG
73int init_kernel_workarounds();
74int kernel_supports_ring_buffer_snapshot_sample_positions();
75int kernel_supports_ring_buffer_packet_sequence_number();
76int kernel_supports_event_notifiers();
77enum lttng_kernel_tracer_status get_kernel_tracer_status();
49cddecd 78void set_kernel_tracer_status_from_modules_ret(int);
0f4aa1a8
JG
79int init_kernel_tracer();
80void cleanup_kernel_tracer();
81bool kernel_tracer_is_initialized();
335a95b7 82
28f23191 83enum lttng_error_code kernel_create_channel_subdirectories(const struct ltt_kernel_session *ksess);
d2956687 84
28f23191
JG
85enum lttng_error_code
86kernel_create_event_notifier_group_notification_fd(int *event_notifier_group_notification_fd);
87enum lttng_error_code
88kernel_destroy_event_notifier_group_notification_fd(int event_notifier_group_notification_fd);
352b58f5 89
28f23191
JG
90enum lttng_error_code kernel_register_event_notifier(struct lttng_trigger *trigger,
91 const struct lttng_credentials *cmd_creds);
92enum lttng_error_code kernel_unregister_event_notifier(const struct lttng_trigger *trigger);
352b58f5 93
0f4aa1a8 94int kernel_get_notification_fd();
352b58f5 95
20fe2104 96#endif /* _LTT_KERNEL_CTL_H */
This page took 0.094679 seconds and 4 git commands to generate.