91215272ac83f3316348c0c10ae098c6b26b5fbf
[lttng-tools.git] / src / bin / lttng-sessiond / snapshot.h
1 /*
2 * Copyright (C) 2013 - David Goulet <dgoulet@efficios.com>
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License, version 2 only, as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc., 51
15 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16 */
17
18 #ifndef SNAPSHOT_H
19 #define SNAPSHOT_H
20
21 #include <limits.h>
22 #include <stdint.h>
23
24 #include <common/common.h>
25 #include <common/hashtable/hashtable.h>
26 #include <common/uri.h>
27
28 #include "consumer.h"
29
30 struct consumer_output;
31
32 struct snapshot_output {
33 uint32_t id;
34 uint64_t max_size;
35 char name[NAME_MAX];
36 struct consumer_output *consumer;
37 int kernel_sockets_copied;
38 int ust_sockets_copied;
39
40 /* Indexed by ID. */
41 struct lttng_ht_node_ulong node;
42 };
43
44 struct snapshot {
45 unsigned long next_output_id;
46 size_t nb_output;
47 struct lttng_ht *output_ht;
48 };
49
50 /* Snapshot object. */
51 struct snapshot *snapshot_alloc(void);
52 void snapshot_destroy(struct snapshot *obj);
53 int snapshot_init(struct snapshot *obj);
54 void snapshot_delete_output(struct snapshot *snapshot,
55 struct snapshot_output *output);
56 void snapshot_add_output(struct snapshot *snapshot,
57 struct snapshot_output *output);
58
59 /* Snapshot output object. */
60 struct snapshot_output *snapshot_output_alloc(void);
61 void snapshot_output_destroy(struct snapshot_output *obj);
62 int snapshot_output_init(uint64_t max_size, const char *name,
63 const char *ctrl_url, const char *data_url,
64 struct consumer_output *consumer, struct snapshot_output *output,
65 struct snapshot *snapshot);
66 struct snapshot_output *snapshot_find_output_by_id(uint32_t id,
67 struct snapshot *snapshot);
68
69 #endif /* SNAPSHOT_H */
This page took 0.029847 seconds and 3 git commands to generate.