jfo planet

Hope is the best gift that tomorrow gives.

  • 首页
  • 分类
  • 归档
  • 标签
  • 搜索
close

利用core文件调试

发表于 2007-11-20   |   分类于 Linux Debug
首先用-g选项编译程序,然后用ulimit -c unlimited打开core文件限制to make the changes permanent, add the following line to /etc/sysctl.conf:kernel.core_pattern = core.%e.%psysctl is a similar tool to ulimit: It allows to configure kernelparameters at runtime. If you wish to keep settings persistent acrossreboots you should edit /etc/sysctl.conf - be aware that wrong settingsmay break things in unforeseen ways.用/proc/sys/kernel/core_pattern控制core文件产生的地方在测试站上root: cat /proc/sys/kernel/corepattern/tmp/core.%p%e也就是说,所有c ...
阅读全文 »

【zz】__cyg_profile_func_enter、pvtrace、Graphviz 可视化函数调用

发表于 2007-11-19   |   分类于 Linux Debug
http://www-128.ibm.com/developerworks/cn/linux/l-graphvis/跟踪函数调用cyg_profile_func_entercyg_profile_func_exitgcc -g -finstrument-functions test.c -o test生成函数调用关系表示(.dot文件)pvtrace a.out需要trace.txt文件(在cyg_profile_func_enter/exit中生成)E0x80487d6X0x80487d6E0x80489bfX0x80489bf。。。。生成图形dot -Tjpg test.dot -o test.jpg对unifiedkernel中运行notepad时 ntdll.dll.so 的函数调用map: 用 Graphviz 可视化函数调用 使用开源软件来简化复杂调用结构 级别: 初级 M. Tim Jones (), 资深软件工程师, Emulex 2005 年 7 月 11 日 花一 ...
阅读全文 »

example for 从程序员角度看ELF

发表于 2007-11-19   |   分类于 gcc/binutils/make/共享库
This example make full use of the output of gcc -v, we link all files from scratch.the source code: /////////////////////////////////////////////////////////////////// //test.c #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <dlfcn.h> #include <string.h> #include <mcheck.h> const char dynamic_linker[] attribute ((section (". ...
阅读全文 »

linux debug : addr2line追踪出错地址

发表于 2007-11-19   |   分类于 Linux Debug
http://www.xxlinux.com/linux/article/accidence/technique/20070125/7209.html        调 试zSeries上的Linux应用程序类似于调试其他体系结构上的Linux应用程序。对于有经验的Linux开发人员,最大的挑战是理解新的系统体系 结构。对于刚接触Linux的大型机开发人员,掌握新的调试工具似乎是一项令人畏惧的任务。不要害怕。本文将提供一些有用的提示来帮助您入门。 学问来自实践,但是对于调试工具,在没有出现问题而迫使您去修复它们之前,“实践”是不会发生的。考虑到这点,下面将提供让您入门的“速成”指南。 User Debug 日志记录 调试一个崩溃的程序的第一步是弄清哪里出了错。zSeries 上的Linux内核具有这样一个内置特性,它在用户进程崩溃时记录一些基本的调试信息。要启用这个特性,请以 root 用户身份执行如下命令: 当某个进程崩溃时,日志文件(/var/log/message ...
阅读全文 »

relayfs examples

发表于 2007-11-18   |   分类于 Linux Debug
NOTE: As of relay-apps-0.90, the ‘relay-app’ pseudo-framework has been removed and all examples have been made standalone. i.e. for the time being, ignore the ‘relay_app_XXX’ parts of the code on this page and look at the examples directly. The website will be updated to reflect these changes soon… Examples The following examples show how relayfs can be used to create ‘quick and dirty’ kernel logging applications, in a number of different ways. They don’t attempt to be exhaustive or delve in ...
阅读全文 »

What happens when a KProbe/JProbe is hit?

