Sort includes in C++ files
[babeltrace.git] / src / plugins / ctf / fs-sink / fs-sink-trace.hpp
CommitLineData
15fe47e0 1/*
0235b0db 2 * SPDX-License-Identifier: MIT
15fe47e0 3 *
0235b0db 4 * Copyright 2019 Philippe Proulx <pproulx@efficios.com>
15fe47e0
PP
5 */
6
0235b0db
MJ
7#ifndef BABELTRACE_PLUGIN_CTF_FS_SINK_FS_SINK_TRACE_H
8#define BABELTRACE_PLUGIN_CTF_FS_SINK_FS_SINK_TRACE_H
9
15fe47e0 10#include <glib.h>
15fe47e0
PP
11#include <stdint.h>
12
c802cacb
SM
13#include <babeltrace2/babeltrace.h>
14
15#include "common/macros.h"
16#include "ctfser/ctfser.h"
17
087cd0f5 18#include "fs-sink-ctf-meta.hpp"
15fe47e0
PP
19
20struct fs_sink_comp;
21
4164020e
SM
22struct fs_sink_trace
23{
24 bt_logging_level log_level;
25 struct fs_sink_comp *fs_sink;
26
27 /* Owned by this */
28 struct fs_sink_ctf_trace *trace;
29
30 /*
31 * Weak reference: this object does not own it, and `trace`
32 * above does not own its trace IR trace and trace class either.
33 * Instead, we add a "trace destruction" listener (in
34 * create_trace()) so that this object gets destroyed when the
35 * trace object is destroyed.
36 *
37 * Otherwise (with a strong reference), we would keep this trace
38 * object alive until the upstream message iterator ends. This
39 * could "leak" resources (memory, file descriptors) associated
40 * to traces and streams which otherwise would not exist.
41 */
42 const bt_trace *ir_trace;
43
44 bt_listener_id ir_trace_destruction_listener_id;
45
46 /* Trace's directory */
47 GString *path;
48
49 /* `metadata` file path */
50 GString *metadata_path;
51
52 /*
53 * Hash table of `const bt_stream *` (weak) to
54 * `struct fs_sink_stream *` (owned by hash table).
55 */
56 GHashTable *streams;
15fe47e0
PP
57};
58
4164020e 59struct fs_sink_trace *fs_sink_trace_create(struct fs_sink_comp *fs_sink, const bt_trace *ir_trace);
15fe47e0 60
15fe47e0
PP
61void fs_sink_trace_destroy(struct fs_sink_trace *trace);
62
63#endif /* BABELTRACE_PLUGIN_CTF_FS_SINK_FS_SINK_TRACE_H */
This page took 0.075169 seconds and 4 git commands to generate.