trigger: implement trigger naming
[lttng-tools.git] / src / bin / lttng-sessiond / snapshot.h
index 91215272ac83f3316348c0c10ae098c6b26b5fbf..027b098c046cf9bfcb9a48c5f331deade0e635a9 100644 (file)
@@ -1,18 +1,8 @@
 /*
- * Copyright (C) 2013 David Goulet <dgoulet@efficios.com>
+ * Copyright (C) 2013 David Goulet <dgoulet@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.
+ * SPDX-License-Identifier: GPL-2.0-only
  *
- * 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 SNAPSHOT_H
 #include "consumer.h"
 
 struct consumer_output;
+struct ltt_session;
 
 struct snapshot_output {
        uint32_t id;
        uint64_t max_size;
+       /* Number of snapshot taken with that output. */
+       uint64_t nb_snapshot;
        char name[NAME_MAX];
        struct consumer_output *consumer;
        int kernel_sockets_copied;
        int ust_sockets_copied;
+       /*
+        * Contains the string with "<date>-<time>" for when the snapshot command
+        * is triggered. This is to make sure every streams will use the same time
+        * for the directory output.
+        */
+       char datetime[16];
 
        /* Indexed by ID. */
        struct lttng_ht_node_ulong node;
@@ -44,6 +43,11 @@ struct snapshot_output {
 struct snapshot {
        unsigned long next_output_id;
        size_t nb_output;
+       /*
+        * Number of snapshot taken for that object. This value is used with a
+        * temporary output of a snapshot record.
+        */
+       uint64_t nb_snapshot;
        struct lttng_ht *output_ht;
 };
 
@@ -59,11 +63,19 @@ void snapshot_add_output(struct snapshot *snapshot,
 /* Snapshot output object. */
 struct snapshot_output *snapshot_output_alloc(void);
 void snapshot_output_destroy(struct snapshot_output *obj);
-int snapshot_output_init(uint64_t max_size, const char *name,
+int snapshot_output_init(const struct ltt_session *session,
+               uint64_t max_size, const char *name,
                const char *ctrl_url, const char *data_url,
                struct consumer_output *consumer, struct snapshot_output *output,
                struct snapshot *snapshot);
+int snapshot_output_init_with_uri(const struct ltt_session *session,
+               uint64_t max_size, const char *name,
+               struct lttng_uri *uris, size_t nb_uri,
+               struct consumer_output *consumer, struct snapshot_output *output,
+               struct snapshot *snapshot);
 struct snapshot_output *snapshot_find_output_by_id(uint32_t id,
                struct snapshot *snapshot);
+struct snapshot_output *snapshot_find_output_by_name(const char *name,
+               struct snapshot *snapshot);
 
 #endif /* SNAPSHOT_H */
This page took 0.023827 seconds and 4 git commands to generate.