5 * Copyright (C) 2018 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License, version 2 only,
9 * as published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #include <lttng/tracker.h>
23 #include <urcu/list.h>
24 #include <urcu/rculfhash.h>
26 enum lttng_tracker_list_state
{
33 struct lttng_tracker_list_node
{
34 struct lttng_tracker_id
*id
;
36 struct cds_list_head list_node
;
37 struct cds_lfht_node ht_node
;
38 struct rcu_head rcu_head
;
41 struct lttng_tracker_list
{
42 struct cds_list_head list_head
;
43 /* Hash table for O(1) removal lookup. */
45 enum lttng_tracker_list_state state
;
48 struct lttng_tracker_list
*lttng_tracker_list_create(void);
49 void lttng_tracker_list_destroy(struct lttng_tracker_list
*tracker_list
);
51 int lttng_tracker_list_add(struct lttng_tracker_list
*tracker_list
,
52 const struct lttng_tracker_id
*id
);
53 int lttng_tracker_list_remove(struct lttng_tracker_list
*tracker_list
,
54 const struct lttng_tracker_id
*id
);
56 int lttng_tracker_id_lookup_string(enum lttng_tracker_type tracker_type
,
57 const struct lttng_tracker_id
*id
,
59 int lttng_tracker_id_get_list(const struct lttng_tracker_list
*tracker_list
,
60 struct lttng_tracker_ids
**_ids
);
61 int lttng_tracker_id_set_list(struct lttng_tracker_list
*tracker_list
,
62 const struct lttng_tracker_ids
*_ids
);
64 #endif /* _LTT_TRACKER_H */