7
22
2014
2

dmesg 总结

1.dmesg介绍

在dmesg里我们可以查看到开机信息,printk产生的信息等。若研究内核代码,在代码中插入printk函数,然后通过dmesg观察是一个很好地方法。

 

2.dmesg输出含义

dmesg 输出的数字含义是什么,纠结了一会儿,下面给出解释

终端输入dmesg,可以看到每行最开始显示的是一个综括号,里面的数字为timestamp,时间戳,该时间指示的系统从开机到现在的运行时间,单位为s 秒。

 

图1

 

3.dmesg -c

  在显示的同时,clean掉dmesg缓存中信息

4.dmesg -T

  以当前时间的方式显示时间信息,而不是图1所示的开机时间

 

图2

 

3 dmesg -d 

显示dmesg中两条打印信息的时间间隔

 

图3

 

我们可以计算,上一行的时间戳 + 下一行的间隔 = 下一行的时间戳

例如:第一行和第二行,1069.638561 + 0.000003 = 1069.638564  这里的时间单位为秒

 

4.dmesg -d -T

-d和-T参数混合使用,效果可想而知

 

图4

 

5.dmesg | tail 显示dmesg最近一次的输出

 

由上面我们可以看到dmesg可以让我们获得很多信息,包括函数进入时间等,可以利用dmesg原本已有的功能进行辅助分析。dmesg 很~\(≧▽≦)/~赞

Category: Linux | Tags: | Read Count: 12227
Avatar_small
kelloggs family rewa 说:
2022年8月26日 00:40

Kellogg's Family Rewards 2021 :These free Kellogg's Family Rewards codes will help you fill your mailbox with free stuff that you use your points to redeem. This includes free gift cards, toys A LITTLE MORE OF WHAT YOU LOVE. kelloggs family rewards NEW Rice Krispies Treats® Homestyle Original and Chocolate bars are 50% bigger than our 22g Original bar 2021.

Avatar_small
TN SSLC Question Pap 说:
2022年8月26日 14:37

Tamil Nadu Government Model Question Papers for the SSLC, and Tamil Nadu 10th Model Question Papers 2023 TNDGE 10th Quarterly Exam Original Question Papers. TN Board Private SSLC Model Question Paper that you will TN SSLC Question Paper 2023 receive Tamil model test questions for the 10th grade in Tennessee You no longer need to look everywhere for question papers or other exam-related documents thanks to the TN 10th Model Paper 2023 and TN SSLC Important Question Paper 2023 in Tamil, English, and Hindi. Learn more about Tamil Nadu SSLC Exams Question Papers by reading the article.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter

Host by is-Programmer.com | Power by Chito 1.3.3 beta | Theme: Aeros 2.0 by TheBuckmaker.com