Commit | Line | Data |
---|---|---|
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> |
999af9c1 JR |
12 | #include <lttng/channel.h> |
13 | #include <lttng/lttng-error.h> | |
14 | ||
15 | struct lttng_dynamic_buffer; | |
16 | struct lttng_buffer_view; | |
aa52c986 | 17 | |
8d7f6956 JG |
18 | struct lttng_channel_extended { |
19 | uint64_t discarded_events; | |
20 | uint64_t lost_packets; | |
e9404c27 | 21 | uint64_t monitor_timer_interval; |
491d1539 | 22 | int64_t blocking_timeout; |
8d7f6956 JG |
23 | } LTTNG_PACKED; |
24 | ||
999af9c1 JR |
25 | struct lttng_channel_comm { |
26 | /* Includes terminator `\0`. */ | |
27 | uint32_t name_len; | |
28 | uint8_t enabled; | |
29 | ||
30 | /* attr */ | |
31 | int8_t overwrite; | |
32 | uint64_t subbuf_size; | |
33 | uint64_t num_subbuf; | |
34 | uint32_t switch_timer_interval; | |
35 | uint32_t read_timer_interval; | |
36 | uint8_t output; | |
37 | uint64_t tracefile_size; | |
38 | uint64_t tracefile_count; | |
39 | uint32_t live_timer_interval; | |
40 | ||
41 | /* Extended struct */ | |
42 | uint64_t discarded_events; | |
43 | uint64_t lost_packets; | |
44 | uint64_t monitor_timer_interval; | |
45 | int64_t blocking_timeout; | |
46 | } LTTNG_PACKED; | |
47 | ||
48 | struct lttng_channel *lttng_channel_create_internal(void); | |
49 | ||
50 | struct lttng_channel *lttng_channel_copy(const struct lttng_channel *src); | |
51 | ||
52 | ssize_t lttng_channel_create_from_buffer(const struct lttng_buffer_view *view, | |
53 | struct lttng_channel **event); | |
54 | ||
55 | int lttng_channel_serialize(struct lttng_channel *channel, | |
56 | struct lttng_dynamic_buffer *buf); | |
57 | ||
58 | void lttng_channel_set_default_extended_attr(struct lttng_domain *domain, | |
59 | struct lttng_channel_extended *extended_attr); | |
60 | ||
61 | enum lttng_error_code lttng_channels_create_and_flatten_from_buffer( | |
62 | const struct lttng_buffer_view *view, | |
63 | unsigned int count, | |
64 | struct lttng_channel **channels); | |
65 | ||
8d7f6956 | 66 | #endif /* LTTNG_CHANNEL_INTERNAL_H */ |