博客首页 注册 建议与交流 排行榜 加入友情链接
推荐 投诉 搜索: 帮助

Linux & Technology

邻窝 - http://muddoghole.spaces.live.com/
  muddogxp.cublog.cn

关于作者
姓名:muddog
职业:linux programer
年龄:24
位置:Suzhou
个性介绍:
|| << >> ||
我的分类


-fomit-frame-pointer and WCHAN
GCC 里经常碰到的option: -fomit-frame-pointer,意思是:
Don’t keep the frame pointer in a register for functions that don’t need one.  This avoids the instructions to save, set up and restore frame pointers; it also makes an extra register available in many functions.  It also makes debugging impossible on some machines.
其实就是在x86编译的时候忽略EBP, 在arm编译时忽略r11。这两个东东其实就是栈基地址。

kernel默认都是忽略fp,可以通过kernel debug选项开启。但是sched.c默认是用-fno-omit-frame-pointer 编译的,主要是由于/proc/<task>/wchan需要做栈回溯。
讨论见:http://kerneltrap.org/mailarchive/linux-kernel/2007/8/19/162308
内核分析见:http://weichong78.blogspot.com/2006/10/wchan-waiting-channel.html


发表于: 2008-07-23,修改于: 2008-07-23 16:46,已浏览76次,有评论0条 推荐 投诉


网友评论
 发表评论