From 7233204da4165b440da676b9c0ea7c3593104868 Mon Sep 17 00:00:00 2001 From: Francis Deslauriers Date: Wed, 5 Jun 2019 23:54:47 -0400 Subject: [PATCH] Fix: src.ctf.fs: trace-info: fields no appended if range not set 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 Change-Id: I7e185bcf3b640a684fc7944423eeb8d337764b19 Reviewed-on: https://review.lttng.org/c/babeltrace/+/1386 Reviewed-by: Philippe Proulx Tested-by: jenkins --- plugins/ctf/fs-src/query.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/plugins/ctf/fs-src/query.c b/plugins/ctf/fs-src/query.c index 9e30aeab..c8ceb93c 100644 --- a/plugins/ctf/fs-src/query.c +++ b/plugins/ctf/fs-src/query.c @@ -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; - } } } -- 2.34.1