[lttng-dev] How to user perf probes and module tracepoints in lttng
Francis Deslauriers
francis.deslauriers at efficios.com
Thu Oct 12 14:23:54 UTC 2017
2017-10-12 9:50 GMT-04:00 avkumar <anilzoom at gmail.com>:
> Francis,
> The suggestion you gave works, but the issue I was trying to solve was to be
> able to peer into the structures passed to the function and get some
> information from that. That is the reason I pulled out the variables in perf
> probe. When I use the way you have suggested I am not able to figure out how
> to get it to print the skb length and skb address. Is there a way to do it(
> skb is passed into those functions?)
Hi,
LTTng doesn't currently support saving variables and function
parameters on --probe (kprobe) and --function (kretprobe) events.
Thank you,
Francis
> Reg the trace point compile error:
> I figured that one out. I had to have the source files for the kernel to
> get that to work. I could not do with only header file for the kernel.
> Once I had the source files and set the KERNELDIR to the root of the source
> files ( compiled) it worked.
>
> Thanks
>
>
>
> On Wed, Oct 11, 2017 at 4:49 PM, Francis Deslauriers
> <francis.deslauriers at efficios.com> wrote:
>>
>> Hi,
>> 2017-10-11 17:10 GMT-04:00 avkumar <anilzoom at gmail.com>:
>> >
>> > Perf probes:
>> > How can we add the dynamic trace points created by perf probe into
>> > lttng? When I add the perf probe as kprobe type I get missing tracepoint
>> > error, If I add the perf probe as tracepoint , Lttng does not complain but
>> > it does not collect any data when the tracepoint is hit.
>> >
>> > perf probe -l
>> > probe:tcp_gro (on tcp_gro_receive at net/ipv4/tcp_offload.c with
>> > addr len)
>> >
>> > lttng enable-event -k --probe=tcp_gro
>>
>> First, you have to give your probe event a name.
>> Second, tcp_gro has to be a kernel symbol. According to the Perf
>> output above, the symbol name is `tcp_gro_receive` so the command you
>> want to run is:
>> lttng enable-event -k --probe=tcp_gro_receive EVENT_NAME
>>
>> > Error: Missing event name(s).
>> >
>> > When I add it as a trace point
>> >
>> > lttng enable-event -k probe:tcp_gro
>> > Kernel event probe:tcp_gro created in channel channel0]
>> >
>> > it does not give any error but no data is collected
>>
>> It's expected if you don't have a kernel tracepoint named
>> "probe:tcp_gro"(you probably don't) currently loaded in your kernel.
>> There is no error because there is no way for the kernel tracer if the
>> tracepoint is part of an not-yet-loaded kernel module or not.
>> "probe:tcp_gro" is a Perf specific description of the kprobe you
>> enabled. You can not directly reuse this description in the
>> lttng-enable-event command. To use the `lttng enable-event -k
>> TRACEPOINT`, try the `lttng list -k` command (with a lttng-sessiond
>> running as root) to list the currently available tracepoints.
>>
>> >
>> >
>> >
>> > Module tracepoints:
>> > I created module tracepoints in the kernel and compiled the trace
>> > points. The header file is in the driver module directory. When I write the
>> > adaptation layer for lttng, it does not compile as it is not able to fien
>> > the header file. I have given fill path name to the header file and still it
>> > does not work.
>>
>> Can you give us a bit more details. Could you send us a pastebin of
>> the error you get?
>>
>> Thank you,
>> Francis
>>
>> >
>> >
>> > Thanks
>> >
>> >
>> >
>> >
>> >
>> > _______________________________________________
>> > lttng-dev mailing list
>> > lttng-dev at lists.lttng.org
>> > https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>> >
>>
>>
>>
>> --
>> Francis Deslauriers
>> Software developer
>> EfficiOS inc.
>
>
--
Francis Deslauriers
Software developer
EfficiOS inc.
More information about the lttng-dev
mailing list