cli, plugins/ctf/fs-src: Make src.ctf.fs accept multiple root paths
A following patch will make it possible to process multiple traces that
share the same UUID as a single trace. One requirement is to be able to
do this event when passing multiple arguments, like:
babeltrace path1 path2 ...
With the current code, this instantiates two src.ctf.fs components, and
therefore makes it impossible to do this merging by UUID.
This patch therefore changes the design so that we only instantiate a
single src.ctf.fs component and pass an array with the paths.
We also need to make the trace-info query support receiving multiple
paths. One reason is that in general, we want trace-info queries to
support the same parameters as the components. A more pragmatic reason
is that it will need to do the same kind of UUID-merging anyway. I
therefore made the trace-info query re-use more of the code used by the
component to locate and create the ctf_fs_trace list. One difference
between the two usages is that in the case of the query, we don't want
to create IR streams or component ports. I moved those outside of the
shared code path and made the component do that as a separate step.
One notable change in babeltrace.c is in set_stream_intersections.
We previously extracted the "path" parameter from the component creation
parameter, to make the query parameters. Instead, we now directly pass
the component creation parameters to the query. The idea is the same as
above, we want to pass the same parameters to the trace-info query as
what will be used to create the component, since it might alter how the
traces will be open, and therefore the results.
So in practice the changes boil down to:
- babeltrace-cfg-cli-args.c: Make it possible to serialize bt_value of
type BT_VALUE_TYPE_ARRAY, so we can build the list of paths in a
bt_value array, then serialize it to send it to "babeltrace run".
Make it instantiate a single ctf component, this even simplifies the
code a little bit.
- fs.c: Accept "paths" parameter with a list of paths, rather than
"path" with a single path, iterate on that list to find traces and
create trace objects just as before. Separate creation or IR streams
and component ports from the ctf_fs_trace creation.
- query.c: Re-use more of fs.c's functions to locate and create
ctf_fs_trace objects.
There are no functional changes intended, except if you are the kind of
person to pass params by hand to the src.ctf.fs component.
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
This page took 0.02578 seconds and 4 git commands to generate.