babeltrace.git
6 years agoDecouple component class from plugin subsystem, remove component factory
Philippe Proulx [Wed, 18 Jan 2017 18:30:07 +0000 (13:30 -0500)] 
Decouple component class from plugin subsystem, remove component factory

This is a refactoring of the component class and plugin subsystems of
Babeltrace 2. There's not much new code, it's mostly moved from one
file to another and some functions are renamed.

The goal of this patch is to decouple the component class objects from
plugin objects, that is, remove the dependency from the component class
to the plugin. This reference is not necessary, as component classes
can be provided by many sources, a plugin being one of them. A similar
plugin subsystem could be implemented outside of the Babeltrace library
with plugin-agnostic component class objects.

Also the component factory concept is completely removed. At the end
of this refactoring, it's nothing more than a hash table, so the name
is bad, and the object itself is just a very basic util.

Summary of changes:

* You can create a bt_component_class object manually with
  bt_component_class_create(). The function accepts the same parameters
  as before, except for a plugin reference.

* Internal code can use bt_component_class_add_destroy_listener() to add
  a custom destroy listener to a component class. Destroy listeners are
  called in reverse order just before the component class is destroyed
  when its last reference is dropped.

  This is needed to implement the plugin subsystem. It could be made
  public eventually to allow a custom component class provider system
  similar to the Babeltrace plugin subsystem. It could be generalized to
  bt_object_add_destroy_listener() or bt_add_destroy_listener().

* bt_component_class_get_plugin() is removed.

* There are three functions to create a bt_plugin object (in
  `babeltrace/plugin/plugin.h`):

  * bt_plugin_create_from_file(): Accepts a path and creates a plugin
    object from this single file. This must be a `.so` or `.la` file for
    the moment, but eventually we can support other plugins like Python
    plugins `.py`, Windows DLLs `.dll`, etc.

  * bt_plugin_create_all_from_dir(): Traverses a directory, optionally
    recursively, and creates one plugin object for each shared library
    found. Errors are ignored in this function because it's possible
    that a shared library in this directoy is not a Babeltrace plugin
    and we still want to continue the search.

    The return value is a NULL-terminated array of bt_plugin objects
    which the caller must free. Each plugin object in this array has its
    reference count set to 1.

  * bt_plugin_create_all_from_static(): Loads all the plugins found in
    the static sections of the Babeltrace binary. The return value has
    the same format as with bt_plugin_create_all_from_dir().

  There is no way to create an "empty", fresh bt_plugin object. It's
  always created from an existing file in the end.

* A bt_plugin object is a simple provider of component classes. Once
  it's created with one of the three functions above, you can access its
  global properties (name, license, description, etc.), as well as its
  component classes with bt_plugin_get_component_class_count(),
  bt_plugin_get_component_class(), and
  bt_plugin_get_component_class_by_name_and_type().

  The initialization function of a plugin can add new component classes
  to a bt_plugin object (passed as a parameter) thanks to the new
  bt_plugin_add_component_class() function. This function is exclusive
  to a plugin's initialization stage: once the initialization is done,
  the plugin is marked as frozen, and you cannot call
  bt_plugin_add_component_class() again on this plugin. This ensures
  that all the contained component classes were created by the plugin's
  code itself.

  There's a mechanism which involves a global hash table of
  component class adresses to shared library handles and a custom
  component class destroy listener to ensure that, even if a bt_plugin
  object is destroyed (reference count falls to zero), its associated
  shared library is not closed until all its component classes are
  also destroyed. See plugin.c:89 for more details.

* All the headers related to components, component classes, and
  notifications are moved to `babeltrace/component`. Plugin-specific
  headers are in `babeltrace/plugin`.

* Plugin development macros are in `babeltrace/plugin/plugin-dev.h`
  (instead of `plugin-macros.h`). This is the header that any plugin's
  main source file must include.

  * Two new function typedefs in `plugin-dev.h`:

    * bt_plugin_init_func: plugin's initialization function which
      accepts a plugin object to which to add component classes.

      You can set such a function with BT_PLUGIN_INIT().

    * bt_plugin_exit_func: plugin's exit function, if anything global to
      the plugin must be freed/released.

      This is not called when the bt_plugin object is destroyed: because
      component classes could still be alive when this happens, it's
      called just before the shared library is closed (when it is
      guaranteed that no user code found in this plugin will be called
      in the future of this process).

      You can set such a function with BT_PLUGIN_EXIT().

  * The BT_PLUGIN_COMPONENT_CLASS_*_ENTRY() macros create a component
    class of the associated type with bt_component_class_create(), and
    add it to the plugin object with bt_plugin_add_component_class().

    You can also do this manually in a custom initialization function.
    When you use BT_PLUGIN_COMPONENT_CLASSES_BEGIN and
    BT_PLUGIN_COMPONENT_CLASSES_END, BT_PLUGIN_INIT() and
    BT_PLUGIN_EXIT() (no-op exit function) are automatically used.

