博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
linux内核打印堆栈信息_如何在Linux内核中输出函数堆栈
阅读量:2524 次
发布时间:2019-05-11

本文共 1329 字,大约阅读时间需要 4 分钟。

linux内核打印堆栈信息

In Kernel, we usually / what kind of events will trigger the phenomena we find in the system. For example, what kind of event will trigger the fact that the timeslice of one process will be very short. In order to solve these kind of problems, we need to output the function stack.

在内核中,我们通常 / 什么样的事件将触发我们在系统中发现的现象。 例如,什么样的事件将触发一个过程的时间片很短的事实。 为了解决这类问题,我们需要输出函数堆栈。

Currently, there are two easy ways to solve this question.

1, Add some output information in each function before that phenomena happens so that you can find what kind of events may trigger it. However, sometimes, in complex system (like Linux kernel), something happens with no clues and we may lose in the sky. Way 2 will make this solution better.

当前,有两种简单的方法可以解决此问题。

1,在现象发生之前,在每个函数中添加一些输出信息,以便您可以找到可能触发该事件的事件。 但是,有时,在复杂的系统(如Linux内核)中,发生的事情毫无头绪,我们可能会蒙上阴影。 方法2将使此解决方案更好。

2, Call the function to output the call stack before the phenomena. In Linux kernel, just call dump_stack() function and you will find your way. Dump_stack() in Linux Kernel is used to output call stack information when there is a kernel crash/panic but we can also use it for debugging/tracing.

2,调用函数在现象发生之前输出调用栈。 在Linux内核中,只需调用dump_stack()函数,您就会找到自己的方式。 当内核崩溃/出现紧急情况时,Linux内核中的Dump_stack()用于输出调用堆栈信息,但我们也可以将其用于调试/跟踪。

Answered by harryxiyou.
由harryxiyou回答。

翻译自:

linux内核打印堆栈信息

转载地址:http://bmlwd.baihongyu.com/

你可能感兴趣的文章
学习进度
查看>>
“此人不存在”
查看>>
github.com加速节点
查看>>
解密zend-PHP凤凰源码程序
查看>>
python3 序列分片记录
查看>>
Atitit.git的存储结构and 追踪
查看>>
atitit 读书与获取知识资料的attilax的总结.docx
查看>>
B站 React教程笔记day2(3)React-Redux
查看>>
找了一个api管理工具
查看>>
使用Postmark测试后端存储性能
查看>>
NSTextView 文字链接的定制化
查看>>
第五天站立会议内容
查看>>
ATMEGA16 IOport相关汇总
查看>>
JAVA基础-多线程
查看>>
面试题5:字符串替换空格
查看>>
[Codevs] 线段树练习5
查看>>
Amazon
查看>>
component-based scene model
查看>>
Echart输出图形
查看>>
hMailServer搭建简单邮件系统
查看>>