I am learning ftrace, I read from the following link that I can enable function profiling using the 'function_profile_enabled' file.

mount -t tracefs nodev /sys/kernel/tracing
cd /sys/kernel/tracing
echo 1 > function_profile_enabled
echo "function" > current_tracer


The above link tells that the information is present in trace_stats/function (function0, function1..)

$ ls trace_stat/function*
trace_stat/function0   trace_stat/function15  trace_stat/function21  trace_stat/function28  trace_stat/function6
trace_stat/function1   trace_stat/function16  trace_stat/function22  trace_stat/function29  trace_stat/function7
trace_stat/function10  trace_stat/function17  trace_stat/function23  trace_stat/function3   trace_stat/function8
trace_stat/function11  trace_stat/function18  trace_stat/function24  trace_stat/function30  trace_stat/function9
trace_stat/function12  trace_stat/function19  trace_stat/function25  trace_stat/function31
trace_stat/function13  trace_stat/function2   trace_stat/function26  trace_stat/function4
trace_stat/function14  trace_stat/function20  trace_stat/function27  trace_stat/function5
root tracing

I only have 4 cores on my Ubuntu VM

$ grep -c ^processor /proc/cpuinfo     

Can anyone explain me the actual significance of this file function<> in trace_stat folder functions folder in trace_stat folder


Those files are created by a loop over "for_each_possible_cpu()". For some reason, your kernel thinks your system has 32 possible CPUs enabled. There's been some issues with some bios that causes that.

New contributor
nevets is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.