Add query executor
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 14 Aug 2017 21:55:53 +0000 (17:55 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 15 Sep 2017 15:21:13 +0000 (11:21 -0400)
commitc7eee084ca459af66ba1f6d375fba3f89db93584
treefc84332afc5e3ad6997cb75f84a2d31afb9281f6
parente373846d806aacb2841f4dd399a28296e2b5c5fe
Add query executor

Use a new object, a query executor, to query a component class:

    struct bt_query_executor *query_exec = bt_query_executor_create();
    enum bt_query_status status = bt_query_executor_query(query_exec,
        comp_cls, "object", params, &result);

The user's query method receives this query executor as a parameter so
that some state can be shared between the user who queries (calls
bt_query_executor_query()) and the user's method. Currently, only a
cancellation flag is part of the query executor's state, so that, if you
wish to cancel a query during a signal handler, you can call
bt_query_executor_cancel(): then, when the user's method's current
system call sets the EINTR error (or the equivalent on other supported
platforms), it can check the state of the query executor with
bt_query_executor_is_canceled() to know whether to retry the system call
(debugging mode, query executor is not canceled) or to return an error
(application mode, query executor is canceled).

This is the same mechanism that is used with the graph object and
component objects: bt_graph_cancel() and bt_graph_is_canceled().

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
28 files changed:
bindings/python/bt2/Makefile.am
bindings/python/bt2/bt2/__init__.py.in
bindings/python/bt2/bt2/component.py
bindings/python/bt2/bt2/native_bt.i
bindings/python/bt2/bt2/native_btcomponentclass.i
bindings/python/bt2/bt2/native_btqueryexec.i [new file with mode: 0644]
bindings/python/bt2/bt2/native_btversion.i
bindings/python/bt2/bt2/query_executor.py [new file with mode: 0644]
cli/babeltrace.c
include/Makefile.am
include/babeltrace/babeltrace.h
include/babeltrace/graph/component-class.h
include/babeltrace/graph/query-executor-internal.h [new file with mode: 0644]
include/babeltrace/graph/query-executor.h [new file with mode: 0644]
lib/graph/Makefile.am
lib/graph/component-class.c
lib/graph/graph.c
lib/graph/query-executor.c [new file with mode: 0644]
plugins/ctf/fs-src/fs.c
plugins/ctf/fs-src/fs.h
plugins/ctf/fs-src/query.c
plugins/ctf/fs-src/query.h
plugins/ctf/lttng-live/lttng-live-internal.h
plugins/ctf/lttng-live/lttng-live.c
tests/bindings/python/bt2/test_component_class.py
tests/bindings/python/bt2/test_query_executor.py [new file with mode: 0644]
tests/lib/test-plugin-plugins/sfs.c
tests/lib/test_plugin.c
This page took 0.027174 seconds and 4 git commands to generate.