发表于 2007-11-18   |   分类于 Linux Debug
What happens when a KProbe is hit? The steps involved in handling a probe are architecture dependent; they are handled by the functions defined in the file arch/i386/kernel/kprobes.c. After the probes are registered, the addresses at which they are active contain the breakpoint instruction (int3 on x86). As soon as execution reaches a probed address the int3 instruction is executed, causing the control to reach the breakpoint handler do_int3() in arch/i386/kernel/traps.c. do_int3() is called t ...
阅读全文 »

kprobes tutorial

发表于 2007-11-18   |   分类于 Linux Debug
kprobes tutorialThis tutorial was developed for the 2006 Ottawa Linux Symposium. I’m hoping it will be useful as a general resource.There is documentation in Documentation/kprobes.txt in the kernel source.Why?kprobes is both useful and cool. Unfortunately most of the kernel developers I’ve talked to are confused both about why its useful and how to use it. I’m hoping to answer both of those here. I should add that I have no skin in the game personally, I’m not a kprobes developer. I should ...
阅读全文 »

【zz】Linux下的调试工具

发表于 2007-11-17   |   分类于 Linux Debug
strace       -c          Count time, calls, and errors for each system call and report a summary on program exit.        -e trace=set                   Trace only the specified set of system calls. For example, trace=open,close,read,write means to only trace those four system calls. The default is ...
阅读全文 »

【zz】Linux下共享库(SO)有关的几个环境变量

发表于 2007-11-17   |   分类于 Linux Debug
http://blog.csdn.net/absurd/archive/2006/02/07/593899.aspxLinux支持共享库已经有悠久的历史了,不再是什么新概念了。大家都知道如何编译、连接以及动态加载(dlopen/dlsym/dlclose) 共享库。但是,可能很多人,甚至包括一些高手,对共享库相关的一些环境变量认识模糊。当然,不知道这些环境变量,也可以用共享库,但是,若知道它们,可能就会用得更好。下面介绍一些常用的环境变量,希望对家有所帮助: LD_LIBRARY_PATH 这个环境变量是大家最为熟悉的,它告诉loader:在哪些目录中可以找到共享库。可以设置多个搜索目录,这些目录之间用冒号分隔开。在linux下,还提供了另外一种方式来完成同样的功能,你可以把这些目录加到/etc/ld.so.conf中,或则在/etc/ld.so.conf.d里创建一个文件,把目录加到这个文件里。当然,这是系统范围内全局有效的,而环境变量只对当前shell有效。按照惯例,除非你用上述方式指明,loader是不会在当前目录下去找共享库的,正如shell不会在当前目前找可执行文件一样。 ...
阅读全文 »

对于自己写OS的启示

发表于 2007-11-17   |   分类于 Linux
http://www.another-prj.com/viewthread.php?action=printable&tid=300&sid=8zUl7i作者: zhiyunli 时间: 2007-8-4 13:11 标题: 补充一点个人的想法,愿与楼主探讨。 To caiyuqing (土豆泥) : 楼主现在已经有了这样的开端,而且有经验有实力,可以考虑在技术方面有些创新、在商业方面有所作为的商业化或准商业化(如Linux,Linux不仅仅是 开源)的OS,当然也是面向嵌入式领域的。 目前嵌入式应用领域比如说智能手机里比较典型的架构是双处理器配双OS,通信处理器可以配VxWorks、OSE等实时性较好的RTOS,主要用于跑协议 栈;应用模块可以配Linux等免费的OS。从软件系统的规模和复杂度方面看,Linux其实并不是个很好的选择,只是商家看中了它免费的特性。个人认 为,针对应用OS的话,工作难度会低些(复杂度是增加了)而且应用市场也会更大些,可以提供比较契合中小型嵌入式设备的、可配置的嵌入式OS,在API方 面我觉得可以多考虑模仿WinAPI,毕 ...
阅读全文 »
1…464748…61
jfo

jfo

605 日志
38 分类
4 标签
RSS
GitHub 微博
友情链接
  • 收藏夹
  • 网络剪贴板
  • 爱逛吧
© 2007 - 2018 jfo
由 Hexo 强力驱动
主题 - NexT.Pisces