How to Enable or configure ftrace module

9.3k views Asked by At

i'd like to use the advanced features of ftrace but i dit not figure out how. debugfs is mounted but there is no "tracing"-folder in /sys/kernel/debug. i am running a ARM-Target @ Angstrom distro build via yocto, please see :

Image: uname -a & lsb_release -a output

zcat /proc/config.gz | grep TRACER|FTRACE output

How to configure the kernel ? which options i have to set?

2

There are 2 answers

0
rk1825 On BEST ANSWER

Add below kernel config options in your yocto project conf/local.conf file & then clean & rebuild linux kernel.

KERNEL_CONFIG_DYNAMIC_FTRACE="y"
KERNEL_CONFIG_DEBUG_FS="y"
KERNEL_CONFIG_FTRACE="y"
KERNEL_CONFIG_FUNCTION_TRACER="y"
KERNEL_CONFIG_FUNCTION_GRAPH_TRACER="y"
KERNEL_CONFIG_IRQSOFF_TRACER="y"
KERNEL_CONFIG_PREEMPT_TRACER="y"
KERNEL_CONFIG_SCHED_TRACER="y"
KERNEL_CONFIG_STACK_TRACER="y"
KERNEL_CONFIG_BLK_DEV_IO_TRACE="y"
KERNEL_CONFIG_FUNCTION_PROFILER="y"
KERNEL_CONFIG_FTRACE_MCOUNT_RECORD="y"

Booting with this kernel shall have ftrace enabled

0
tapas rana On

ftrace can be enabled by adding the following in the kernel configuration params:

CONFIG_FUNCTION_TRACER=y
CONFIG_FUNCTION_GRAPH_TRACER=y
CONFIG_STACK_TRACER=y
CONFIG_DYNAMIC_FTRACE=y