Sessiond rotation thread
[lttng-tools.git] / src / bin / lttng-sessiond / rotate.h
diff --git a/src/bin/lttng-sessiond/rotate.h b/src/bin/lttng-sessiond/rotate.h
new file mode 100644 (file)
index 0000000..b2f006f
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2017 - Julien Desfossez <jdesfossez@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.
+ *
+ * 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.
+ *
+ * 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.
+ */
+
+#ifndef ROTATE_H
+#define ROTATE_H
+
+#include "rotation-thread.h"
+
+/*
+ * Key in channel_pending_rotate_ht to map a channel to a
+ * struct rotation_channel_info.
+ */
+struct rotation_channel_key {
+       uint64_t key;
+       enum lttng_domain_type domain;
+};
+
+/*
+ * Added in channel_pending_rotate_ht everytime we start the rotation of a
+ * channel. The consumer notifies the rotation thread with the channel_key to
+ * inform a rotation is complete, we use that information to lookup the related
+ * session from channel_pending_rotate_ht.
+ */
+struct rotation_channel_info {
+       uint64_t session_id;
+       struct rotation_channel_key channel_key;
+       struct cds_lfht_node rotate_channels_ht_node;
+};
+
+extern struct cds_lfht *channel_pending_rotate_ht;
+
+unsigned long hash_channel_key(struct rotation_channel_key *key);
+
+/* session lock must be held by this function's caller. */
+int rename_complete_chunk(struct ltt_session *session, time_t ts);
+
+#endif /* ROTATE_H */
This page took 0.023987 seconds and 4 git commands to generate.