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/session.h>
22 #include <urcu/rculfhash.h>
23 #include <urcu/list.h>
25 enum lttng_tracker_list_state
{
32 struct lttng_tracker_list_node
{
33 struct lttng_tracker_id id
;
35 struct cds_list_head list_node
;
36 struct cds_lfht_node ht_node
;
37 struct rcu_head rcu_head
;
40 struct lttng_tracker_list
{
41 struct cds_list_head list_head
;
42 /* Hash table for O(1) removal lookup. */
44 enum lttng_tracker_list_state state
;
47 struct lttng_tracker_list
*lttng_tracker_list_create(void);
48 void lttng_tracker_list_destroy(struct lttng_tracker_list
*tracker_list
);
50 int lttng_tracker_list_add(struct lttng_tracker_list
*tracker_list
,
51 const struct lttng_tracker_id
*id
);
52 int lttng_tracker_list_remove(struct lttng_tracker_list
*tracker_list
,
53 const struct lttng_tracker_id
*id
);
55 int lttng_tracker_id_lookup_string(enum lttng_tracker_type tracker_type
,
56 const struct lttng_tracker_id
*id
,
58 ssize_t
lttng_tracker_id_get_list(struct lttng_tracker_list
*tracker_list
,
59 struct lttng_tracker_id
**_ids
);
60 int lttng_tracker_id_set_list(struct lttng_tracker_list
*tracker_list
,
61 struct lttng_tracker_id
*_ids
,
64 #endif /* _LTT_TRACKER_H */