When index files are available, this ensures we report the issue
properly before mapping a truncated packet rather than hitting a
SIGBUS.
For traces without index files, remove the check that was done at
index creation, and use the new check done when mapping the packet
instead. This ensures babeltrace can print stream data prior to the
truncated packet for this stream.
TODO: What is _not_ done in this patch is changing handling of truncated
packets: this should be treated as a warning rather than an error, so
processing of other streams continue.
This is needed to correctly handle SIGINT in live view mode. Without
handling this situation correctly, we can often see the following issue
upon SIGINT:
[error] Stream 18446744073709551615 is not declared in metadata.
1e8e8e2...
by
Julien Desfossez <email address hidden>
Fix: prevent calling adding the same trace recursively
add_one_trace may need to fetch new streams, which may lead to adding
new traces to the ctf_traces hashtable and recursively calling
add_one_trace. This is problematic because we cannot modify a hashtable
we are iterating on, and we cannot perform twice the add_one_trace for
the same trace.
This fix, ensures this situation cannot happen, by checking if the
number of traces changed during the iteration and by making sure a trace
is considered in_use as soon as we enter the add_one_trace function.
4a6f6ed...
by
Julien Desfossez <email address hidden>
Fix: Make sure we have all the metadata streams before adding new traces
The add_one_trace function needs to have a metadata stream for all the
known traces. If it does not, we could end up in situations where we
fetch new streams while adding a trace which causes a lot of problems.
Now we ensure we have all the metadata streams before adding the traces.
In the case where a stream is closed when we get its first index, we
still need a valid stream_id to assign it in the right stream (channel).
In this case, it is not useful afterwards, but the debug output has the
right value instead of -1ULL.