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
smime.p7s
Description: Signature cryptographique S/MIME
_______________________________________________ lttng-dev mailing list [email protected] http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