* Everything found in `babeltrace/plugin/plugin-system.h` is moved to
  the appropriate headers, depending on the types of the objects.

* Plugins, tests, and internal code are updated to use the new macros
  and header files.

* The converter is updated to use the updated subsystems instead of
  relying on a component factory.

  A global GLib pointer array is used to keep the currently loaded
  plugins. This is used instead of the component factory. When a new
  plugin is found, we check in this array if it was already added (same
  name) from another file or statically before adding it.

  The static find_plugin() and find_component_class() are the equivalent
  of the component factory interface.

  print_component_classes_found() also prints the number of loaded
  plugins.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoref.h: doc: fix typo
Philippe Proulx [Thu, 26 Jan 2017 17:32:22 +0000 (12:32 -0500)] 
ref.h: doc: fix typo

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoWriter: don't allow more than one packet without packet context
Jérémie Galarneau [Fri, 27 Jan 2017 05:41:39 +0000 (00:41 -0500)] 
Writer: don't allow more than one packet without packet context

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoTests writer: write a trace defining no packet context
Jérémie Galarneau [Fri, 27 Jan 2017 04:15:33 +0000 (23:15 -0500)] 
Tests writer: write a trace defining no packet context

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoWriter: minimize packet padding
Jérémie Galarneau [Fri, 27 Jan 2017 04:19:40 +0000 (23:19 -0500)] 
Writer: minimize packet padding

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoWriter: support traces defining no packet contexts
Jérémie Galarneau [Fri, 27 Jan 2017 04:18:19 +0000 (23:18 -0500)] 
Writer: support traces defining no packet contexts

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoUpdate test_ctf_writer.c header
Jérémie Galarneau [Thu, 26 Jan 2017 19:22:18 +0000 (14:22 -0500)] 
Update test_ctf_writer.c header

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix text plug-in: missing function name change
Jérémie Galarneau [Thu, 26 Jan 2017 17:00:21 +0000 (12:00 -0500)] 
Fix text plug-in: missing function name change

bt_ctf_field_type_enumeration_mapping_iterator_get_name was removed
and replaced by the bt_ctf_field_type_enumeration_mapping_iterator_get_signed
and bt_ctf_field_type_enumeration_mapping_iterator_get_unsigned
functions

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoAPI doc: document include files and how to build
Philippe Proulx [Wed, 25 Jan 2017 19:35:09 +0000 (14:35 -0500)] 
API doc: document include files and how to build

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoref.h, values.h: doc: add #include in description
Philippe Proulx [Wed, 25 Jan 2017 19:08:17 +0000 (14:08 -0500)] 
ref.h, values.h: doc: add #include in description

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoAPI doc: update main-page.dox
Philippe Proulx [Wed, 25 Jan 2017 08:34:15 +0000 (03:34 -0500)] 
API doc: update main-page.dox

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoAPI doc: add more details about reference counting
Philippe Proulx [Wed, 25 Jan 2017 08:18:14 +0000 (03:18 -0500)] 
API doc: add more details about reference counting

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agovalues.h: doc: rephrase map foreach callback ref
Philippe Proulx [Wed, 25 Jan 2017 07:37:54 +0000 (02:37 -0500)] 
values.h: doc: rephrase map foreach callback ref

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix API doc's content and style for enum. FT mapping iterator
Philippe Proulx [Wed, 25 Jan 2017 01:11:53 +0000 (20:11 -0500)] 
Fix API doc's content and style for enum. FT mapping iterator

