您的位置:首页 > 运维架构 > Linux

Linux 内核堆栈打印函数

2013-11-11 23:09 423 查看


linux kernel 里面打印堆栈的函数

调用dump_stack()就会打印当前cpu的堆栈的调用函数了。参考内核源代码

arch/x86_64/kernel/traps.c

/*

* The architecture-independent dump_stack generator

*/

void dump_stack(void)

{

unsigned long dummy;

show_trace(&dummy);

}

/*

* When in-kernel, we also print out the stack and code at the

* time of the fault..

*/

if (in_kernel) {

printk("Stack: ");

show_stack(NULL, (unsigned long*)rsp);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: