Commit | Line | Data |
---|---|---|
8abe313a | 1 | /* |
ab5be9fa | 2 | * Copyright (C) 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com> |
8abe313a | 3 | * |
ab5be9fa | 4 | * SPDX-License-Identifier: GPL-2.0-only |
8abe313a | 5 | * |
8abe313a JG |
6 | */ |
7 | ||
8 | #ifndef NOTIFICATION_THREAD_INTERNAL_H | |
9 | #define NOTIFICATION_THREAD_INTERNAL_H | |
10 | ||
11 | #include <lttng/ref-internal.h> | |
12 | #include <urcu/rculfhash.h> | |
13 | #include <unistd.h> | |
14 | ||
15 | struct channel_key { | |
16 | uint64_t key; | |
17 | enum lttng_domain_type domain; | |
18 | }; | |
19 | ||
20 | struct session_info { | |
21 | struct lttng_ref ref; | |
22 | char *name; | |
23 | uid_t uid; | |
24 | gid_t gid; | |
25 | /* | |
c7283958 | 26 | * Hashtable containing back-refs (weak) to all channels in this session. |
8abe313a JG |
27 | * The hashtable's key is a hash of (struct channel_key) and |
28 | * the value is of type (struct channel_info *). | |
29 | */ | |
30 | struct cds_lfht *channel_infos_ht; | |
ea9a44f0 | 31 | struct lttng_session_trigger_list *trigger_list; |
8abe313a JG |
32 | /* Node in the notification thread state's sessions_ht. */ |
33 | struct cds_lfht_node sessions_ht_node; | |
1eee26c5 JG |
34 | /* |
35 | * Weak reference to the thread state's sessions_ht. Used for removal on | |
36 | * destruction. | |
37 | */ | |
38 | struct cds_lfht *sessions_ht; | |
e8360425 | 39 | uint64_t consumed_data_size; |
51eab943 JG |
40 | struct { |
41 | /* Whether a rotation is ongoing for this session. */ | |
42 | bool ongoing; | |
43 | /* Identifier of the currently ongoing rotation. */ | |
44 | uint64_t id; | |
45 | } rotation; | |
83b934ad MD |
46 | /* call_rcu delayed reclaim. */ |
47 | struct rcu_head rcu_node; | |
8abe313a JG |
48 | }; |
49 | ||
50 | struct channel_info { | |
51 | struct channel_key key; | |
52 | char *name; | |
53 | uint64_t capacity; | |
54 | /* | |
55 | * A channel info holds a reference (lttng_ref) on session_info. | |
56 | * session_info, in return, holds a weak reference to the channel. | |
57 | */ | |
58 | struct session_info *session_info; | |
59 | /* Node in the notification thread state's channels_ht. */ | |
60 | struct cds_lfht_node channels_ht_node; | |
61 | /* Node in the session_info's channels_ht. */ | |
62 | struct cds_lfht_node session_info_channels_ht_node; | |
83b934ad MD |
63 | /* call_rcu delayed reclaim. */ |
64 | struct rcu_head rcu_node; | |
8abe313a JG |
65 | }; |
66 | ||
67 | #endif /* NOTIFICATION_THREAD_INTERNAL_H */ |