Refactor Python agent
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 1 Apr 2015 00:09:54 +0000 (20:09 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 15 May 2015 16:13:14 +0000 (12:13 -0400)
commitde4dee04fa3e008fe1044538f78778a867563aa4
treeadc60f5e3123975846358044861c041af18e74de
parente72c9d7ead60e3317bd6d1fade995c07021c947b
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>
liblttng-ust-python-agent/Makefile.am
liblttng-ust-python-agent/__init__.py.in [new file with mode: 0644]
liblttng-ust-python-agent/lttng_agent.py.in [deleted file]
liblttng-ust-python-agent/lttngust/__init__.py [new file with mode: 0644]
liblttng-ust-python-agent/lttngust/agent.py [new file with mode: 0644]
liblttng-ust-python-agent/lttngust/cmd.py [new file with mode: 0644]
liblttng-ust-python-agent/lttngust/debug.py [new file with mode: 0644]
liblttng-ust-python-agent/lttngust/loghandler.py [new file with mode: 0644]
This page took 0.02587 seconds and 4 git commands to generate.