[lttng-dev] tracing program flow
mathieu.desnoyers at efficios.com
Sun May 6 12:27:02 EDT 2012
* Alexandre Montplaisir (alexandre.montplaisir at polymtl.ca) wrote:
> On 12-05-06 01:17 AM, Chuck Tuffli wrote:
> > Hi -
> > I'm investigating the feasibility of replacing some home grown tracing
> > code with LTTng and am looking for advice from others who have used
> > LTTng to trace program flow (i.e. trace function entry and exit
> > points). One of the strengths of LTTng seems to be the ability to
> > selectively enable tracepoints of interest (much more useful than our
> > all-or-nothing tracing). To get this type of capability, would I need
> > to implement an entry and exit tracepoint for each function or is
> > there a better approach? Any other best practices people would be
> > willing to share? TIA.
> For now you'd have to create a custom probe for each function entry and
> There's a feature on the wishlist to use GCC hooks to automatically
> generate those probes . The end result would be the same, but it
> would be much less tedious to do the instrumentation part. A Clang
> plugin was also mentioned previously , but I don't think anybody has
> tried it yet.
Looking at how the Linux kernel implements function entry and exit
tracing is relevant here:
- kretprobes: using breakpoints, and boosted breakpoints.
- function tracer: based on gcc mcount instrumentation, replaced at
build time and runtime by nops/function call.
Ideally at some point, we might want to reimplement those in user-space
as a LTTng-UST library.
>  https://bugs.lttng.org/issues/39
>  http://lists.lttng.org/pipermail/lttng-dev/2012-April/017787.html
> Hope this helps,
> Alexandre Montplaisir
> DORSAL lab,
> École Polytechnique de Montréal
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
Operating System Efficiency R&D Consultant
More information about the lttng-dev