*主要學習了大會一提涉及的一些陌生或似是而非的概念和技術。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/