Fix: liblttng-ctl comm: lttng_channel is not packed
[lttng-tools.git] / include / lttng / channel-internal.h
1 /*
2 * Copyright (C) 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-only
5 *
6 */
7
8 #ifndef LTTNG_CHANNEL_INTERNAL_H
9 #define LTTNG_CHANNEL_INTERNAL_H
10
11 #include <common/macros.h>
12 #include <lttng/channel.h>
13
14 struct lttng_dynamic_buffer;
15 struct lttng_buffer_view;
16
17 struct lttng_channel_extended {
18 uint64_t discarded_events;
19 uint64_t lost_packets;
20 uint64_t monitor_timer_interval;
21 int64_t blocking_timeout;
22 } LTTNG_PACKED;
23
24 struct 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
47 LTTNG_HIDDEN
48 struct lttng_channel *lttng_channel_create_internal(void);
49
50 LTTNG_HIDDEN
51 struct lttng_channel *lttng_channel_copy(const struct lttng_channel *src);
52
53 LTTNG_HIDDEN
54 ssize_t lttng_channel_create_from_buffer(const struct lttng_buffer_view *view,
55 struct lttng_channel **event);
56
57 LTTNG_HIDDEN
58 int lttng_channel_serialize(struct lttng_channel *channel,
59 struct lttng_dynamic_buffer *buf);
60
61 LTTNG_HIDDEN
62 void lttng_channel_set_default_extended_attr(struct lttng_domain *domain,
63 struct lttng_channel_extended *extended_attr);
64
65 LTTNG_HIDDEN
66 enum 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
71 #endif /* LTTNG_CHANNEL_INTERNAL_H */
This page took 0.03551 seconds and 6 git commands to generate.