2014中國內核開發者大會資料整理

*主要學習了大會一提涉及的一些陌生或似是而非的概念和技術。php

*標紅的內容是我以爲給力的東西。html

*大會官網:www.ckernel.orglinux

1、幫助內核開發的一些工具

這個話題(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/

 

2、Btrfs文件系統

   Btrfs文件系統被做爲下一代文件系統開發,三大目標是容錯、修復和基於管理,目前主要feature開發階段已經完成,可是性能和穩定性還挺差,沒有普遍應用開來。

Wiki:  http://zh.wikipedia.org/zh-cn/Btrfs

ext3,ext4,xfs和btrfs文件系統性能對比:

http://www.cnblogs.com/tommyli/p/3201047.html

 

3、 SRIOV & Power

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

 

4、Fastsocket: A Scalable Kernel TCP Socket

這是新浪在作的一個開源項目。

Github:https://github.com/fastos/fastsocket

 

5、Android kernels

首先,你們都應瞭解Android的架構,而後理解android和linux內核的關係。

Android架構:http://mobile.51cto.com/android-235496.htm

android和linux內核的關係:http://stackoverflow.com/questions/16435581/android-relationship-with-linux

 

6、 Buddy系統中 CMA 的實現和對其問題的改進

Buddy系統(夥伴算法),參考資料:http://blog.csdn.net/li_xiang1102/article/details/6889530

CMA(Contiguous Memory Allocator ),即連續內存分配器。

參考資料:http://www.linuxidc.com/Linux/2012-03/55779.htm

 

7、KVM, qemu, Xen, hypervisor概念的區分

一篇叫《虛擬化與雲計算中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)。

 

8、處理器、內存熱插拔

Linux 下的 CPU 和 內存熱插拔:http://blog.clanzx.net/2013/11/25/hotplug-cpu-mem.html

 

9、NFV

NFV(Network Functions Virtualization),即網絡功能虛擬化。下面資料介紹了什麼是NFV:

https://www.sdncentral.com/whats-network-functions-virtualization-nfv/

相關文章
相關標籤/搜索