Also, remove bt_ctf_field_type_enumeration_mapping_iterator_get_name(),
since you can achieve the same with
bt_ctf_field_type_enumeration_mapping_iterator_get_signed() or
bt_ctf_field_type_enumeration_mapping_iterator_get_unsigned() with the
two last parameters set to NULL.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix: bt_config_init_from_args has no ownership of cfg
Jérémie Galarneau [Thu, 26 Jan 2017 01:19:49 +0000 (20:19 -0500)] 
Fix: bt_config_init_from_args has no ownership of cfg

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix: prepend to $program_transform_name instead overriding it
Michael Jeanson [Mon, 16 Jan 2017 22:34:34 +0000 (17:34 -0500)] 
Fix: prepend to $program_transform_name instead overriding it

This makes the configure options program-prefix and program-suffix work
as well as the renaming of babeltrace.bin to babeltrace at install time.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoDocs: document enumeration mapping iterator API
Jérémie Galarneau [Tue, 24 Jan 2017 04:41:18 +0000 (23:41 -0500)] 
Docs: document enumeration mapping iterator API

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoDocs: add documentation for bt_ctf_field_type_enumeration_find_mappings*
Jérémie Galarneau [Tue, 24 Jan 2017 02:31:05 +0000 (21:31 -0500)] 
Docs: add documentation for bt_ctf_field_type_enumeration_find_mappings*

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoAdd missing bt_ctf_field_type_enumeration_mapping_iterator declaration
Jérémie Galarneau [Tue, 24 Jan 2017 02:30:28 +0000 (21:30 -0500)] 
Add missing bt_ctf_field_type_enumeration_mapping_iterator declaration

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoRemove bt_ctf_field_type_enumeration_get_mapping_name
Jérémie Galarneau [Tue, 24 Jan 2017 02:30:06 +0000 (21:30 -0500)] 
Remove bt_ctf_field_type_enumeration_get_mapping_name

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoModify bt_ctf_field_enumeration_get_single_mapping to return iterator
Jérémie Galarneau [Tue, 24 Jan 2017 01:23:28 +0000 (20:23 -0500)] 
Modify bt_ctf_field_enumeration_get_single_mapping to return iterator

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix: memory leak when using mapping iterator
Jérémie Galarneau [Mon, 23 Jan 2017 23:59:10 +0000 (18:59 -0500)] 
Fix: memory leak when using mapping iterator

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix: check enum overlap as long as the type is not frozen
Jérémie Galarneau [Mon, 23 Jan 2017 20:49:29 +0000 (15:49 -0500)] 
Fix: check enum overlap as long as the type is not frozen

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix: allow duplicate keys and overlapping ranges in enumerations
Mathieu Desnoyers [Fri, 16 Dec 2016 17:30:24 +0000 (18:30 +0100)] 
Fix: allow duplicate keys and overlapping ranges in enumerations

This changes the field and field types IR API. It adds a validation to
the variant that checks if there are overlapping ranges in its
enumeration tag.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoAPI doc: add int/float field type examples
Philippe Proulx [Sat, 3 Dec 2016 02:45:37 +0000 (21:45 -0500)] 
API doc: add int/float field type examples

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agostream-class.h: doc: fix trace/packet instead of stream/event
Philippe Proulx [Sat, 3 Dec 2016 01:52:40 +0000 (20:52 -0500)] 
stream-class.h: doc: fix trace/packet instead of stream/event

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoDocument fields.h (API)
Philippe Proulx [Sat, 3 Dec 2016 01:50:10 +0000 (20:50 -0500)] 
Document fields.h (API)

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agofield-types.h: doc: bt_ctf_field_type_copy(): add not frozen @post
Philippe Proulx [Sat, 3 Dec 2016 01:48:10 +0000 (20:48 -0500)] 
field-types.h: doc: bt_ctf_field_type_copy(): add not frozen @post

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agofield-types.h: doc: fix missing plural
Philippe Proulx [Sat, 3 Dec 2016 00:40:23 +0000 (19:40 -0500)] 
field-types.h: doc: fix missing plural

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agodoc/api/README.adoc: fix double "followed by"
Philippe Proulx [Fri, 2 Dec 2016 17:06:40 +0000 (12:06 -0500)] 
doc/api/README.adoc: fix double "followed by"

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agofield-types.h: doc: add note about freezing
Philippe Proulx [Thu, 1 Dec 2016 22:03:10 +0000 (17:03 -0500)] 
field-types.h: doc: add note about freezing

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoTest fix: a stream class' clock must be associated to its writer
Jérémie Galarneau [Tue, 17 Jan 2017 05:14:35 +0000 (00:14 -0500)] 
Test fix: a stream class' clock must be associated to its writer

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoir: add bt_ctf_clock_class object, modify bt_ctf_clock object
Philippe Proulx [Mon, 16 Jan 2017 20:02:23 +0000 (15:02 -0500)] 
ir: add bt_ctf_clock_class object, modify bt_ctf_clock object

