Re: Ftrace: can trace kthread?

Figo.zhang
2010-10-21T09:03:09Z

> I just
> echo 0 > tracing_enabled
> echo function > current_tracer
> echo 374(pid of flush) > set_ftrace_pid
> echo 1 > tracing_enabled
> wait some time
> echo 0 > tracing_enabled
> cat trace
>
> So I think this answer your question "could kthread be traced?"

i do it the same of you.

[root@myhost tracing]# ps -ax | grep flush
Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
1205 ? S 0:01 [flush-8:0]
11852 pts/1 S+ 0:00 grep flush
[root@myhost tracing]#

so my flusher pid is 1205, i do it as below:

[root@myhost tracing]# echo 0 > tracing_enabled
[root@myhost tracing]# echo function > current_tracer
[root@myhost tracing]# echo 1205 > set_ftrace_pid
[root@myhost tracing]# echo 1 > tracing_enabled

wait ... and open some pdf files, let system eat huge memory...

[root@myhost tracing]# echo 0 > tracing_enabled
[root@myhost tracing]# cat trace
# tracer: function
#
# TASK-PID CPU# TIMESTAMP FUNCTION
# | | | | |

but i canot trace nothing.