#include <common/common.h>
#include <common/sessiond-comm/sessiond-comm.h>
#include <common/relayd/relayd.h>
+#include <common/utils.h>
#include "channel.h"
#include "consumer.h"
* snapshot output.
*/
rcu_read_lock();
- cds_lfht_for_each_entry(consumer->socks->ht, &iter.iter, socket,
- node.node) {
+ cds_lfht_for_each_entry(snap_output->consumer->socks->ht, &iter.iter,
+ socket, node.node) {
ret = send_consumer_relayd_sockets(0, session->id,
snap_output->consumer, socket);
if (ret < 0) {
assert(output);
assert(session);
+ /* Get the datetime for the snapshot output directory. */
+ ret = utils_get_current_time_str("%Y%m%d-%H%M%S", output->datetime,
+ sizeof(output->datetime));
+ if (!ret) {
+ ret = -EINVAL;
+ goto error;
+ }
+
if (!output->kernel_sockets_copied) {
ret = consumer_copy_sockets(output->consumer, ksess->consumer);
if (ret < 0) {
assert(output);
assert(session);
+ /* Get the datetime for the snapshot output directory. */
+ ret = utils_get_current_time_str("%Y%m%d-%H%M%S", output->datetime,
+ sizeof(output->datetime));
+ if (!ret) {
+ ret = -EINVAL;
+ goto error;
+ }
+
if (!output->ust_sockets_copied) {
ret = consumer_copy_sockets(output->consumer, usess->consumer);
if (ret < 0) {
rcu_read_lock();
cds_lfht_for_each_entry(session->snapshot.output_ht->ht,
&iter.iter, sout, node.node) {
- ret = record_ust_snapshot(usess, tmp_sout, session, wait);
+ ret = record_ust_snapshot(usess, sout, session, wait);
if (ret < 0) {
rcu_read_unlock();
goto error;