android kernel function trace using ftrace?
Want to use the ftrace when we want to trace the kernel function of gs4.
So, I accepted the contents of here.
http://www.linuxforu.com/2010/11/kernel-tracing-with-ftrace-part-1/
mount -t debugfs nodev /sys/kernel/debug
When you enter the command, to come out as follows.
root@android:/sys/kernel/debug/tracing # mount -t debugfs nodev /nodev
/sys/kernel/debug
mount: Device or resource busy
Also,
root@android:/sys/kernel/debug/tracing # cat current_tracer
nop
root@android:/sys/kernel/debug/tracing # echo function > current_tracer
root@android:/sys/kernel/debug/tracing # cat current_tracer
nop
To come out like this.
root@android:/sys/kernel/debug/tracing # ls -al current_tracer
-rw-r--r-- root root 0 2013-08-27 20:32 current_tracer
Last update time will change, it is not possible to change the contents of
the currnet_tracer.
Of course, come out as follows.
root@android:/sys/kernel/debug/tracing # cat trace
# tracer: nop
#
# entries-in-buffer/entries-written: 0/0 #P:1
#
# _-----=> irqs-off
# / _----=> need-resched
# | / _---=> hardirq/softirq
# || / _--=> preempt-depth
# ||| / delay
# TASK-PID CPU# |||| TIMESTAMP FUNCTION
# | | | |||| | |
I can not change the currnet_tracer. tracing_on is capable of change.
root@android:/sys/kernel/debug/tracing # cat tracing_on
0
root@android:/sys/kernel/debug/tracing # echo 1 > tracing_on
root@android:/sys/kernel/debug/tracing # cat tracing_on
1
root@android:/sys/kernel/debug/tracing #
I can use the atrace, I come out information according to the
corresponding options as follows, want to trace the call to the kernel
function.
root@android:/sys/kernel/debug/tracing # atrace -s -w capturing trace <
/test/trace.txt
root@android:/sys/kernel/debug/tracing # cat /test/trace.txt
capturing trace... done
TRACE:
# tracer: nop
#
# entries-in-buffer/entries-written: 532/532 #P:1
#
# _-----=> irqs-off
# / _----=> need-resched
# | / _---=> hardirq/softirq
# || / _--=> preempt-depth
# ||| / delay
# TASK-PID CPU# |||| TIMESTAMP FUNCTION
# | | | |||| | |
atrace-22948 [000] ...2 623726.157067: sched_switch:
prev_comm=atrace prev_pid=22948 prev_prio=120 prev_state=S ==>
next_comm=AsyncTask #2 next_pid=21620 next_prio=130
....
I want to know how to change the current_tracer and how to mount by using
the debugfs.
To receive and grateful to help.
Thank!
No comments:
Post a Comment