Fix: src.ctf.fs: trace-info: fields no appended if range not set
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Thu, 6 Jun 2019 03:54:47 +0000 (23:54 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 6 Jun 2019 21:20:55 +0000 (17:20 -0400)
Issue
=====
If the stream range is not set, the entire `if` clause is skipped and
the `paths`, `stream-id`, and `port-name` are not returned by the query
for that stream.

Solution
========
Append the value of this file group info even if the stream range is not
set.

Drawbacks
=========
None.

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Change-Id: I7e185bcf3b640a684fc7944423eeb8d337764b19
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1386
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins
plugins/ctf/fs-src/query.c

index 9e30aeab57848f89fc692196c65d7b780201d67a..c8ceb93c81e92d34b96d89f6e2f4de5a0cf51899 100644 (file)
@@ -415,6 +415,12 @@ int populate_trace_info(const struct ctf_fs_trace *trace, bt_value *trace_info)
                        goto end;
                }
 
+               status = bt_value_array_append_element(file_groups, group_info);
+               bt_value_put_ref(group_info);
+               if (status != BT_VALUE_STATUS_OK) {
+                       goto end;
+               }
+
                if (group_range.set) {
                        trace_range.begin_ns = min(trace_range.begin_ns,
                                        group_range.begin_ns);
@@ -427,13 +433,6 @@ int populate_trace_info(const struct ctf_fs_trace *trace, bt_value *trace_info)
                        trace_intersection.end_ns = min(trace_intersection.end_ns,
                                        group_range.end_ns);
                        trace_intersection.set = true;
-                       status = bt_value_array_append_element(
-                               file_groups,
-                               group_info);
-                       bt_value_put_ref(group_info);
-                       if (status != BT_VALUE_STATUS_OK) {
-                               goto end;
-                       }
                }
        }
 
This page took 0.0258 seconds and 4 git commands to generate.