sessiond: propagate the use of ltt_session::locked_ref
[lttng-tools.git] / src / bin / lttng-sessiond / snapshot.hpp
1 /*
2 * Copyright (C) 2013 David Goulet <dgoulet@efficios.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 */
7
8 #ifndef SNAPSHOT_H
9 #define SNAPSHOT_H
10
11 #include "consumer.hpp"
12
13 #include <common/common.hpp>
14 #include <common/hashtable/hashtable.hpp>
15 #include <common/uri.hpp>
16
17 #include <limits.h>
18 #include <stdint.h>
19
20 struct consumer_output;
21
22 struct snapshot_output {
23 uint32_t id;
24 uint64_t max_size;
25 /* Number of snapshot taken with that output. */
26 uint64_t nb_snapshot;
27 char name[NAME_MAX];
28 struct consumer_output *consumer;
29 int kernel_sockets_copied;
30 int ust_sockets_copied;
31 /*
32 * Contains the string with "<date>-<time>" for when the snapshot command
33 * is triggered. This is to make sure every streams will use the same time
34 * for the directory output.
35 */
36 char datetime[16];
37
38 /* Indexed by ID. */
39 struct lttng_ht_node_ulong node;
40 };
41
42 struct snapshot {
43 unsigned long next_output_id;
44 size_t nb_output;
45 /*
46 * Number of snapshot taken for that object. This value is used with a
47 * temporary output of a snapshot record.
48 */
49 uint64_t nb_snapshot;
50 struct lttng_ht *output_ht;
51 };
52
53 /* Snapshot object. */
54 struct snapshot *snapshot_alloc();
55 void snapshot_destroy(struct snapshot *obj);
56 int snapshot_init(struct snapshot *obj);
57 void snapshot_delete_output(struct snapshot *snapshot, struct snapshot_output *output);
58 void snapshot_add_output(struct snapshot *snapshot, struct snapshot_output *output);
59
60 /* Snapshot output object. */
61 struct snapshot_output *snapshot_output_alloc();
62 void snapshot_output_destroy(struct snapshot_output *obj);
63
64 struct snapshot_output *snapshot_find_output_by_id(uint32_t id, struct snapshot *snapshot);
65 struct snapshot_output *snapshot_find_output_by_name(const char *name, struct snapshot *snapshot);
66
67 #endif /* SNAPSHOT_H */
This page took 0.031245 seconds and 4 git commands to generate.