[lttng-dev] Difference between markers, tracepoints and trace_events

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Tue Apr 10 11:28:29 EDT 2012


* 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



More information about the lttng-dev mailing list