Add safety assert() in session daemon Note here that a test has been removed which tested the NULL parameter of the session_destroy() call where now we assert if there is a NULL pointer. It's a code flow error if a NULL pointer gets to this call so the test becomes irrelevant. Signed-off-by: David Goulet <dgoulet@efficios.com>
Add lttng-error.h containing every API err. code Move all error codes from sessiond-comm.h to lttng-error.h and rename them changing the prefix LTTCOMM* to the LTTNG_ERR_*. With this change, the error codes will soon be public in <lttng/lttng-error.h> that lttng.h will include by default. This commit also removes a bunch of unused code but does NOT changed the values so we don't break the 2.0 API. The lttng_strerror() call uses the new error_get_str function. The lttcomm_* API now only have internal communication error code such as the consumerd errors. Those codes must NEVER be exposed to the public API or, in that case, must be moved to lttng-error.h *without* changing the current values of the lttng_error_code enum. The gaps in the lttng_error_code enum found in lttng-error.h can be used for new error codes but the assigned value are considered immutable for the 2.x API. Signed-off-by: David Goulet <dgoulet@efficios.com>
Extend API and remove lttng_uri from lttng.h This is a big commit but actually not adding much. First, struct lttng_uri is removed from lttng.h and replaced by calls using string URL. The lttng_set_consumer_url is changed to "_url" taking an handle, a control and a data string URL. You can find the definition in proposal doc/proposals/0004-lttng-address-api.txt. The lttng_create_session_uri is removed and the path from the original lttng_create_session is now used to either pass a local filesystem full path or a string URL. Multiple fixes in uri_parse() also especially for IPv6 where address MUST be enclosed in brackets [] in the string representation. The help of lttng create and enable-consumer is updated and improved. Also, the enable-consumer command can now be used without a domain switch (-u/-k) so the destination URL is set to the global tracing session and on both UST and kernel session if there is an existing consumer. Signed-off-by: David Goulet <dgoulet@efficios.com>
Network streaming support This is a huge commit integrating a lot of new feature for network streaming support with the lttng-relayd previously merged. Please note that this commit is the initial import of the network streaming feature meaning that this is NOT stable and SHOULD be considered experimental hence not suited for production deployment. API Changes: lttng_create_session_uri(), lttng_enable_consumer(), lttng_set_consumer_uri() and lttng_disable_consumer() calls are added. The lttng command line now supports these new calls by introducing two new commands and one modified. (Please look at the --help option for more details). $ lttng enable-consumer $ lttng disable-consumer The "lttng create" command can now take new arguments to specify the destination URI for network streaming. There is also a new flag which allows the user to disable the consumer for the session. At this point, the now old deprecated lttng_create_session() call is still supported but SHOULD be replaced by lttng_create_session_uri(). More calls will be added to the API in order to facilitate the creation of lttng URI. Network streaming: Both kernel and user space tracing are supported for network streaming. For now, only IPv4 and IPv6 protocol over TCP is supported. Two network socket are used where one is for control commands and the second one is for data transmission. The port are respectively 5342 and 5343. BUGS: Streaming high throughput traces (e.g lttng enable-event -a -k) with low bandwitdh available to the relayd, the tracer does not behave well when the metadata are not emptied enough quickly so data are missing on the remote target and the tracing is simply not stoppable. This is a known bug and future iterations will try to fix it. WARNING: At this stage, there is _NO_ security features meaning no remote authentication on the relayd, no transport layer encryption or network secure handshake of some sort. So, uses only for in-vitro experiment or on _trusted_ networks. Signed-off-by: Julien Desfossez <julien.desfossez@efficios.com> Signed-off-by: David Goulet <dgoulet@efficios.com>
Improve tests and change tests/ directory layout Add run-report.py and test_list.py files which are an extended test framework providing memory and CPU sampling of the session daemon during the tests. Tests are now divided on a per package basis. The kernel/ directory contains integration tests for lttng-modules (kernel tracer). ust/ directory contains tests for lttng-ust and tools/ directory has the unit tests of lttng-tools itself which does not test tracer integration. First patch aimed at improving test coverage of the lttng 2.0 toolchain and provide the python framework for more detailled analysis. Use make check to run them all or use run-report.py and select which tests to run in test_list.py. Signed-off-by: David Goulet <dgoulet@efficios.com>