*主要学习了大会一提涉及的一些陌生或似是而非的概念和技术。php
*标红的内容是我以为给力的东西。html
*大会官网:www.ckernel.orglinux
这个话题(Improving Linux Development with better tools )是去年大会,由Andi kleen(long term linux kernel contributor)分享的。跟我作的课题比较相关,就看了ppt(下载地址:http://www.ckernel.org/media/ppt/1-andi-intel.pdf), 简单作了总结。android
Andi kleen的主页:http://www.halobates.de/。git
一篇综述内核测试和调试的文章:http://www.gzidc.com/article/detail.php?aid=3868。github
5篇关于内核测试和调试的连载文章,写的详细专业:http://linux.cn/article-3593-1-rel.html算法
1. 静态代码检测工具服务器
这里有个静态代码检测工具列表,固然大都针对用户态程序。http://en.wikipedia.org/wiki/List_of_tools_for_static_code_analysis#C.2FC.2B.2B。网络
1) Sparse架构
① Linus 发起的,随内核发行;
② 用于内核代码检测,如检测大端和小端模式是否混用。
③ 参考资料:内核源码documentation/sparse.txt.
④ 参考维基:http://en.wikipedia.org/wiki/Sparse
⑤ 如何使用:http://wireless.kernel.org/en/developers/Documentation/using-sparse
2) Smatch
① Static analysis for C;
② Most of checks are for linux kernel;
③ 官网:http://smatch.sourceforge.net/
3) Coccinelle
第一次了解到这类工具,较有新意。
① 目的:检测内核演进对客户端代码的影响(内核接口的变化);
② 官网:http://coccinelle.lip6.fr/
4) Clang static analyzer
① 目的:LLVM(Low Level Virtual Machine)的子项目,静态代码检测工具
② 支持C,C++,object-c等。
③ 官网:http://clang-analyzer.llvm.org/
5) Checkpatch
① 检测代码是否符合linux coding-style的脚本程序;
② 源码目录:scripts/checkpatch;
6) Stanse
① 静态检测工具,for c99
② 最近一次更新时间是2011.4,因此。。。
2. 静态代码检测工具的挑战
① 效率问题:慢
② 准确性:有偏差(False positives)
3. 如何修复bug (Study bug fixes)
① 补丁有可能也有bug,数据:
“At least 14.8% 24.4% of the sampled bug fixes are incorrect. Moreover, 43% of the incorrect fixes resulted in severe bugs that caused crash, hang, data corruption or security problems.”
② 一篇研究该问题的论文:How do fixes become bugs, 连接 http://opera.ucsd.edu/paper/fse11.pdf
4. 大量须要从用户空间向内核空间移植的工具
内核检测工具如kmemcheck特别慢,相比用户态工具性能和功能出色的工具较多, 须要往内核移植,如:
① Addresssanitizer: https://code.google.com/p/address-sanitizer/wiki/AddressSanitizerAlgorithm
② Threadsanitizer: https://code.google.com/p/data-race-test/wiki/ThreadSanitizer
③ Valgrind: http://valgrind.org/
④ UBSan
5. 检测工做的挑战
① 工具集成问题:how to run all these tools on every new patch?
解决办法:为了解决集成测试问题,发起LTP(linux test project)项目。
② 介绍参考:http://blog.csdn.net/liyongming1982/article/details/13994891
③ 官网:http://linux-test-project.github.io/#
6. 调试工具
① Kgdb
Wiki:https://kgdb.wiki.kernel.org/index.php/Main_Page
两台真机调试参考:http://www.xfocus.net/articles/200509/820.html
Vmware虚拟机调试参考:http://www.eetop.cn/blog/html/21/766721-25573.html
② Ftrace
该工具我作了实验,主要体验了其函数流程图跟踪功能(function graph tracer),挺不错的。这个方便调试和分析。
参考资料:http://www.ibm.com/developerworks/cn/linux/l-cn-ftrace/
Btrfs文件系统被做为下一代文件系统开发,三大目标是容错、修复和基于管理,目前主要feature开发阶段已经完成,可是性能和稳定性还挺差,没有普遍应用开来。
① Wiki: http://zh.wikipedia.org/zh-cn/Btrfs
② ext3,ext4,xfs和btrfs文件系统性能对比:
http://www.cnblogs.com/tommyli/p/3201047.html
① SR-IOV 技术是一种基于硬件的虚拟化解决方案,可提升性能和可伸缩性。SR-IOV 标准容许在虚拟机之间高效共享 PCIe(Peripheral Component Interconnect Express,快速外设组件互连)设备,而且它是在硬件中实现的,能够得到可以与本机性能媲美的 I/O 性能。SR-IOV 规范定义了新的标准,根据该标准,建立的新设备可容许将虚拟机直接链接到 I/O 设备。
② Power能够指IBM的power cpu, power服务器,power system解决方案等。
③ 详细介绍资料:http://www.redbooks.ibm.com/abstracts/redp5065.html?Open
这是新浪在作的一个开源项目。
Github:https://github.com/fastos/fastsocket
首先,你们都应了解Android的架构,而后理解android和linux内核的关系。
① Android架构:http://mobile.51cto.com/android-235496.htm
② android和linux内核的关系:http://stackoverflow.com/questions/16435581/android-relationship-with-linux
① Buddy系统(伙伴算法),参考资料:http://blog.csdn.net/li_xiang1102/article/details/6889530
② CMA(Contiguous Memory Allocator ),即连续内存分配器。
参考资料:http://www.linuxidc.com/Linux/2012-03/55779.htm
① 一篇叫《虚拟化与云计算中KVM,Xen,Qemu的区别和联系》,连接:
http://yansu.org/2013/03/20/different-bewteen-kvm-xen-qemu.html
② Hypervisor,中文意思是管理程序, 它是一个泛化概念,不与具体虚拟化程序对号入座,泛指处于硬件层与虚拟机之间的资源管理程序。
③ KVM(Kernel-based Virtual Machine)是集成到Linux内核的Hypervisor,是一个内核模块。
④ Qemu是一个跨平台、高速的模拟处理器软件,是用户态程序。
⑤ Xen是第一类运行再裸机上的虚拟化管理程序(Hypervisor)。
① Linux 下的 CPU 和 内存热插拔:http://blog.clanzx.net/2013/11/25/hotplug-cpu-mem.html
NFV(Network Functions Virtualization),即网络功能虚拟化。下面资料介绍了什么是NFV:
https://www.sdncentral.com/whats-network-functions-virtualization-nfv/