Remove Babeltrace 1 files and reorganize the tree This is one of the patches that you won't easily forget. This patch removes the remaining legacy files, moving them if we still need them, and reorganizes the tree as such: * formats/ is removed * formats/ctf/ir/ is moved to lib/ctf-ir/ * formats/ctf/writer/ is moved to lib/ctf-writer/ * types/ is removed Because some of the CTF IR and CTF writer objects are so coupled, both components are in libbabeltrace now. The build system creates a symbolic link from libbabeltrace-ctf (where CTF writer used to reside) to libbabeltrace, so that `-lbabeltrace-ctf` still works for the current users of CTF writer. converter/babeltrace-log.c still exists, but it's not build as of this patch because it uses the legacy API. We need to change this to use CTF writer and add it to the Makefile again. Some debug info files are gone because they also use the legacy API. They are updated anyway as part of the upcoming debug info component class. The Python bindings are not covered by this patch: a subsequent patch should fix them at once. Some tests which used the legacy API are removed. The legacy include files are removed, except for include/babeltrace/ctf/event.h which could be included by CTF writer users. The file simply includes all the CTF writer header files now. The functions to serialize integer and floating point number fields are moved to lib/ctf-writer/serialize.c where a light `struct bt_ctf_stream_pos` exists along with a few helper functions for this renamed legacy object. The serialization functions use BT 2 objects now so that the dependency on the legacy API can be dropped. The serialization functions accept a native byte order parameter now. When a field type has a "native" byte order, the real (passed) native byte order must be used. This ensures that: * CTF IR objects do not need to propagate the trace's native byte order to all the contained field types. * Two references to the same field type which are part of two different trace objects can have a native byte order without causing byte order overwriting bugs. The CTF IR code is simplified with this change. Also the bt_ctf_trace_set_byte_order() function refuses the BT_CTF_BYTE_ORDER_NATIVE byte order. I also added internal inline functions to quickly access the parent of some CTF IR object without getting a new reference: * bt_ctf_event_borrow_event_class() * bt_ctf_event_class_borrow_stream_class() * bt_ctf_stream_class_borrow_trace() Since the CTF parser test in formats/ctf/metadata/ was a legacy tool, it's removed in this patch. It's not used anymore by test_ctf_writer (only the converter runs to validate the generated trace). Leaks are fixed in test_ctf_ir_ref and test_trace_listener. Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change behaviour of stream-intersection with multiple traces The stream-intersection currently results in the reading of the intersection of every stream, in every trace of a Trace Collection. Since reading a TraceCollection returns the union of its traces, the behaviour of this option is changed so that it returns the union of each trace's individual "active" section, that is the section for which all streams are active. Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Option to only show streams' intersection The --stream-intersection option allows showing only the events that fit in the intersection of all streams, thus filtering out the events for which only some streams have the time range info. This is achieved by using the packet header timestamp begin/end information available within each stream. Signed-off-by: Julien Desfossez <jdesfossez@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Compute discarded events in live We now save the indexes received in live in the two first elements of a packet index. This allows us to compute the number of discarded events. We only keep the packet index elements we need in live so we don't leak packet indexes when reading a live trace over many days (or longer). Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Improvement: Message from babeltrace concerning discarded events needs improvement New output example: [warning] Tracer discarded 18508 events between [13:07:22.210641404] and [13:07:22.210642166] in trace UUID 857bd6395891954ab9d3defb2aeb98f7, at path: "/home/compudj/lttng-traces/auto-20130323-130705/kernel", within stream id 0, at relative path: "channel0_1". You should consider recording a new trace with larger buffers or with fewer events enabled. Fixes #469 Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Add missing permission notice in each source file The permission notice was already present in the project mit-license.txt file (refered to by the README file), but we should add it to each file. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
API Fix: bt_ctf_iter_read_event_flags The new bt_ctf_iter_read_event_flags function behaves like bt_ctf_iter_read_event but takes a flag pointer. This flag is used by the trace reading code to inform the user if some events were discarded by the tracer in the current packet. The new bt_ctf_get_lost_events_count function allows the user to get the the number of events discarded immediately prior to the last event read. [ Edit by Mathieu Desnoyers: use enum instead of define for BT_ITER_FLAG_LOST_EVENTS. ] Signed-off-by: Julien Desfossez <jdesfossez@efficios.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
API Fix : missing list fields of event decl This patchs allows the user to list the fields (in all scopes) for each event declarations (so as soon as the trace is opened). It uses a lazy allocation, so the memory for storing the fields is only allocated if the users asks for the list and it is allocated per event. Signed-off-by: Julien Desfossez <julien.desfossez@efficios.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
fix/breakage API : replace bt_ctf_event Following the namespace cleanup, the bt_ctf_event structure is now a ctf_event_definition structure. Users of the API only have to do this substitution. Signed-off-by: Julien Desfossez <julien.desfossez@efficios.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
fix: move read event from iterator to event.h because it is CTF-specific. Need to move the format registry to libbabeltrace due to cross-dependencies between libbabeltrace and formats. Now, the format libs depend on libbabeltrace, never the opposite. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>