summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
235f9fd)
Change-Id: I2df309d73c7a1b987e4d25c63251e13bf47a38a3
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8258
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12296
bt_stream_class *ds_file_stream_class;
bt_stream *stream = NULL;
bt_stream_class *ds_file_stream_class;
bt_stream *stream = NULL;
- ds_file_stream_class = bt_stream_borrow_class(ds_file->stream);
+ ds_file_stream_class = ds_file->stream->cls().libObjPtr();
if (stream_class != ds_file_stream_class) {
/*
if (stream_class != ds_file_stream_class) {
/*
- stream = ds_file->stream;
+ stream = ds_file->stream->libObjPtr();
ctf_fs_ds_file_destroy(data->file);
/* Create the new file. */
ctf_fs_ds_file_destroy(data->file);
/* Create the new file. */
- data->file = ctf_fs_ds_file_create(data->ds_file_group->ctf_fs_trace,
- data->ds_file_group->stream->libObjPtr(),
- index_entry->path, data->logger);
+ data->file =
+ ctf_fs_ds_file_create(data->ds_file_group->ctf_fs_trace, data->ds_file_group->stream,
+ index_entry->path, data->logger);
if (!data->file) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(data->logger, "failed to create ctf_fs_ds_file.");
status = CTF_MSG_ITER_MEDIUM_STATUS_ERROR;
if (!data->file) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(data->logger, "failed to create ctf_fs_ds_file.");
status = CTF_MSG_ITER_MEDIUM_STATUS_ERROR;
-struct ctf_fs_ds_file *ctf_fs_ds_file_create(struct ctf_fs_trace *ctf_fs_trace, bt_stream *stream,
- const char *path, const bt2c::Logger& parentLogger)
+struct ctf_fs_ds_file *ctf_fs_ds_file_create(struct ctf_fs_trace *ctf_fs_trace,
+ bt2::Stream::Shared stream, const char *path,
+ const bt2c::Logger& parentLogger)
{
int ret;
size_t offset_align;
{
int ret;
size_t offset_align;
- ds_file->stream = stream;
- bt_stream_get_ref(ds_file->stream);
+ ds_file->stream = std::move(stream);
ds_file->metadata = ctf_fs_trace->metadata;
g_string_assign(ds_file->file->path, path);
ret = ctf_fs_file_open(ds_file->file, "rb");
ds_file->metadata = ctf_fs_trace->metadata;
g_string_assign(ds_file->file->path, path);
ret = ctf_fs_file_open(ds_file->file, "rb");
- bt_stream_put_ref(ds_file->stream);
(void) ds_file_munmap(ds_file);
if (ds_file->file) {
(void) ds_file_munmap(ds_file);
if (ds_file->file) {
/* Owned by this */
struct ctf_fs_file *file = nullptr;
/* Owned by this */
struct ctf_fs_file *file = nullptr;
- /* Owned by this */
- bt_stream *stream = nullptr;
+ bt2::Stream::Shared stream;
void *mmap_addr = nullptr;
void *mmap_addr = nullptr;
ctf_fs_ds_index::UP index;
};
ctf_fs_ds_index::UP index;
};
-struct ctf_fs_ds_file *ctf_fs_ds_file_create(struct ctf_fs_trace *ctf_fs_trace, bt_stream *stream,
+struct ctf_fs_ds_file *ctf_fs_ds_file_create(ctf_fs_trace *ctf_fs_trace, bt2::Stream::Shared stream,
const char *path, const bt2c::Logger& logger);
void ctf_fs_ds_file_destroy(struct ctf_fs_ds_file *stream);
const char *path, const bt2c::Logger& logger);
void ctf_fs_ds_file_destroy(struct ctf_fs_ds_file *stream);
* Create a temporary ds_file to read some properties about the data
* stream file.
*/
* Create a temporary ds_file to read some properties about the data
* stream file.
*/
- ds_file = ctf_fs_ds_file_create(ctf_fs_trace, NULL, path, ctf_fs_trace->logger);
+ ds_file =
+ ctf_fs_ds_file_create(ctf_fs_trace, bt2::Stream::Shared {}, path, ctf_fs_trace->logger);
if (!ds_file) {
goto error;
}
if (!ds_file) {
goto error;
}
BT_ASSERT(index_entry);
BT_ASSERT(index_entry->path);
BT_ASSERT(index_entry);
BT_ASSERT(index_entry->path);
- ds_file = ctf_fs_ds_file_create(ctf_fs_trace, NULL, index_entry->path, ctf_fs_trace->logger);
+ ds_file = ctf_fs_ds_file_create(ctf_fs_trace, bt2::Stream::Shared {}, index_entry->path,
+ ctf_fs_trace->logger);
if (!ds_file) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(ctf_fs_trace->logger, "Failed to create a ctf_fs_ds_file");
ret = -1;
if (!ds_file) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(ctf_fs_trace->logger, "Failed to create a ctf_fs_ds_file");
ret = -1;