[lttng-dev] 答复: Can lttng support kernel function tracer
Francis Deslauriers
francis.deslauriers at mail.utoronto.ca
Tue Feb 17 10:09:30 EST 2015
CCing lttng-dev back in the thread.
I might be wrong but I think that might be a usecase for a profiler
rather than a usecase for a tracer. Can someone else confirm?
To do that kind of work, you could compile your kernel with gprof support.
Thanks,
Francis
On Tue, Feb 17, 2015 at 3:38 AM, zhenyu.ren <zhenyu.ren at aliyun.com> wrote:
> Hi,Francis
> In fact, I want to trace all kernel functions related to some
> behavior.For example,I write() and it returns 100ms later ,so I want to
> know which kernel function is too slow. In this case,I can use function
> tracer to trace "all" kernel function in the write() time window.However,I
> want to know is it possible that lttng can be useful in this case.
>
> Thanks
> zhenyu.ren
>
>
> ------------------------------------------------------------------
> 发件人:Francis Deslauriers <francis.deslauriers at mail.utoronto.ca>
> 发送时间:2015年2月17日(星期二) 00:53
> 收件人:zhenyu.ren <zhenyu.ren at aliyun.com>
> 抄 送:lttng-dev <lttng-dev at lists.lttng.org>
> 主 题:Re: [lttng-dev] Can lttng support kernel function tracer
>
> Hi Zhenyu,
>
> If I understandd your question correctly, I can think of two ways to
> trace an arbitrary kernel function. First, you can hook the tracer on
> a dynamic probe[1] using something like this:
> "lttng enable-event customEventName -k --probe kernelFunctionName".
> You can also hook the tracer on both entry and exit of a function
> using "--function" instead of "--probe".
> To list your kernel symbols use "cat /proc/kallsyms"
> Second, you can create custom kernel tracepoints and compile them in
> you kernel. Have a look at the online documentation [2].
>
> Don't hesitate to explain further if this doesn't answer your question.
>
> Cheers!
> Francis
>
> [1]
> http://git.lttng.org/?p=lttng-tools.git;a=blob;f=doc/quickstart.txt;h=018c27b2b939ef7cd075255fd01bcfd8b2b21b1e;hb=HEAD#l93
> [2] http://lttng.org/docs/#doc-instrumenting-linux-kernel-itself
>
> On Thu, Feb 12, 2015 at 7:49 PM, zhenyu.ren <zhenyu.ren at aliyun.com> wrote:
>> Hi,
>>
>> It's well known that lttng can make use of kernel tracepoints to do block
>> tracing ,system call tracing etc.Is it possible that lttng can produce
>> anything like kernel function tracer does?
>>
>> Thanks
>> zhenyu.ren
>>
>> _______________________________________________
>> lttng-dev mailing list
>> lttng-dev at lists.lttng.org
>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
More information about the lttng-dev
mailing list