I trace the execution of test_script and its child processes: trace-cmd record -p function -e function -c ./test_script In the above command, no "-l" option is used to filter functions. So will it trace all the functions invoked during the runtime? Unfortunately, I did not find the function A(executed certainly and not inline function) in the result of `trace-cmd report`. But when I use "-l A", that is, trace-cmd record -p function -e function -l A -c ./test_script Then I can find A in the result of `trace-cmd report`. Please let me know if you have any issues.
I'm currently traveling and may be slow to respond. I'll be back at my normal hours on Monday, June 10th. -- Steve
Hi Dongliang, Note, you do not need the "-e function". Just add "-p function" and all functions will be traced. You may find a "/sys/kernel/tracing/events/ftrace/function" but that's just for tools to know how to parse the function entry that is created by the "-p function". As for not seeing the function you want, it may be that it was lost in the noise. The function tracer is the most stressful tracing and usually fills up the ring buffer before the reader can capture and save all the functions. Thus you will see dropped events. That is shown during a trace-cmd record after tracing is finished: # trace-cmd record -p function cat /etc/passwd CPU 1: 580 events lost CPU 3: 1450 events lost CPU 4: 2175 events lost CPU 6: 13630 events lost CPU 7: 1160 events lost If the function you are looking for happens to be in one of those lost events, it will not be shown. -- Steve