78a12a6c760b245cf9d2dae46abd2499576ce7ee
[lttng-tools.git] / src / bin / lttng-sessiond / tracker.h
1 /*
2 * Copyright (C) 2018 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 */
7
8 #ifndef _LTT_TRACKER_H
9 #define _LTT_TRACKER_H
10
11 #include <lttng/tracker.h>
12 #include <urcu.h>
13 #include <urcu/list.h>
14 #include <urcu/rculfhash.h>
15
16 enum lttng_tracker_list_state {
17 LTTNG_TRACK_ALL,
18 LTTNG_TRACK_NONE,
19 LTTNG_TRACK_LIST,
20 };
21
22 /* Tracker ID */
23 struct lttng_tracker_list_node {
24 struct lttng_tracker_id *id;
25
26 struct cds_list_head list_node;
27 struct cds_lfht_node ht_node;
28 struct rcu_head rcu_head;
29 };
30
31 struct lttng_tracker_list {
32 struct cds_list_head list_head;
33 /* Hash table for O(1) removal lookup. */
34 struct cds_lfht *ht;
35 enum lttng_tracker_list_state state;
36 };
37
38 struct lttng_tracker_list *lttng_tracker_list_create(void);
39 void lttng_tracker_list_destroy(struct lttng_tracker_list *tracker_list);
40
41 int lttng_tracker_list_add(struct lttng_tracker_list *tracker_list,
42 const struct lttng_tracker_id *id);
43 int lttng_tracker_list_remove(struct lttng_tracker_list *tracker_list,
44 const struct lttng_tracker_id *id);
45
46 int lttng_tracker_id_lookup_string(enum lttng_tracker_type tracker_type,
47 const struct lttng_tracker_id *id,
48 int *result);
49 int lttng_tracker_id_get_list(const struct lttng_tracker_list *tracker_list,
50 struct lttng_tracker_ids **_ids);
51 int lttng_tracker_id_set_list(struct lttng_tracker_list *tracker_list,
52 const struct lttng_tracker_ids *_ids);
53
54 #endif /* _LTT_TRACKER_H */
This page took 0.040978 seconds and 3 git commands to generate.