Skip to contentSkip to conversation

Viewing existing kernel tracepoints with LTTng

DISCUSSION Francis Giraldeau 2 participants 2 messages Dec 15, 2013 – Dec 16, 2013 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 5 lines · Amit Schreiber

Hi,

I started integrating LTTng into my code, and thought that existing tracepoints (which are visible with perf) will be immediately visible to LTTng. I obviously misunderstood or am doing something wrong.

What's the correct way to have existing perf tracepoints seen by LTTng?

LTTng adds probes to existing tracepoints in the kernel. Under the hood, LTTng probe modules call tracepoint_probe_register() to add a callback when the tracepoint is enabled. You can thus hook to any tracepoint defined in the kernel, provided that the probe function have the right signature. In the case of LTTng, the probe writes an event in the ring buffer.

To make things safer and add type checking at compile-time, LTTng defines the probe code with macros. In fact, all the module's probe code is generated. Each tracepoint in the kernel must also have an LTTng probe to be listed, and this is the proper way to do it. For the detail, refer to the "probe" directory of lttng-modules.

Cheers,

Francis

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

----------------------------------------

Quoted 26 lines

Date: Sun, 15 Dec 2013 17:49:40 -0500
From: [email protected]
To: [email protected]
CC: [email protected]
Subject: Re: [lttng-dev] Viewing existing kernel tracepoints with LTTng

Quoted 5 lines · Amit Schreiber

Hi,

I started integrating LTTng into my code, and thought that existing tracepoints (which are visible with perf) will be immediately visible to LTTng. I obviously misunderstood or am doing something wrong.

What's the correct way to have existing perf tracepoints seen by LTTng?

LTTng adds probes to existing tracepoints in the kernel. Under the hood, LTTng probe modules call tracepoint_probe_register() to add a callback when the tracepoint is enabled. You can thus hook to any tracepoint defined in the kernel, provided that the probe function have the right signature. In the case of LTTng, the probe writes an event in the ring buffer.

To make things safer and add type checking at compile-time, LTTng defines the probe code with macros. In fact, all the module's probe code is generated. Each tracepoint in the kernel must also have an LTTng probe to be listed, and this is the proper way to do it. For the detail, refer to the "probe" directory of lttng-modules.

Quoted 4 lines

Cheers,

Francis

Thanks a lot, Francis. I appreciate the help and quick response.

Amit