From mboxrd@z Thu Jan 1 00:00:00 1970 From: mathieu.desnoyers@efficios.com (Mathieu Desnoyers) Date: Tue, 10 Apr 2012 11:28:29 -0400 Subject: [lttng-dev] Difference between markers, tracepoints and trace_events In-Reply-To: <4F7C04F3.9070305@elesoftrom.com.pl> References: <4F4224E4.6080108@elesoftrom.com.pl> <4F7C04F3.9070305@elesoftrom.com.pl> Message-ID: <20120410152829.GB23568@Krystal> * Piotr Romaniuk (piotr.romaniuk at elesoftrom.com.pl) wrote: > Hi, > > I would like to use tracing of execution in my kernel driver. > I saw in LTTng documentation and source code that there are several methods: > 1) markers, lttng 0.x instrumentation. Slow. Format string parsing at runtime. Easy to add debug-style instrumentation. > 2) tracepoints, See Documentation/trace/tracepoint.txt of the Linux kernel. It is much faster than markers. LTTng 0.x uses tracepoints in combination with the marker infrastructure to have a faster way to write trace data to buffers, but it's more painful to use. > 3) trace_events. Sits on top of tracepoints. It provides description of probe callbacks that serializes data into the buffer that would otherwise need to be done by hand if using tracepoints directly. See include/trace/events/* and the comment at the bottom of include/linux/tracepoint.h. The old lttng 0.x uses only the "tracepoints" that are declared from the trace_event, without using the extra information from trace_event. LTTng 2.0 uses TRACE_EVENT extensively. > I saw that programming interface for usage each of these item is little > different. > What is the difference between these methods? Are they equivalent from > conceptual point of view? > I successfuly used markers and observed logged entries in LTTTV, but > have no success with trace_events. > > I use following versions: > - Linux kernel 2.6.33.2 (+ rt13 patch) > - lttng kernel patch 0.212 With this old kernel, the easiest way to add your own instrumentation would be markers. But it's also much slower. In these old versions, LTTng used markers as "description" of the payload, connecting tracepoints to markers with probes. In LTTng 2.0, markers are gone, leaving tracepoints and TRACE_EVENT. In lttng 2.0 kernel tracer, we only use TRACE_EVENT to describe instrumentation, which generates the probes. Mathieu > - lttctl 0.87 > - ltttv 0.12.36 > > Regards, > Piotr Romaniuk > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers Operating System Efficiency R&D Consultant EfficiOS Inc. http://www.efficios.com