In an attempt to isolate the CTF writer API from the general API
(sometimes called the non-writer API), let's make the clock object a
compound object made of:

1. A clock class object, a new object which holds all the static
   properties of a clock.
2. A single value.

You can only use the clock object with the functions of the CTF writer
API:

* bt_ctf_writer_add_clock()
* bt_ctf_stream_class_set_clock()
* bt_ctf_stream_class_get_clock()

The purpose of a clock object is to automate the setting of the
`timestamp` field in event headers part of a CTF writer object. The
clock object has nothing to do with the non-writer part of the API, that
is, the one you use to write BT component classes and plugins.

The functions above do this from now on:

* bt_ctf_writer_add_clock(): Calls bt_ctf_trace_add_clock_class() on
  the clock class of the clock object parameter.

* bt_ctf_stream_class_set_clock(): Registers the clock object as the
  current stream class's clock and maps the field named `timestamp`
  in the current event header field type to this same clock class.

  NOTE: If you set a custom event header field type after having called
        bt_ctf_stream_class_set_clock(), this mapping is LOST.

When you call bt_ctf_stream_append_event(), the `timestamp` field of the
event header is automatically set (from the stream class's clock's
current value) if, and only if all the following conditions are
satisfied:

1. The event header field `timestamp` exists and is an integer field.

2. The stream's class has a registered clock (set with
   bt_ctf_stream_class_set_clock()).

3. The event header field `timestamp` has its type mapped to a clock
   class which is also the clock class of the stream's class's
   registered clock.

4. The event header field `timestamp` is NOT set.

From now on you cannot set a stream class's clock and add this stream
class to a trace which was not created by a CTF writer. This enforces
the fact that bt_ctf_stream_class_set_clock() and
bt_ctf_stream_class_get_clock() are only part of the CTF writer API.

A clock _class_ has no value, although you can create individual clock
value objects linked to a specific clock class with
bt_ctf_clock_value_create(). Note that everything related to clock value
objects has zero effects on the CTF writer API.

What would be named bt_ctf_clock_class_*_offset() after this massive
renaming operation is named bt_ctf_clock_class_*_offset_cycles() for
those functions to be self-documented, and for them to have names that
are parallel with bt_ctf_clock_class_*_offset_s().

bt_ctf_field_type_integer_*_mapped_clock() functions are renamed
to bt_ctf_field_type_integer_*_mapped_clock_class().

Component classes must now include `babeltrace/ctf-ir/clock-class.h`
to deal with clock class objects.

Programs which use the CTF writer API must still include
`babeltrace/ctf-writer/clock.h`.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoir: stream: add bt_ctf_stream_is_writer()
Philippe Proulx [Fri, 13 Jan 2017 20:24:27 +0000 (15:24 -0500)] 
ir: stream: add bt_ctf_stream_is_writer()

This function indicates whether or not the stream is in
"CTF writer mode", that is, its trace parent was created by a
CTF writer object and it has an open file descriptor.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix: remove assert() for existing SC field types
Philippe Proulx [Wed, 21 Dec 2016 22:29:35 +0000 (17:29 -0500)] 
Fix: remove assert() for existing SC field types

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoOnly output configuration diagnostic information in verbose mode
Jérémie Galarneau [Tue, 17 Jan 2017 02:02:28 +0000 (21:02 -0500)] 
Only output configuration diagnostic information in verbose mode

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoUpdate .gitignore
Michael Jeanson [Thu, 12 Jan 2017 17:01:02 +0000 (12:01 -0500)] 
Update .gitignore

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoGenerate a binary looking for in-tree plug-ins
Jérémie Galarneau [Tue, 17 Jan 2017 01:07:33 +0000 (20:07 -0500)] 
Generate a binary looking for in-tree plug-ins

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoTrimmer fix: don't emit end of trace on out-of-bound event
Jérémie Galarneau [Mon, 16 Jan 2017 19:33:06 +0000 (14:33 -0500)] 
Trimmer fix: don't emit end of trace on out-of-bound event

