Refactor Python agent
This patch refactors the whole LTTng-UST Python agent.
Notorious changes are:
* Python module "lttng_agent" moved to Python package
"lttngust". This removes "agent" from the name, which
really is an implementation detail. "lttngust" is used
because "lttng" would clash with LTTng-tools Python
bindings.
* Python package instead of simple module. Splitting the
code in various modules will make future development
easier.
* Use daemon threads to make sure logging with tracing
support is available as long as the regular threads live,
while making sure that the application exits instantly when
its regular threads die.
* Create client threads and register to session daemons
at import time. This allows the package to be usable just
by importing it (no need to instanciate any specific class
or call any specific function).
* Do not use a semaphore + sleep to synchronize client threads
with the importing thread: use a blocking synchronized
queue with appropriate timeouts.
* Add debug statements at strategic locations, enabled by
setting the $LTTNG_UST_PYTHON_DEBUG environment variable
to 1 before importing the package.
* Override the default session daemon registration timeout
with $LTTNG_UST_PYTHON_REGISTER_TIMEOUT (ms).
* Override the default session daemon registration retry
delay with $LTTNG_UST_PYTHON_REGISTER_RETRY_DELAY (ms).
* Honor $LTTNG_HOME (to retrieve session daemon TCP ports).
* Do not use an absolute path when loading the tracepoint
provider shared object. Users should use the
$LD_LIBRARY_PATH environment variable to override the
default library path when running Python instead.
* Do not keep an event dictionary since this brings issues
when enabling/disabling events with the same name in
different sessions.
* Make sure the reference count does not go below 0,
which could happen when destroying a session which contains
events that are disabled already.
* Minor improvements to make the code more Pythonic.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
This page took 0.026004 seconds and 5 git commands to generate.