Fix: rotation may never complete in per-PID buffering mode
[lttng-tools.git] / src / bin / lttng-sessiond / rotate.h
index 6dc3b7aa189768f9c47787f12e03ae031d0585ee..c7986c815dc671eaab660c342e40c05225cd3ff6 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2017 - Julien Desfossez <jdesfossez@efficios.com>
+ * Copyright (C) 2018 - Jérémie Galarneau <jeremie.galarneau@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
 #ifndef ROTATE_H
 #define ROTATE_H
 
-#include <lttng/notification/channel-internal.h>
 #include "rotation-thread.h"
+#include <stdint.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;
-extern struct lttng_notification_channel *rotate_notification_channel;
-
-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);
-
-int relay_rotate_pending(struct ltt_session *session, uint64_t chunk_id);
-
-/*
- * When we start the rotation of a channel, we add its information in
- * channel_pending_rotate_ht. This is called in the context of
- * thread_manage_client when the client asks for a rotation, in the context
- * of the sessiond_timer thread when periodic rotations are enabled and from
- * the rotation_thread when size-based rotations are enabled.
- */
-int rotate_add_channel_pending(uint64_t key, enum lttng_domain_type domain,
-               struct ltt_session *session);
+int rotate_add_pending_rotation(struct ltt_session *session, uint64_t chunk_id);
+int rename_completed_chunk(struct ltt_session *session, time_t ts);
 
 /*
  * Subscribe/unsubscribe the notification_channel from the rotation_thread to
This page took 0.0247 seconds and 5 git commands to generate.