看来是地址的计算方法出了问题。。。
对于内核知识的了解和编译调试工具的了解

紧跟上

dancefish posted @ 2010年10月13日 18:30 in 书摘 , 1482 阅读

好,这就把oprofile的机制分析一下,重点在于其地址分析机制。

至于调试的方法,可以考虑写一段可以自己打印偏移,或绝对地址加基地址的代码。

嵌到中断处理函数里即可,主要是要查清现场的状况。

 整个计算过程包括几点:内存image的分布,二进制文件的硬盘分布,二进制文件的装载。

PIC偏移地址到物理地址,再到虚拟地址的转换公式。

明白了这些你就可以成仙了。。。我觉得。

那就顺着oprofile的代码来吧。。。加油。

 

是oprofile很不给劲还是xx平台很不给劲呢?

反正oprofile在pc上跑的还算精明。。。

好吧,看看这个opreport是怎么了这是。。。反正看了一遍内核的机制是一点问题也没有。

从sample file和rc file出发好了。。。damn it。

opreport : No Sample files found ?

dmesg之后发现log还在。。。先把log去了。。。

并且要考虑下下一步的诊断方法了。。。sample file是怎么产生的?

一定要深入源码么?不,最好的方法是查看调试信息,log:

/var/lib/oprofile/xxxx , 并且发现,sample也在这里。

果不其然,问题在这里了。。。后悔莫及,早没想起看log来呢。。。

看下车祸现场吧:

 

oprofiled started Thu Oct 14 14:01:59 2010
kernel pointer size: 8
Lookup of cookie 98000000bd0058e0 failed, errno=22
Lookup of cookie 98000000bd007370 failed, errno=22
Lookup of cookie 98000000bd06eec0 failed, errno=22
Lookup of cookie 98000000bd11adf8 failed, errno=22
Lookup of cookie 98000000bd11b8e8 failed, errno=22
Lookup of cookie 98000000bd005368 failed, errno=22
Lookup of cookie 98000000937d1750 failed, errno=22
Lookup of cookie 98000000bd007d98 failed, errno=22
Lookup of cookie 98000000a817d368 failed, errno=22
Lookup of cookie 9800000093caf370 failed, errno=22
Lookup of cookie 98000000bd006178 failed, errno=22
Lookup of cookie 98000000bd06e948 failed, errno=22
Lookup of cookie 98000000a817e498 failed, errno=22
Lookup of cookie 9800000093b28940 failed, errno=22
Lookup of cookie 98000000bdccad30 failed, errno=22
Lookup of cookie 98000000bd007500 failed, errno=22

另一个 /var/lib/oprofile/samples/oprofiled.log 比较连贯,但是扔有丰富信息,只是非此次运行结果。同时注意到 /var/lib/oprofile/samples/current/下保存的数据库文件的命名还是很有讲究的。这些都是宝贵的线索。

perror 22 得到 invalid argument ,也就是说这个cookie发霉了?

先到内核里看一眼 invalid argument 的出处?

 

在oprofile/daemon/opd_cookie.c中发现,对sys_lookup_dcookie的调用跟具体的ABI有关,这是一个好问题呢。

在一个函数里怎么知道哪个函数调用了它呢?调用栈,play with it,关键是有相应的系统调用哈。

 

好在我一招釜底抽薪。。。这reset之后。。。当然了,就算是不reset也一样,就是再没有中断产生了。。。真的跟event buffer有关系咯?再看看,起码可以切换事件吧。。。

 

留意平时的调试行为,看看你每天是怎样调试的?

这样调试有什么缺陷?

有什么改进的想法?

Avatar_small
sk 说:
2021年7月29日 03:36

As a very satisfied customer not only with their products, but also their customer services, I’d definitely recommend this printing https://www.digitekprinting.com/direct-mail to my fellow colleagues.

Avatar_small
YOLO 说:
2021年11月22日 18:25

สมัคร igoal88win Commitment to service Stable financial


登录 *


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