linux 11.29-2

Ftrace
http://www.uini.net/2010/06/linux-kernel-debug-using-the-ftrace-part-3.html
http://www.uini.net/2010/06/linux-kernel-debug-using-the-ftrace-part-2.html

高级点的使用技巧:

Secrets of the Ftrace function tracer
http://lwn.net/Articles/370423/

Debugging the kernel using Ftrace

http://lwn.net/Articles/365835/

http://lwn.net/Articles/366796/


一次打多个补丁:
$ for p in ARM_ftrace_enable_dynamic_ftrace/*; do patch -p1 < $p ; done

diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
index 13e13d4..e10519f 100644
--- a/kernel/trace/Kconfig
+++ b/kernel/trace/Kconfig
@@ -124,7 +124,7 @@
if FTRACE
config FUNCTION_TRACER
bool "Kernel Function Tracer"
depends on HAVE_FUNCTION_TRACER
- select FRAME_POINTER
+ select FRAME_POINTER if (!ARM_UNWIND)

select KALLSYMS
select GENERIC_TRACER
select CONTEXT_SWITCH_TRACER

revert 上面的补丁即可解决下面的错误:
#error Ftrace requires CONFIG_FRAME_POINTER=y with GCC older than 4.4.0 .


# echo soc_pcm_open > set_ftrace_filter
# cat set_ftrace_filter
soc_pcm_open
# echo * > set_ftrace_filter
# cat set_ftrace_filter
#### all functions enabled ####

# cat set_ftrace_filter
#### all functions enabled ####
soc_pcm_open:traceon:unlimited
# echo '!soc_pcm_open:traceon' > set_ftrace_filter
# cat set_ftrace_filter
#### all functions enabled ####


function:command[:count]

This will execute the command at the start of the function . The command is either traceon or traceoff , and an optional count can be added to have the command only execute a given number of times. If the count is left off (including the leading colon) then the command will be executed every time the function is called.

# echo 1 > tracing_on (traceon )
# echo 0 > tracing_on (traceoff )

There are two functions that work well inside the kernel:
tracing_on() and tracing_off() . These two act just like
echoing "1" or "0" respectively into the tracing_on file .


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值