Jérémie Galarneau [Mon, 30 Jan 2017 22:24:29 +0000 (17:24 -0500)]
Fix: add missing NULL check in ctf_fs_destroy_data
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Fri, 27 Jan 2017 18:22:48 +0000 (13:22 -0500)]
Fix Makefile.am files regarding headers
Header files for convenience library and private targets
can be listed in _SOURCES, and they must all be listed for
the distribution to work.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Fri, 27 Jan 2017 17:43:58 +0000 (12:43 -0500)]
Rename input.h -> component-input-internal.h
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Fri, 27 Jan 2017 08:34:18 +0000 (03:34 -0500)]
Set notification iterator methods to the component class
This follows the spirit of the previous refactorings by assigning
notification iterator methods to the component class instead of setting
them during their initialization method.
Conceptually here, a (source and filter) component class defines one,
and only one notification iterator class. Therefore the concept of an
iterator "class" is hidden to the user here, since there's no
one-to-many relationship. In any OO language, an iterator class would be
a class nested under a component class.
Source and filter component classes are created with two mandatory
iterator methods: get and next.
The initialization, destroy, and seek time iterator methods are
optional.
New functions:
* bt_component_class_source_set_notification_iterator_init_method()
* bt_component_class_source_set_notification_iterator_destroy_method()
* bt_component_class_source_set_notification_iterator_seek_time_method()
* bt_component_class_filter_set_notification_iterator_init_method()
* bt_component_class_filter_set_notification_iterator_destroy_method()
* bt_component_class_filter_set_notification_iterator_seek_time_method()
The plugin development interface (babeltrace/plugin/plugin-dev.h) is
updated accordingly.
Tests and existing plugins are updated accordingly.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Thu, 26 Jan 2017 22:14:27 +0000 (17:14 -0500)]
plugin-dev.h: put selector (type) close to union in structures
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Thu, 26 Jan 2017 22:09:53 +0000 (17:09 -0500)]
Plugins: use UNUSED_VAR instead of casting to void
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Thu, 26 Jan 2017 10:22:16 +0000 (05:22 -0500)]
Add bt_component_create_with_init_method_data()
This function has one more parameter than bt_component_create():
custom user data (void *) which is passed directly to the
init. method (if any) of the used component class. Nothing else
is done by the lib with this data.
bt_component_create() is a specific version of
bt_component_create_with_init_method_data() which passes NULL
as the init. method data.
You can use this custom data to exchange specific data between
an application and a component class. It is not recommended to
rely on this function when you implement Babeltrace plugins.
A component initialization method now has an additional parameter,
init_method_data.
This initialization method data is not related at all to a
component's private data: you can set the init. method data as
the component's private data, but it's just a design choice.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Thu, 26 Jan 2017 10:05:11 +0000 (05:05 -0500)]
babeltrace.c: print plugin version when available
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Thu, 26 Jan 2017 09:57:04 +0000 (04:57 -0500)]
Add tests for plugin version
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Thu, 26 Jan 2017 09:54:47 +0000 (04:54 -0500)]
Add plugin (user) version information
This patch adds the BT_PLUGIN_VERSION_WITH_ID() and BT_PLUGIN_VERSION()
macros to the plugin development API (babeltrace/plugin/plugin-dev.h)
for the user to set a custom version (major, minor, patch, extra).
You can use the new bt_plugin_get_version() function to retrieve the
plugin's version, if set.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Thu, 26 Jan 2017 09:29:52 +0000 (04:29 -0500)]
Add bt_component_class_freeze()
It is somewhat essential for a component class provider (plugin or
whatever else) to make sure that its created, shared component class is
not modified once properly configured.
The new bt_component_class_freeze() function freezes a component class
object so that it becomes immutable.
bt_component_create() also has the side effect of freezing its class.
This is analogous to bt_event_create() which freezes its class.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Thu, 26 Jan 2017 09:11:30 +0000 (04:11 -0500)]
Prefix {source,filter,sink}*.h file names with component-
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Thu, 26 Jan 2017 09:03:19 +0000 (04:03 -0500)]
Refactor the component class and component API
This patch modifies the component class and component API so that the
user sets methods to the component class objects, not to the component
objects. This makes sense following the typical object-oriented
paradigm.
Changes:
* bt_component_class_create() is removed.
You need to use a component class-specific function to create one,
amongst:
* bt_component_class_source_create()
* bt_component_class_filter_create()
* bt_component_class_sink_create()
All the parameters of those functions are mandatory: they are the
name and the mandatory _methods_ of the class, depending on the
type.
* Component class-specific functions are declared in their own header:
* babeltrace/component/component-class-source.h
* babeltrace/component/component-class-filter.h
* babeltrace/component/component-class-sink.h
babeltrace/component/component-class.h only contains functions which
you can use on any component class, whatever the type.
* enum bt_component_type and BT_COMPONENT_TYPE_* are renamed to
enum bt_component_class_type and BT_COMPONENT_CLASS_TYPE_* since
the type is a property of the component class.
* Once a component class is created, you can use functions to set
optional methods:
* bt_component_class_filter_set_add_iterator_method()
* bt_component_class_sink_set_add_iterator_method()
The component initialization and destroy methods are now both
optional:
* bt_component_class_set_init_method()
* bt_component_class_set_destroy_method()
You can also set the optional description with a function:
* bt_component_class_set_description()
* New public utility function: bt_component_get_class_type(): returns
the type of a component's class.
* Component functions which are specific to a class type are moved to
their respective header in babeltrace/component
(source.h, filter.h, sink.h).
* Plugin development interface (babeltrace/plugin/plugin-dev.h) is
updated to follow the API changes. Component class descriptor macros
contain the component class type in their name, for example:
BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION()
BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESTROY_METHOD()
BT_PLUGIN_FILTER_COMPONENT_CLASS_ADD_ITERATOR_METHOD()
* Existing plugins, tests, and the command-line converter are updated to
follow the API changes.
* Other very minor fixes.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Tue, 24 Jan 2017 17:44:49 +0000 (12:44 -0500)]
Move enum bt_component_type to component.h
enum bt_component_type starts with bt_component, thus it
belongs to component.h.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Sat, 21 Jan 2017 06:16:20 +0000 (01:16 -0500)]
Refactor the plugin registration and loading machinery
This patch refactors the plugin registration and loading machinery: the
different, specific symbol names found in the shared object are dropped
in favor of two sections.
The goals of this refactoring are:
1. To allow optional plugin attributes now and in the future.
2. To allow optional component class attributes now and in the future.
3. To make backward and forward compatibility easier.
4. To simplify the plugin development API from a user's perspective.
5. To use the same mechanism to load plugins from a shared object and
statically from the `babeltrace` binary.
You can still find the macros used to define plugins, plugin attributes,
and component classes in `babeltrace/plugin/plugin-dev`.
We introduce four (IV) new structures to the plugin subsystem:
* A *plugin descriptor* describes a single plugin. Note that one shared
object can contain one or more plugin descriptors, thus it can contain
one or more plugins.
A plugin descriptor contains the interface version of the plugin it
describes as well as its name (a C string).
The BT_PLUGIN_WITH_ID() macro creates a plugin descriptor structure
with a specific identifier in its variable name. It also creates a
pointer to this structure which is added to the plugin descriptor
section (`__bt_plugin_descriptors`).
The BT_PLUGIN() macro is an easy-to-use version of
BT_PLUGIN_WITH_ID(): it accepts a C identifier which is the name of
the plugin. Its plugin descriptor ID is `auto`.
* A *plugin descriptor attribute* is an optional attribute attached to a
specific plugin descriptor.
A plugin descriptor attribute structure has a type (its key) as well
as a value (the value's type depends on the attribute type). For debug
purposes, we also put a string in this structure which is the name of
the attribute type. This can be used by the plugin subsystem to give
more information when it warns that an attribute with an unknown type
was found (use case: current Babeltrace loading a future plugin).
A plugin descriptor attribute also has a member pointing to its
"parent" plugin descriptor.
The following macros each create a plugin descriptor attribute
structure and a pointer to this structure which is added to the plugin
attribute section. Each macro accepts a plugin descriptor ID (to
attach the attribute to the appropriate descriptor) and a value:
* BT_PLUGIN_INIT_WITH_ID(): Initialization function.
* BT_PLUGIN_EXIT_WITH_ID(): Exit function.
* BT_PLUGIN_AUTHOR_WITH_ID(): Author.
* BT_PLUGIN_LICENSE_WITH_ID(): License.
* BT_PLUGIN_DESCRIPTION_WITH_ID(): Description.
You can use the macros above in any order, but you need to use them
after BT_PLUGIN_INIT*().
There's an equivalent, easy-to-use macro for each of the macros above
without the `_WITH_ID` suffix which uses the `auto` plugin descriptor.
* A *component class descriptor* describes a single component class
attached to a specific plugin descriptor.
The structure contains the mandatory attributes needed to build a
component class (name, component type, component initialization
function).
The BT_PLUGIN_COMPONENT_CLASS_WITH_ID() macro creates a component
class descriptor structure with a specific component class descriptor
identifier in its variable name. The component source type is also
part of the variable name, as well as the specified plugin descriptor
ID. The macro also creates a pointer to this structure which is added
to the component class descriptor section
(`__bt_plugin_component_descriptors`).
The easy-to-use BT_PLUGIN_COMPONENT_CLASS() macro uses the `auto`
plugin descriptor and the name of the component class as the component
class descriptor ID (a C identifier in this version, to allow this).
With this new mechanism, the BT_PLUGIN_COMPONENT_CLASSES_BEGIN and
BT_PLUGIN_COMPONENT_CLASSES_END macros do not exist anymore: you can
use BT_PLUGIN_COMPONENT_CLASS*() macros anywhere, in any order, as
long as they appear after BT_PLUGIN_INIT*().
* A *component class descriptor attribute* is an optional attribute
attached to a specific component class descriptor.
A component class descriptor attribute structure has a type (its key)
as well as a value (the value's type depends on the attribute type).
For debug purposes, we also put a string in this structure which is
the name of the attribute type.
A component class descriptor attribute also has a member pointing to
its "parent" component class descriptor (which itself, as stated
above, as a member pointing to its "parent" plugin descriptor).
As of this patch, the only available component class descriptor
attribute is its optional description. The
BT_PLUGIN_COMPONENT_CLASS_DESCRIPTION_WITH_ID() macro creates such an
attribute. BT_PLUGIN_COMPONENT_CLASS_DESCRIPTION() is the easy-to-use
version which uses the `auto` plugin descriptor.
You need to place BT_PLUGIN_COMPONENT_CLASS_DESCRIPTION*() after
the associated BT_PLUGIN_COMPONENT_CLASS*().
We also add the macro BT_PLUGIN_DECLARE() to declare an `extern` plugin
descriptor structure to add plugin attributes to the same plugin
descriptor from different compilation units. Thanks to this, the simple
fact of linking a given object file or not to a shared object is enough
to conditionally add or not one or more component classes.
This approach also has the somewhat interesting side effect of refusing
to build if you define a plugin descriptor attribute without using
BT_PLUGIN_INIT*() (missing name) or if you define the same attribute
twice, since the macros create actual variables which must have unique
names.
When the plugin subsystem loads a shared object, it looks for the
beginning and end symbols for the four sections:
* Plugin descriptors.
* Plugin descriptor attributes.
* Component class descriptors.
* Component class descriptor attributes.
Those are enough to provide everything that is needed to create a plugin
object. A plugin's initialization function is called first, and then its
component classes are created and added sequentially according to the
discovered component class descriptors.
Since a single shared object file can now contain more than one plugin
(descriptor), the following function:
struct bt_plugin *bt_plugin_create_from_file(const char *path);
is changed to this:
struct bt_plugin **bt_plugin_create_all_from_file(const char *path);
In other words, the function returns a NULL-terminated array of plugin
objects, just like bt_plugin_create_append_all_from_dir() does.
All the existing plugins and tests are updated to follow the changes.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Philippe Proulx [Thu, 19 Jan 2017 18:18:55 +0000 (13:18 -0500)]
Add bt_plugin test
This new test proves that the bt_plugin subsystem works as expected.
There are three Babeltrace plugins built in
`tests/lib/test-plugin-plugins`. They are:
* `minimal`: Minimal, valid plugin with no component classes.
* `sfs`: Valid plugin with a source, a filter, and a sink component
class.
* `invalid`: Invalid plugin (missing name).
Verified in this test:
* Behaviour of bt_plugin_*() functions with non-existing paths, invalid
arguments, etc.
* bt_plugin_create_from_file() can load a valid plugin and we can access
all its properties.
* The initialization and exit functions of a plugin are called when
expected.
* We can access the component classes of a plugin which provides some.
* We can still create a component from a component class provided by
a plugin after the associated plugin object is destroyed, that is, the
associated shared library handle is not closed until it is known that
no more user code found in the loaded object will ever be executed
again in the future.
* bt_plugin_create_all_from_dir() works as expected.
As of this patch, Valgrind shows for this test:
ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
This page took 0.061224 seconds and 4 git commands to generate.