Linux Function Tracer Support


(Farzad Farshchi) #1

Does the Function Tracer (https://www.kernel.org/doc/Documentation/trace/ftrace.txt) work in RISC-V Linux?


(Paul Walmsley) #2

Yes, the function tracer does work. You may need to enable it in your kernel .config file (CONFIG_FUNCTION_TRACER=y) and rebuild the kernel. Once that’s done and you’ve booted into userspace, mount debugfs by running something like this as root:

mkdir -p /debug; mount -t debugfs none /debug

Change into the debug tracing directory:

cd /debug/tracing

The README virtual file in that “directory” describes how to use the debugfs tracing interface.


(Farzad Farshchi) #3

Thanks for your answer. My issue is I can’t find “available_filter_functions” and “set_graph_function” to filter the trace based on function name.


(Paul Walmsley) #4

Most likely the kernel that you’re using was built with CONFIG_FUNCTION_TRACER disabled.