mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* When and how to use ftrace?
@ 2010-06-09  1:38 Ryan Wang
  2010-06-09  2:42 ` Steven Rostedt
  0 siblings, 1 reply; 6+ messages in thread
From: Ryan Wang @ 2010-06-09  1:38 UTC (permalink / raw)
  To: linux-kernel, kernelnewbies, srostedt

Hi all,

       I'm new to kernel development, and I'm learning
ftrace recently. I have one question:
       When to use ftrace, or in which cases ftrace can be
more efficient?

thanks,

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: When and how to use ftrace?
  2010-06-09  1:38 When and how to use ftrace? Ryan Wang
@ 2010-06-09  2:42 ` Steven Rostedt
  2010-06-09  5:32   ` Ryan Wang
  0 siblings, 1 reply; 6+ messages in thread
From: Steven Rostedt @ 2010-06-09  2:42 UTC (permalink / raw)
  To: Ryan Wang; +Cc: linux-kernel, kernelnewbies

On Wed, 2010-06-09 at 09:38 +0800, Ryan Wang wrote:
> Hi all,
> 
>        I'm new to kernel development, and I'm learning
> ftrace recently. I have one question:
>        When to use ftrace, or in which cases ftrace can be
> more efficient?

I can't really answer these questions without knowing what you want to
do?

ftrace allows you to see what is happening inside the kernel. What would
you like to see?

-- Steve



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: When and how to use ftrace?
  2010-06-09  2:42 ` Steven Rostedt
@ 2010-06-09  5:32   ` Ryan Wang
       [not found]     ` <AANLkTik4kdjh1Wmo704_3-jzxmMUd8vGce9Mdojveml1@mail.gmail.com>
  0 siblings, 1 reply; 6+ messages in thread
From: Ryan Wang @ 2010-06-09  5:32 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: linux-kernel, kernelnewbies

2010/6/9 Steven Rostedt <srostedt@redhat.com>:
> On Wed, 2010-06-09 at 09:38 +0800, Ryan Wang wrote:
>> Hi all,
>>
>>        I'm new to kernel development, and I'm learning
>> ftrace recently. I have one question:
>>        When to use ftrace, or in which cases ftrace can be
>> more efficient?
>
> I can't really answer these questions without knowing what you want to
> do?
>
> ftrace allows you to see what is happening inside the kernel. What would
> you like to see?
>
> -- Steve
>
>
>

I really want to know is the differences between ftrace and other kernel debug
tools such as kdump, kdb, etc.

thanks!

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: When and how to use ftrace?
       [not found]     ` <AANLkTik4kdjh1Wmo704_3-jzxmMUd8vGce9Mdojveml1@mail.gmail.com>
@ 2010-06-09  8:14       ` Ryan Wang
  2010-06-09  8:59         ` wu zhangjin
  0 siblings, 1 reply; 6+ messages in thread
From: Ryan Wang @ 2010-06-09  8:14 UTC (permalink / raw)
  To: Neependra Khare; +Cc: Steven Rostedt, linux-kernel, kernelnewbies

2010/6/9 Neependra Khare <neependra.khare@gmail.com>:
>
>
> On Wed, Jun 9, 2010 at 11:02 AM, Ryan Wang <openspace.wang@gmail.com> wrote:
>>
>> I really want to know is the differences between ftrace and other kernel
>> debug
>> tools such as kdump, kdb, etc.
>
> Lets say you want to know what ext2/ext3/ext4 functions are called when you
> run mkdir command on ext2/ext3/ext4 mounted filesystem. Then you can trace
> each kernel function with ftrace.
>
> Articles on ftrace:-
> http://lwn.net/Articles/365835/
> http://lwn.net/Articles/366796/
>
> With kdump you get memory dump of currently running kernel and then you
> debug it.
> kdb will help you to debug the currently running kernel.
>
> I hope this clears some of your doubts.
>
> Regards,
> Neependra
>
>>
>> thanks!
>>
>> --
>> To unsubscribe from this list: send an email with
>> "unsubscribe kernelnewbies" to ecartis@nl.linux.org
>> Please read the FAQ at http://kernelnewbies.org/FAQ
>>
>
>

Seems ftrace is helpful to study the activities inside the kernel to me.
I wonder whether it can be useful to debug kernel bugs. And if so, will
you please give me some examples? Or so far it's mainly used for
observing the running status of kernel?

thanks,

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: When and how to use ftrace?
  2010-06-09  8:14       ` Ryan Wang
@ 2010-06-09  8:59         ` wu zhangjin
  2010-06-09  9:22           ` Ryan Wang
  0 siblings, 1 reply; 6+ messages in thread
From: wu zhangjin @ 2010-06-09  8:59 UTC (permalink / raw)
  To: Ryan Wang; +Cc: Neependra Khare, Steven Rostedt, linux-kernel, kernelnewbies

Hi,

