https://www.ibm.com/developerworks/cn/linux/l-cn-ftrace1/
https://www.ibm.com/developerworks/cn/linux/l-cn-ftrace2/
https://www.ibm.com/developerworks/cn/linux/l-cn-ftrace3/index.html
http://blog.csdn.net/scarecrow_byr/article/details/17741809
https://zhuanlan.zhihu.com/p/22130013
#先關閉tracing
echo 0 > tracing_on
#清除trace
echo 1 > trace
#啟用function_graph
echo function_graph > current_tracer
echo function1 funtion2 > set_graph_function
#開啟tracing
echo 1 > tracing_on
#不確定要不要開
echo 1 > /proc/sys/kernel/stack_tracer_enabled
echo 1 > /proc/sys/kernel/ftrace_enabled
執行function
#查看執行結果和所花費時間
cat trace
#關閉tracing
echo 0 > tracing_on