.gitignore: add some more IDE / tools related file
[babeltrace.git] / src / plugins / ctf / fs-src / data-stream-file.cpp
index 73c896a99fed0eca8453362d95681de9492c9186..d2f7e102eb85734881aa90dbc4ca9e899632e835 100644 (file)
@@ -392,8 +392,7 @@ build_index_from_idx_file(struct ctf_fs_ds_file *ds_file, struct ctf_fs_ds_file_
     ctf_msg_iter_packet_properties props;
     int ret = ctf_msg_iter_get_packet_properties(msg_iter, &props);
     if (ret) {
-        BT_CPPLOGI_STR_SPEC(ds_file->logger,
-                            "Cannot read first packet's header and context fields.");
+        BT_CPPLOGI_SPEC(ds_file->logger, "Cannot read first packet's header and context fields.");
         return bt2s::nullopt;
     }
 
@@ -401,7 +400,7 @@ build_index_from_idx_file(struct ctf_fs_ds_file *ds_file, struct ctf_fs_ds_file_
         ctf_trace_class_borrow_stream_class_by_id(ds_file->metadata->tc, props.stream_class_id);
     BT_ASSERT(sc);
     if (!sc->default_clock_class) {
-        BT_CPPLOGI_STR_SPEC(ds_file->logger, "Cannot find stream class's default clock class.");
+        BT_CPPLOGI_SPEC(ds_file->logger, "Cannot find stream class's default clock class.");
         return bt2s::nullopt;
     }
 
@@ -448,8 +447,8 @@ build_index_from_idx_file(struct ctf_fs_ds_file *ds_file, struct ctf_fs_ds_file_
 
     const char *file_pos = g_mapped_file_get_contents(mapped_file.get()) + sizeof(*header);
     if (be32toh(header->magic) != CTF_INDEX_MAGIC) {
-        BT_CPPLOGW_STR_SPEC(ds_file->logger,
-                            "Invalid LTTng trace index: \"magic\" field validation failed");
+        BT_CPPLOGW_SPEC(ds_file->logger,
+                        "Invalid LTTng trace index: \"magic\" field validation failed");
         return bt2s::nullopt;
     }
 
@@ -506,11 +505,7 @@ build_index_from_idx_file(struct ctf_fs_ds_file *ds_file, struct ctf_fs_ds_file_
             return bt2s::nullopt;
         }
 
-        ctf_fs_ds_index_entry index_entry {offset, packetSize};
-
-        /* Set path to stream file. */
-        index_entry.path = file_info->path.c_str();
-
+        ctf_fs_ds_index_entry index_entry {file_info->path.c_str(), offset, packetSize};
         index_entry.timestamp_begin = be64toh(file_index->timestamp_begin);
         index_entry.timestamp_end = be64toh(file_index->timestamp_end);
         if (index_entry.timestamp_end < index_entry.timestamp_begin) {
@@ -526,7 +521,7 @@ build_index_from_idx_file(struct ctf_fs_ds_file *ds_file, struct ctf_fs_ds_file_
         ret = convert_cycles_to_ns(sc->default_clock_class, index_entry.timestamp_begin,
                                    &index_entry.timestamp_begin_ns);
         if (ret) {
-            BT_CPPLOGI_STR_SPEC(
+            BT_CPPLOGI_SPEC(
                 ds_file->logger,
                 "Failed to convert raw timestamp to nanoseconds since Epoch during index parsing");
             return bt2s::nullopt;
@@ -534,7 +529,7 @@ build_index_from_idx_file(struct ctf_fs_ds_file *ds_file, struct ctf_fs_ds_file_
         ret = convert_cycles_to_ns(sc->default_clock_class, index_entry.timestamp_end,
                                    &index_entry.timestamp_end_ns);
         if (ret) {
-            BT_CPPLOGI_STR_SPEC(
+            BT_CPPLOGI_SPEC(
                 ds_file->logger,
                 "Failed to convert raw timestamp to nanoseconds since Epoch during LTTng trace index parsing");
             return bt2s::nullopt;
@@ -578,8 +573,8 @@ static int init_index_entry(ctf_fs_ds_index_entry& entry, struct ctf_fs_ds_file
         int ret = convert_cycles_to_ns(sc->default_clock_class, props->snapshots.beginning_clock,
                                        &entry.timestamp_begin_ns);
         if (ret) {
-            BT_CPPLOGI_STR_SPEC(ds_file->logger,
-                                "Failed to convert raw timestamp to nanoseconds since Epoch.");
+            BT_CPPLOGI_SPEC(ds_file->logger,
+                            "Failed to convert raw timestamp to nanoseconds since Epoch.");
             return ret;
         }
     } else {
@@ -594,8 +589,8 @@ static int init_index_entry(ctf_fs_ds_index_entry& entry, struct ctf_fs_ds_file
         int ret = convert_cycles_to_ns(sc->default_clock_class, props->snapshots.end_clock,
                                        &entry.timestamp_end_ns);
         if (ret) {
-            BT_CPPLOGI_STR_SPEC(ds_file->logger,
-                                "Failed to convert raw timestamp to nanoseconds since Epoch.");
+            BT_CPPLOGI_SPEC(ds_file->logger,
+                            "Failed to convert raw timestamp to nanoseconds since Epoch.");
             return ret;
         }
     } else {
@@ -619,8 +614,8 @@ build_index_from_stream_file(struct ctf_fs_ds_file *ds_file, struct ctf_fs_ds_fi
         struct ctf_msg_iter_packet_properties props;
 
         if (currentPacketOffset.bytes() > ds_file->file->size) {
-            BT_CPPLOGE_STR_SPEC(ds_file->logger,
-                                "Unexpected current packet's offset (larger than file).");
+            BT_CPPLOGE_SPEC(ds_file->logger,
+                            "Unexpected current packet's offset (larger than file).");
             return bt2s::nullopt;
         } else if (currentPacketOffset.bytes() == ds_file->file->size) {
             /* No more data */
@@ -656,10 +651,7 @@ build_index_from_stream_file(struct ctf_fs_ds_file *ds_file, struct ctf_fs_ds_fi
             return bt2s::nullopt;
         }
 
-        ctf_fs_ds_index_entry index_entry {currentPacketOffset, currentPacketSize};
-
-        /* Set path to stream file. */
-        index_entry.path = file_info->path.c_str();
+        ctf_fs_ds_index_entry index_entry {file_info->path, currentPacketOffset, currentPacketSize};
 
         int ret = init_index_entry(index_entry, ds_file, &props);
         if (ret) {
@@ -729,23 +721,6 @@ ctf_fs_ds_file_info::UP ctf_fs_ds_file_info_create(const char *path, int64_t beg
     return ds_file_info;
 }
 
-ctf_fs_ds_file_group::UP ctf_fs_ds_file_group_create(struct ctf_fs_trace *ctf_fs_trace,
-                                                     struct ctf_stream_class *sc,
-                                                     uint64_t stream_instance_id,
-                                                     ctf_fs_ds_index index)
-{
-    ctf_fs_ds_file_group::UP ds_file_group {new ctf_fs_ds_file_group};
-
-    ds_file_group->index = std::move(index);
-
-    ds_file_group->stream_id = stream_instance_id;
-    BT_ASSERT(sc);
-    ds_file_group->sc = sc;
-    ds_file_group->ctf_fs_trace = ctf_fs_trace;
-
-    return ds_file_group;
-}
-
 void ctf_fs_ds_file_group::insert_ds_file_info_sorted(ctf_fs_ds_file_info::UP ds_file_info)
 {
     /* Find the spot where to insert this ds_file_info. */
This page took 0.027018 seconds and 4 git commands to generate.