Fix: sessiond: erroneous error code returned on rotation failure
[lttng-tools.git] / src / bin / lttng-sessiond / tracker.h
index 7497abd0c8fd711281a8dd4a6298d3013d727d28..a45a250bbc4063bacad38d29713f542074a3ad13 100644 (file)
@@ -1,64 +1,46 @@
-#ifndef _LTT_TRACKER_H
-#define _LTT_TRACKER_H
-
 /*
- * Copyright (C) 2018 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2 only,
- * as published by the Free Software Foundation.
+ * Copyright (C) 2018 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ * Copyright (C) 2020 Jérémie Galarneau <jeremie.galarneau@efficios.com>
  *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * SPDX-License-Identifier: GPL-2.0-only
  *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#include <lttng/tracker.h>
-#include <urcu.h>
-#include <urcu/list.h>
-#include <urcu/rculfhash.h>
-
-enum lttng_tracker_list_state {
-       LTTNG_TRACK_ALL,
-       LTTNG_TRACK_NONE,
-       LTTNG_TRACK_LIST,
-};
+#ifndef _LTT_TRACKER_H
+#define _LTT_TRACKER_H
 
-/* Tracker ID */
-struct lttng_tracker_list_node {
-       struct lttng_tracker_id *id;
+#include <common/tracker.h>
+#include <lttng/tracker.h>
 
-       struct cds_list_head list_node;
-       struct cds_lfht_node ht_node;
-       struct rcu_head rcu_head;
-};
+struct process_attr_tracker;
 
-struct lttng_tracker_list {
-       struct cds_list_head list_head;
-       /* Hash table for O(1) removal lookup. */
-       struct cds_lfht *ht;
-       enum lttng_tracker_list_state state;
+enum process_attr_tracker_status {
+       PROCESS_ATTR_TRACKER_STATUS_OK,
+       PROCESS_ATTR_TRACKER_STATUS_ERROR,
+       PROCESS_ATTR_TRACKER_STATUS_EXISTS,
+       PROCESS_ATTR_TRACKER_STATUS_MISSING,
+       PROCESS_ATTR_TRACKER_STATUS_INVALID_TRACKING_POLICY,
 };
 
-struct lttng_tracker_list *lttng_tracker_list_create(void);
-void lttng_tracker_list_destroy(struct lttng_tracker_list *tracker_list);
-
-int lttng_tracker_list_add(struct lttng_tracker_list *tracker_list,
-               const struct lttng_tracker_id *id);
-int lttng_tracker_list_remove(struct lttng_tracker_list *tracker_list,
-               const struct lttng_tracker_id *id);
-
-int lttng_tracker_id_lookup_string(enum lttng_tracker_type tracker_type,
-               const struct lttng_tracker_id *id,
-               int *result);
-int lttng_tracker_id_get_list(const struct lttng_tracker_list *tracker_list,
-               struct lttng_tracker_ids **_ids);
-int lttng_tracker_id_set_list(struct lttng_tracker_list *tracker_list,
-               const struct lttng_tracker_ids *_ids);
+struct process_attr_tracker *process_attr_tracker_create(void);
+void process_attr_tracker_destroy(struct process_attr_tracker *tracker);
+
+enum lttng_tracking_policy process_attr_tracker_get_tracking_policy(
+               const struct process_attr_tracker *tracker);
+int process_attr_tracker_set_tracking_policy(
+               struct process_attr_tracker *tracker,
+               enum lttng_tracking_policy tracking_policy);
+
+enum process_attr_tracker_status process_attr_tracker_inclusion_set_add_value(
+               struct process_attr_tracker *tracker,
+               const struct process_attr_value *value);
+enum process_attr_tracker_status
+process_attr_tracker_inclusion_set_remove_value(
+               struct process_attr_tracker *tracker,
+               const struct process_attr_value *value);
+
+enum process_attr_tracker_status process_attr_tracker_get_inclusion_set(
+               const struct process_attr_tracker *tracker,
+               struct lttng_process_attr_values **values);
 
 #endif /* _LTT_TRACKER_H */
This page took 0.024804 seconds and 4 git commands to generate.