[lttng-dev] [PATCH RFC lttng-tools] Testpoint mechanism

Christian Babeux christian.babeux at efficios.com
Tue Sep 11 22:26:10 EDT 2012

Hi Yannick,

> I'm not sure I understand the goal of this feature. Can you explain more?

This testpoint mechanism is not a LTTng "feature" per se. Think of it
has a  facility to inject code in order to test different portions of
the LTTng codebase.

Maybe an example will make things more clear:

In the lttng-sessiond, we could add testpoints to some of the threads.
The testpoints could trigger a pthread_exit().
This could be useful to verify that the new health check feature is
working and properly mark the thread that exited as
in "bad health". Without this mechanism, writing tests for that
particular feature would be a lot harder.

Another example would be to randomly add delays in different threads
in order to find race conditions in the codebase.

This mechanism is only triggered when the LTTNG_TESTPOINT_ENABLE env.
var. is set and a proper library is preloaded with the testpoints
symbols (e.g.: LD_PRELOAD=mytestlib.so lttng-sessiond &). The only way
to use this facility is to link against the new libtestpoint.

I hope this make more sense now :).


More information about the lttng-dev mailing list