聪明的工程师

 

void MacroAssembler::Swap(Register reg1,
                          Register reg2,
                          Register scratch,
                          Condition cond) {
  if (scratch.is(no_reg)) {
    eor(reg1, reg1, Operand(reg2), LeaveCC, cond);
    eor(reg2, reg2, Operand(reg1), LeaveCC, cond);
    eor(reg1, reg1, Operand(reg2), LeaveCC, cond);
  } else {
    mov(scratch, reg1, LeaveCC, cond);
    mov(reg1, reg2, LeaveCC, cond);
    mov(reg2, scratch, LeaveCC, cond);
  }
}

夜读V8 之 Assembler

RelocInfo?一开始我觉得跟Repatch代码有关系。

现在看来,没什么太多的关系?

那么,RelocInfo是什么时候用的?

代码不需要Repatch么?

qemu 备忘

 

mount -o loop,offset=32256 /home/kevin/qemu-disk-image.raw /media/qemu/
这个offset = 32256 很招人恨呢。
 
qemu-system-mips -M malta -kernel vmlinux-2.6.26-1-4kc-malta -hda debian_lenny_mips_small.qcow2 -append "root=/dev/hda1 console=ttyS0" -nographic   -hdb ./hd.img 
 
启动命令

- 未命名 -

 

《如果》……吉卜林

 

如果你能相信自己, 当所有人怀疑你
但且让他们怀疑去吧, 
如果你遭等待, 却不因等待而疲倦, 
或者遭受欺骗, 却不用谎言回敬, 
或者遭到憎恨, 却不用憎恨反击, 
能够不得意忘形, 也能够不巧言令色…… 

如果你能与凡人交谈, 且彬彬有礼, 
或与国王同行—— 而不奴颜婢膝, 
如果仇敌和密友都无法伤害你;
如果你在乎每个人, 但不会缺了谁就不行, 
如果你在想发泄愤怒的那一分钟去进行六十秒的跑步, 
大地以及大地上的万物都将属于你, 
而更重要的是, 你将是真正的男人, 我的孩子!

 

Render Hierarch

 

Class hierarchy

* RenderObject

  • RenderSVGGradientStop
  • RenderSVGModelObject
  • RenderText
    • RenderBR
    • RenderCounter
    • RenderTextControlMultiLine
    • RenderTextControlSingleLine
    • RenderSVGInlineText
    • RenderTextFragment
    • RenderWordBreak
  • RenderBoxModelObject
    • RenderBox
      • RenderBlock
        • MediaControlElements
        • RenderDataGrid
        • RenderFieldset
        • RenderFileUploadControl
        • RenderFlexibleBox
        • RenderIndicator
        • RenderListBox
        • RenderListItem
        • RenderRubyBase
        • RenderRuby
        • RenderRubyRun
        • RenderRubyText
        • RenderScrollba
        • RenderSlider
        • RenderSVGBlock
        • RenderTableCell
        • RenderTable
        • RenderTextControl
        • RenderView
      • RenderFrameSet
      • RenderListMarker
      • RenderReplica
      • RenderReplaced
        • RenderHTMLCanvas
        • RenderImage
        • RenderWidget
      • RenderTableCol
      • RenderTableRow
      • RenderTableSection
      • RenderSVGRoot
    • RenderInline
      • RenderSVGInline
      • RenderRuby
      •  

想要的软件

也许,pc将要被移动设备所取代了,键盘和鼠标将从世界上消失。取而代之的是云和终端。

只是觉得云现在还没有很多的针对个人,所以应用程序也不多。

下了几款todo软件,都不是很合适,最好的应该算是evernote了,但是缺乏todo的提醒和调度机制。

我希望一个更集成的软件,有push提醒,可以在桌面看到。。。(这个功能很关键,就像工作室里贴的条子,tags)

看到的亮点是几乎所有todo都可以跨平台的提供云服务了。

eh

eh两个字放在一起。。。就是exception handler的意思。

数据流说

哥早就说过,程序和计算的本质,是让数据顺畅的流通和变换。

这点在写一个流媒体或者摄像头程序的时候会体会的很明显。

但是有了一些经历后就会发现其实所有的程序都不例外。

这是一个非常重要的角度,只是没个程序的侧重不同,随之而来的瓶颈也会不同。

有的程序侧重数据的传输,瓶颈会出在内存或者介质一层。

有的程序侧重数据的处理,瓶颈就会出现在cpu内部。

对于内核知识的了解和编译调试工具的了解

有了这些基础,怎样改进系统级调试和诊断的方法。

使用什么样的理念来改善这方面的工具创新,一直是个问题。

还有一个问题我想不起来了。。。。

貌似是,哥早就说过,对proc和内核自诊断系统的了解是至关重要的。

而且非常方便滴。

紧跟上

好,这就把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有关系咯?再看看,起码可以切换事件吧。。。

 

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

这样调试有什么缺陷?

有什么改进的想法?