Trimmer must properly end packets and streams before returning
END_OF_TRACE.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoTrimmer fix: forward evaluation result to downstream components
Jérémie Galarneau [Mon, 16 Jan 2017 17:52:11 +0000 (12:52 -0500)] 
Trimmer fix: forward evaluation result to downstream components

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoClean-up indentation in babeltrace-cfg.c
Jérémie Galarneau [Fri, 13 Jan 2017 21:01:45 +0000 (16:01 -0500)] 
Clean-up indentation in babeltrace-cfg.c

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoctf-fs fix: only apply timestamp end field on packet end
Jérémie Galarneau [Fri, 13 Jan 2017 21:00:49 +0000 (16:00 -0500)] 
ctf-fs fix: only apply timestamp end field on packet end

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix: don't attempt to mmap packet at end of file
Jérémie Galarneau [Fri, 6 Jan 2017 23:29:05 +0000 (18:29 -0500)] 
Fix: don't attempt to mmap packet at end of file

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix: print usage even if omit arguments are received
Mathieu Desnoyers [Fri, 16 Dec 2016 20:22:51 +0000 (21:22 +0100)] 
Fix: print usage even if omit arguments are received

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix: integration of legacy mode with implicit source
Mathieu Desnoyers [Fri, 16 Dec 2016 20:09:45 +0000 (21:09 +0100)] 
Fix: integration of legacy mode with implicit source

Needed to add an implicit sink for non-legacy mode too.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoTests: adapt writer tests as IR now allows NULL headers and contexts
Jérémie Galarneau [Wed, 4 Jan 2017 21:53:10 +0000 (16:53 -0500)] 
Tests: adapt writer tests as IR now allows NULL headers and contexts

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoStop trimmer iteration when end bound is reached
Jérémie Galarneau [Sat, 17 Dec 2016 16:05:26 +0000 (11:05 -0500)] 
Stop trimmer iteration when end bound is reached

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix: passing NULL to glib mapped file unref function is not allowed
Jérémie Galarneau [Sat, 17 Dec 2016 17:11:29 +0000 (12:11 -0500)] 
Fix: passing NULL to glib mapped file unref function is not allowed

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix IR visitor: set min alignment on structure field type
Jérémie Galarneau [Sat, 17 Dec 2016 17:03:19 +0000 (12:03 -0500)] 
Fix IR visitor: set min alignment on structure field type

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix: don't use implicit source in legacy mode
Mathieu Desnoyers [Fri, 16 Dec 2016 17:46:27 +0000 (18:46 +0100)] 
Fix: don't use implicit source in legacy mode

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix: babeltrace launch wrapper script
Mathieu Desnoyers [Fri, 16 Dec 2016 16:35:15 +0000 (17:35 +0100)] 
Fix: babeltrace launch wrapper script

Call babeltrace.bin from wrapper script (not wrapper per se).
Transform the babeltrace.bin program name to babeltrace when installing.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoUse build tree plugins when executing from build tree
Mathieu Desnoyers [Fri, 16 Dec 2016 08:20:05 +0000 (09:20 +0100)] 
Use build tree plugins when executing from build tree

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoMove print level of duplicate component warning to verbose
Mathieu Desnoyers [Fri, 16 Dec 2016 08:04:50 +0000 (09:04 +0100)] 
Move print level of duplicate component warning to verbose

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoHandle system and home plugin paths
Mathieu Desnoyers [Fri, 16 Dec 2016 06:24:07 +0000 (07:24 +0100)] 
Handle system and home plugin paths

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix: params arg parsing: apply to current component params
Mathieu Desnoyers [Fri, 16 Dec 2016 06:35:57 +0000 (07:35 +0100)] 
Fix: params arg parsing: apply to current component params

We want to extend the current component params, not the base params. The
base params are already copied into the component's params when we get
the --source or --sink parameters.

