[lttng-dev] hi,I have some question about lttng

Francis Giraldeau francis.giraldeau at gmail.com
Tue Aug 21 04:54:05 EDT 2012


Le 2012-08-21 08:42, 寇晓晖 a écrit :
> Hi all:
> now my work need lttng ,and why lttng use macro like
> this:TRACEPOINT_EVENT(tracepoint_provider,event_name,…)?
> Except I can use any primitive C-type i want,is there any other
> adavantage about this macro type?

The macro is used as a way to generate the tracepoint code and data
structure. Once this is done once, you can insert as many tracepoint
call in your code. Have a look into lttng-ust/doc/examples.

> And how lttng improve performance
> compare other log system(specially efficiency ).I need detail
> information about this mechanism.Can anyone help me?

On my system (i5-540M) it takes about 250 nano second to write a simple
event. In comparison, the logging framework Poco::Logger for a similar
tracepoint requires about 12 micro second per event, roughtly 50x
slower. The performance of such a loggin framework is likely to drop
while increasing the number of concurrent threads, because the file is
locked to prevent race at each event, while LTTng uses per-CPU buffers
and has a lockless data structure and will scale perfectly.

So, if you want to log few error messages once in a while, a logging
library is fine. If you want trace requests or other high frequency
events in the system and have precise timestamps, then LTTng is better
suited.

BR,

Francis


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4489 bytes
Desc: Signature cryptographique S/MIME
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20120821/f6ab9b3a/attachment-0001.bin>


More information about the lttng-dev mailing list