SoW-2020-0002: Trace Hit Counters: trigger error reporting integration
[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
159b042f
JG
11#include "lttng/lttng-error.h"
12#include "lttng/tracker.h"
8c0faa1d 13#include "session.h"
6dc3064a 14#include "snapshot.h"
62499ad6 15#include "trace-kernel.h"
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
d65106b1 26int kernel_add_channel_context(struct ltt_kernel_channel *chan,
645328ae 27 struct ltt_kernel_context *ctx);
7d268848 28int kernel_create_session(struct ltt_session *session);
b082db07 29int kernel_create_channel(struct ltt_kernel_session *session,
fdd9eb17 30 struct lttng_channel *chan);
00a62084 31int kernel_create_event(struct lttng_event *ev, struct ltt_kernel_channel *channel,
2463b787 32 char *filter_expression, 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);
159b042f 37enum lttng_error_code kernel_process_attr_tracker_set_tracking_policy(
55c9e7ca 38 struct ltt_kernel_session *session,
159b042f
JG
39 enum lttng_process_attr process_attr,
40 enum lttng_tracking_policy policy);
41enum lttng_error_code kernel_process_attr_tracker_inclusion_set_add_value(
55c9e7ca 42 struct ltt_kernel_session *session,
159b042f
JG
43 enum lttng_process_attr process_attr,
44 const struct process_attr_value *value);
45enum lttng_error_code kernel_process_attr_tracker_inclusion_set_remove_value(
46 struct ltt_kernel_session *session,
47 enum lttng_process_attr process_attr,
48 const struct process_attr_value *value);
49const struct process_attr_tracker *kernel_get_process_attr_tracker(
50 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
MD
59ssize_t kernel_list_events(struct lttng_event **event_list);
60void kernel_wait_quiescent(void);
61int kernel_validate_version(struct lttng_kernel_tracer_version *kernel_tracer_version,
88076e89 62 struct lttng_kernel_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);
fb9a95c4
JG
66enum lttng_error_code kernel_snapshot_record(
67 struct ltt_kernel_session *ksess,
348a81dc 68 const struct consumer_output *output, int wait,
d07ceecd 69 uint64_t nb_packets_per_stream);
834978fd 70int kernel_syscall_mask(int chan_fd, char **syscall_mask, uint32_t *nr_bits);
d5a1b7aa 71enum lttng_error_code kernel_rotate_session(struct ltt_session *session);
bca212a2 72enum lttng_error_code kernel_clear_session(struct ltt_session *session);
20fe2104 73
335a95b7 74int init_kernel_workarounds(void);
7d268848 75int kernel_supports_ring_buffer_snapshot_sample_positions(void);
a40a503f 76int kernel_supports_ring_buffer_packet_sequence_number(void);
7d268848
MD
77int init_kernel_tracer(void);
78void cleanup_kernel_tracer(void);
79bool kernel_tracer_is_initialized(void);
335a95b7 80
d2956687
JG
81enum lttng_error_code kernel_create_channel_subdirectories(
82 const struct ltt_kernel_session *ksess);
83
2463b787
JR
84enum lttng_error_code kernel_create_trigger_group_notification_fd(
85 int *trigger_group_notification_fd);
86enum lttng_error_code kernel_destroy_trigger_group_notification_fd(
87 int trigger_group_notification_fd);
88
89enum lttng_error_code kernel_register_trigger(struct lttng_trigger *trigger, const struct lttng_credentials *cmd_creds);
90enum lttng_error_code kernel_unregister_trigger(struct lttng_trigger *trigger);
91enum lttng_error_code kernel_create_trigger_group_error_counter(
92 int *trigger_group_error_counter_fd, size_t nb_bucket);
93enum lttng_error_code kernel_trigger_update_error_count(
94 struct lttng_trigger *trigger);
95
96int kernel_get_notification_fd(void);
97
20fe2104 98#endif /* _LTT_KERNEL_CTL_H */
This page took 0.128834 seconds and 5 git commands to generate.