Allow multiple --params (additive) to be passed to a component.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoImplement implicit source component
Mathieu Desnoyers [Thu, 15 Dec 2016 12:26:54 +0000 (13:26 +0100)] 
Implement implicit source component

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoRemove unused index version fields
Jérémie Galarneau [Wed, 14 Dec 2016 12:00:21 +0000 (07:00 -0500)] 
Remove unused index version fields

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoBuild CTF stream indexes from LTTng index files
Jérémie Galarneau [Mon, 12 Dec 2016 16:55:05 +0000 (11:55 -0500)] 
Build CTF stream indexes from LTTng index files

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoAdd timerange, begin, end parameters
Mathieu Desnoyers [Mon, 12 Dec 2016 18:33:22 +0000 (19:33 +0100)] 
Add timerange, begin, end parameters

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agotrimmer: error checking, reporting, begin > end check
Mathieu Desnoyers [Mon, 12 Dec 2016 08:20:13 +0000 (09:20 +0100)] 
trimmer: error checking, reporting, begin > end check

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agotrimmer: infer end date from begin date
Mathieu Desnoyers [Mon, 12 Dec 2016 07:52:25 +0000 (08:52 +0100)] 
trimmer: infer end date from begin date

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoSupport standard timestamp formats for begin/end
Mathieu Desnoyers [Sun, 11 Dec 2016 12:53:26 +0000 (13:53 +0100)] 
Support standard timestamp formats for begin/end

Also use the new plugin parameters to convey this information. Don't
allocate a shortcut just yet.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoTrimmer: Filter-out packet that are not in the specified range
Jérémie Galarneau [Sun, 11 Dec 2016 14:32:59 +0000 (09:32 -0500)] 
Trimmer: Filter-out packet that are not in the specified range

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoRename bt_notification_packet_start to "begin"
Jérémie Galarneau [Sun, 11 Dec 2016 14:32:37 +0000 (09:32 -0500)] 
Rename bt_notification_packet_start to "begin"

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoFix: handle size 0 CTF fs streams
Jérémie Galarneau [Sun, 11 Dec 2016 10:52:30 +0000 (05:52 -0500)] 
Fix: handle size 0 CTF fs streams

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoWriter fix: don't skip first notification
Jérémie Galarneau [Sun, 11 Dec 2016 09:42:51 +0000 (04:42 -0500)] 
Writer fix: don't skip first notification

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoWriter: null contexts are not an error
Jérémie Galarneau [Sun, 11 Dec 2016 09:41:38 +0000 (04:41 -0500)] 
Writer: null contexts are not an error

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoclock working
Julien Desfossez [Wed, 23 Nov 2016 22:34:57 +0000 (17:34 -0500)] 
clock working

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agofix: missing free on error path
Julien Desfossez [Fri, 18 Nov 2016 16:44:17 +0000 (11:44 -0500)] 
fix: missing free on error path

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agouse GString instead of non-portable char[PATH/NAME_MAX]
Julien Desfossez [Fri, 18 Nov 2016 16:41:58 +0000 (11:41 -0500)] 
use GString instead of non-portable char[PATH/NAME_MAX]

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agofix: add .a of the ctf writer plugin in Makefile
Julien Desfossez [Fri, 18 Nov 2016 16:12:34 +0000 (11:12 -0500)] 
fix: add .a of the ctf writer plugin in Makefile

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoCTF Writer sink
Julien Desfossez [Wed, 16 Nov 2016 19:33:42 +0000 (14:33 -0500)] 
CTF Writer sink

