Fix: liblttng-ctl comm: lttng_channel is not packed
[lttng-tools.git] / include / lttng / channel-internal.h
CommitLineData
8d7f6956 1/*
ab5be9fa 2 * Copyright (C) 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
8d7f6956 3 *
ab5be9fa 4 * SPDX-License-Identifier: LGPL-2.1-only
8d7f6956 5 *
8d7f6956
JG
6 */
7
8#ifndef LTTNG_CHANNEL_INTERNAL_H
9#define LTTNG_CHANNEL_INTERNAL_H
10
aa52c986 11#include <common/macros.h>
33b9609d
JR
12#include <lttng/channel.h>
13
14struct lttng_dynamic_buffer;
15struct lttng_buffer_view;
aa52c986 16
8d7f6956
JG
17struct lttng_channel_extended {
18 uint64_t discarded_events;
19 uint64_t lost_packets;
e9404c27 20 uint64_t monitor_timer_interval;
491d1539 21 int64_t blocking_timeout;
8d7f6956
JG
22} LTTNG_PACKED;
23
33b9609d
JR
24struct lttng_channel_comm {
25 /* Includes terminator `\0`. */
26 uint32_t name_len;
27 uint8_t enabled;
28
29 /* attr */
30 int8_t overwrite;
31 uint64_t subbuf_size;
32 uint64_t num_subbuf;
33 uint32_t switch_timer_interval;
34 uint32_t read_timer_interval;
35 uint8_t output;
36 uint64_t tracefile_size;
37 uint64_t tracefile_count;
38 uint32_t live_timer_interval;
39
40 /* Extended struct */
41 uint64_t discarded_events;
42 uint64_t lost_packets;
43 uint64_t monitor_timer_interval;
44 int64_t blocking_timeout;
45} LTTNG_PACKED;
46
47LTTNG_HIDDEN
48struct lttng_channel *lttng_channel_create_internal(void);
49
50LTTNG_HIDDEN
51struct lttng_channel *lttng_channel_copy(const struct lttng_channel *src);
52
53LTTNG_HIDDEN
54ssize_t lttng_channel_create_from_buffer(const struct lttng_buffer_view *view,
55 struct lttng_channel **event);
56
57LTTNG_HIDDEN
58int lttng_channel_serialize(struct lttng_channel *channel,
59 struct lttng_dynamic_buffer *buf);
60
61LTTNG_HIDDEN
62void lttng_channel_set_default_extended_attr(struct lttng_domain *domain,
63 struct lttng_channel_extended *extended_attr);
64
65LTTNG_HIDDEN
66enum lttng_error_code lttng_channels_create_and_flatten_from_buffer(
67 const struct lttng_buffer_view *view,
68 unsigned int count,
69 struct lttng_channel **channels);
70
8d7f6956 71#endif /* LTTNG_CHANNEL_INTERNAL_H */
This page took 0.045677 seconds and 5 git commands to generate.