I am trying to setup ftrace on a linux based android platform. I did the initial setups by enabling these below configs.
CONFIG_FUNCTION_TRACER
CONFIG_FUNCTION_GRAPH_TRACER
CONFIG_STACK_TRACER
CONFIG_DYNAMIC_FTRACE
Built it and trying to see if it is working. But, I don't get any outputs from "trace". Inside the shell, I am trying the following. Can you please help find out what is missing to make it work?
mount -t debugfs debugfs /sys/kernel/debug/
cd /sys/kernel/debug/tracing/
/sys/kernel/debug/tracing # echo 1 > /proc/sys/kernel/ftrace_enabled
/sys/kernel/debug/tracing # echo function > current_tracer
echo function > current_tracer
/sys/kernel/debug/tracing # echo 1 > tracing_enabled
echo 1 > tracing_enabled
/sys/kernel/debug/tracing # echo 1 > tracing_on
echo 1 > tracing_on
/sys/kernel/debug/tracing # cat trace
cat trace
# tracer: function
#
# TASK-PID CPU# TIMESTAMP FUNCTION
# | | | | |
Debugging the kernel using Ftrace - part 1 - ftrace help needed
Posted Jul 16, 2012 20:12 UTC (Mon) by SwamiS (guest, #85527)
[Link]
Solution:
Tried multiple things and it was not working. Finally, got to know that removing "STRICT_MEMORY_RWX" Kernel config help solve the problem and I was able to do function tracing.