This plugin outputs CTF traces based on what it receives as input.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoAdd a trimmer component to the graph if begin/end options are used
Jérémie Galarneau [Sun, 11 Dec 2016 09:01:04 +0000 (04:01 -0500)] 
Add a trimmer component to the graph if begin/end options are used

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoAdditional check added to bt_component_sink_validate
Jérémie Galarneau [Sun, 11 Dec 2016 09:00:51 +0000 (04:00 -0500)] 
Additional check added to bt_component_sink_validate

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoImplement bt_notification_iterator_set_seek_time_cb
Jérémie Galarneau [Sun, 11 Dec 2016 09:00:22 +0000 (04:00 -0500)] 
Implement bt_notification_iterator_set_seek_time_cb

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoClean-up notification iterator creation function
Jérémie Galarneau [Sun, 11 Dec 2016 08:59:43 +0000 (03:59 -0500)] 
Clean-up notification iterator creation function

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoAdd filter component creation and validation callback
Jérémie Galarneau [Sun, 11 Dec 2016 08:57:56 +0000 (03:57 -0500)] 
Add filter component creation and validation callback

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoAdd branch prediction hints in ref count interface
Jérémie Galarneau [Sun, 11 Dec 2016 08:56:56 +0000 (03:56 -0500)] 
Add branch prediction hints in ref count interface

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoClean-up: Add missing forward declaration
Jérémie Galarneau [Sun, 11 Dec 2016 08:56:16 +0000 (03:56 -0500)] 
Clean-up: Add missing forward declaration

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoAdd bt_notification_iterator_seek_time_cb to notification iterator
Jérémie Galarneau [Sun, 11 Dec 2016 08:55:44 +0000 (03:55 -0500)] 
Add bt_notification_iterator_seek_time_cb to notification iterator

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoImplement the filter base class validation and creation
Jérémie Galarneau [Sun, 11 Dec 2016 08:55:00 +0000 (03:55 -0500)] 
Implement the filter base class validation and creation

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoImplement the trimmer plug-in
Jérémie Galarneau [Sun, 11 Dec 2016 08:54:26 +0000 (03:54 -0500)] 
Implement the trimmer plug-in

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoAdd a "set" attribute to component begin/end config
Jérémie Galarneau [Sun, 11 Dec 2016 08:52:42 +0000 (03:52 -0500)] 
Add a "set" attribute to component begin/end config

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoComponent iterator points to first notification on creation
Jérémie Galarneau [Sun, 11 Dec 2016 08:49:34 +0000 (03:49 -0500)] 
Component iterator points to first notification on creation

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agogitignore TAGS and cscope
Julien Desfossez [Thu, 3 Nov 2016 14:40:44 +0000 (10:40 -0400)] 
gitignore TAGS and cscope

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoClean-up component-class internal header
Jérémie Galarneau [Thu, 8 Dec 2016 21:00:29 +0000 (16:00 -0500)] 
Clean-up component-class internal header

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoImplement the Component Graph API
Jérémie Galarneau [Thu, 8 Dec 2016 19:10:22 +0000 (14:10 -0500)] 
Implement the Component Graph API

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agofield-types.h: doc: use FT/field aliases
Philippe Proulx [Sun, 27 Nov 2016 22:49:19 +0000 (17:49 -0500)] 
field-types.h: doc: use FT/field aliases

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agodoc/api: Doxyfile: add FT/field aliases
Philippe Proulx [Sun, 27 Nov 2016 22:48:58 +0000 (17:48 -0500)] 
doc/api: Doxyfile: add FT/field aliases

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agotrace.h: doc: add missing end of group
Philippe Proulx [Sat, 26 Nov 2016 02:27:23 +0000 (21:27 -0500)] 
trace.h: doc: add missing end of group

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agopacket.h: doc: add missing end of group
Philippe Proulx [Sat, 26 Nov 2016 02:27:06 +0000 (21:27 -0500)] 
packet.h: doc: add missing end of group

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoDocument field-types.h (API)
Philippe Proulx [Sat, 26 Nov 2016 02:25:48 +0000 (21:25 -0500)] 
Document field-types.h (API)

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agovalues.h: doc: fix doc
Philippe Proulx [Sat, 26 Nov 2016 02:25:08 +0000 (21:25 -0500)] 
values.h: doc: fix doc

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agotrace.h: doc: ctfirfieldtype -> ctfirfieldtypes
Philippe Proulx [Sat, 26 Nov 2016 02:24:36 +0000 (21:24 -0500)] 
trace.h: doc: ctfirfieldtype -> ctfirfieldtypes

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agodoc/api/dox: update pages
Philippe Proulx [Sat, 26 Nov 2016 02:24:16 +0000 (21:24 -0500)] 
doc/api/dox: update pages

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoapi/doc: update Doxyfile.in and add custom layout file
Philippe Proulx [Sat, 26 Nov 2016 02:23:49 +0000 (21:23 -0500)] 
api/doc: update Doxyfile.in and add custom layout file

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agobt_ctf_field_type_get_byte_order(): support enum FT
Philippe Proulx [Thu, 24 Nov 2016 21:44:39 +0000 (16:44 -0500)] 
bt_ctf_field_type_get_byte_order(): support enum FT

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agofield-types.c: check that we don't add self FT to struct/var FT
Philippe Proulx [Thu, 24 Nov 2016 21:44:01 +0000 (16:44 -0500)] 
field-types.c: check that we don't add self FT to struct/var FT

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoAPI doc: CTF IR writer -> CTF writer
Philippe Proulx [Wed, 23 Nov 2016 20:53:07 +0000 (15:53 -0500)] 
API doc: CTF IR writer -> CTF writer

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 years agoAdd trimmer plug-in skeleton
Jérémie Galarneau [Fri, 2 Dec 2016 20:36:52 +0000 (15:36 -0500)] 
Add trimmer plug-in skeleton

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
This page took 0.04237 seconds and 4 git commands to generate.