On Wed, Jun 9, 2010 at 4:14 PM, Ryan Wang <openspace.wang@gmail.com> wrote:
[...]
>>>
>>> --
>>> To unsubscribe from this list: send an email with
>>> "unsubscribe kernelnewbies" to ecartis@nl.linux.org
>>> Please read the FAQ at http://kernelnewbies.org/FAQ
>>>
>>
>>
>
> Seems ftrace is helpful to study the activities inside the kernel to me.
> I wonder whether it can be useful to debug kernel bugs. And if so, will
> you please give me some examples?

Yeah, did you read this paper written by Steven: "Finding Origins of
Latencies Using Ftrace" (please google to download it).
If not, please read it. that paper will tell you what Ftrace really is
and will show the demos how to play with it.

> Or so far it's mainly used for
> observing the running status of kernel?

Ftrace is originally created for debugging and optimizing the
preempt-rt, but of course, it becomes a tracing framework currently.

It not only show you what the kernel space does when you do something
in user space,
but will show you the calling tree of kernel functions, time consuming
of  every function and
even allow you to filter the parts you care about.

If you need more info about it, please refer to:

[1] Debugging the kernel using Ftrace
http://lwn.net/Articles/365835/
http://lwn.net/Articles/366796/
[2] Ftrace usage ....
Documentation/trace/ftrace.txt
Documentation/trace/ftrace-desgin.txt
[3] Tools for Ftrace
trace-cmd from readhat...

Regards,

-- 
Studying engineer. Wu Zhangjin
Lanzhou University      http://www.lzu.edu.cn
Distributed & Embedded System Lab      http://dslab.lzu.edu.cn
School of Information Science and Engeneering         http://xxxy.lzu.edu.cn
wuzhangjin@gmail.com         http://falcon.oss.lzu.edu.cn
Address:Tianshui South Road 222,Lanzhou,P.R.China    Zip Code:730000
Tel:+86-931-8912025

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: When and how to use ftrace?
  2010-06-09  8:59         ` wu zhangjin
@ 2010-06-09  9:22           ` Ryan Wang
  0 siblings, 0 replies; 6+ messages in thread
From: Ryan Wang @ 2010-06-09  9:22 UTC (permalink / raw)
  To: wu zhangjin; +Cc: Neependra Khare, Steven Rostedt, linux-kernel, kernelnewbies

2010/6/9 wu zhangjin <wuzhangjin@gmail.com>:
> Hi,
>
> On Wed, Jun 9, 2010 at 4:14 PM, Ryan Wang <openspace.wang@gmail.com> wrote:
> [...]
>>>>
>>>> --
>>>> To unsubscribe from this list: send an email with
>>>> "unsubscribe kernelnewbies" to ecartis@nl.linux.org
>>>> Please read the FAQ at http://kernelnewbies.org/FAQ
>>>>
>>>
>>>
>>
>> Seems ftrace is helpful to study the activities inside the kernel to me.
>> I wonder whether it can be useful to debug kernel bugs. And if so, will
>> you please give me some examples?
>
> Yeah, did you read this paper written by Steven: "Finding Origins of
> Latencies Using Ftrace" (please google to download it).
> If not, please read it. that paper will tell you what Ftrace really is
> and will show the demos how to play with it.
>
>> Or so far it's mainly used for
>> observing the running status of kernel?
>
> Ftrace is originally created for debugging and optimizing the
> preempt-rt, but of course, it becomes a tracing framework currently.
>
> It not only show you what the kernel space does when you do something
> in user space,
> but will show you the calling tree of kernel functions, time consuming
> of  every function and
> even allow you to filter the parts you care about.
>
> If you need more info about it, please refer to:
>
> [1] Debugging the kernel using Ftrace
> http://lwn.net/Articles/365835/
> http://lwn.net/Articles/366796/
> [2] Ftrace usage ....
> Documentation/trace/ftrace.txt
> Documentation/trace/ftrace-desgin.txt
> [3] Tools for Ftrace
> trace-cmd from readhat...
>
> Regards,
>
> --
> Studying engineer. Wu Zhangjin
> Lanzhou University      http://www.lzu.edu.cn
> Distributed & Embedded System Lab      http://dslab.lzu.edu.cn
> School of Information Science and Engeneering         http://xxxy.lzu.edu.cn
> wuzhangjin@gmail.com         http://falcon.oss.lzu.edu.cn
> Address:Tianshui South Road 222,Lanzhou,P.R.China    Zip Code:730000
> Tel:+86-931-8912025
>

Thanks all!

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-06-09  9:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-09  1:38 When and how to use ftrace? Ryan Wang
2010-06-09  2:42 ` Steven Rostedt
2010-06-09  5:32   ` Ryan Wang
     [not found]     ` <AANLkTik4kdjh1Wmo704_3-jzxmMUd8vGce9Mdojveml1@mail.gmail.com>
2010-06-09  8:14       ` Ryan Wang
2010-06-09  8:59         ` wu zhangjin
2010-06-09  9:22           ` Ryan Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®