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//wchan需要做栈回溯。
讨论见:
内核分析见:http://weichong78.blogspot.com/2006/10/wchan-waiting-channel.html
阅读(3318) | 评论(0) | 转发(0) |