It's not necessary to understand in detail how the kernel function tracer works in order to use it or to do kernel development, but it is a pretty neat piece of code even so.
The
kernel/trace
directory contains general tracing code.
The
include/linux/ftrace.h
header file provides the function tracer interface.
The
kernel/trace/ftrace.c
file implements architecture independent function tracer infrastructure.
The
arch/arm/kernel/ftrace.c
file provides ARM architecture specific
function tracer code.