Simplify error node

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: octal and hex string handling

Following C99:

Octal does not start by \o, but rather is in the form:

  \n \nn or \nnn

  where n is octal.

Hexadecimal is:

  \xH \xHH or \xHHH

  where H is hexadecimal.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Implement objstack for parser

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Use objstack for strings

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Use objstack to store nodes

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Remove unused gc field

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Use objstack for AST allocation

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: babeltrace-log timestamps should be in nsec

Those were in usec, and babeltrace expect nsec by default for default
clock.

Most of the work has been focused on LTTng and read-side lately,
therefore babeltrace-log went under the radar.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix kFreeBSD build

Use general error numbers available on kFreeBSD.

Reported-by: Petr Salinger <Petr.Salinger@seznam.cz>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Add backward ref from bt_stream_pos to bt_trace_descriptor

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Privatize struct bt_trace descriptor, move trace path

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Move bt_context to bt_trace_descriptor

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Move bt_handle to bt_trace_descriptor

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Move trace collection pointer to bt_trace_descriptor

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Remove unused stream_heap

Now moved used within iterator structure (by prior commit).

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Move clock to bt_trace_descriptor

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: ctf-text should link on libbabeltrace-ctf

Refs: #410

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: add missing error return when create_event_definitions fails

Also add more verbose error printout to help identifying the culprit of
metadata issues.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Add new option --clock-offset-ns

Add a new option --clock-offset-ns. It requires a parameter
that specifies a clock offset (in nanoseconds) that is added
to each timestamp.

This works exactly as the option --clock-offset, except that
the value is given in nanoseconds instead of full seconds.

The two options --clock-offset and --clock-offset-ns are
compatible with each other, and it's possible to give both.
For example, having the options

--clock-offset 2 --clock-offset-ns 1000000

means that 2.001 seconds is added to each timestamp.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: handling of empty streams

Fixes #518

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>