簡易檢索 / 詳目顯示

研究生: 陳威成
Chen, Wei-Cheng
論文名稱: 邁向 OpenBMC 函式層級驗證之可測試函式
Toward Testable Functions for OpenBMC Function-Level Validation
指導教授: 陳培殷
Chen, Pei-Yin
學位類別: 碩士
Master
系所名稱: 電機資訊學院 - 資訊工程學系
Department of Computer Science and Information Engineering
論文出版年: 2026
畢業學年度: 114
語文別: 英文
論文頁數: 41
中文關鍵詞: OpenBMC執行期擷取主機端重播函式層級驗證
外文關鍵詞: OpenBMC, host replay, runtime capture, function-level validation
相關次數: 點閱:3下載:0
分享至:
查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報
  • 在 OpenBMC 等複雜系統中,即使只有小幅原始碼修改,開發者通常仍需重新建置OpenBMC、啟動 BMC 並觸發相關執行路徑,才能觀察修改後的行為,使函式層級變更也必須經歷成本較高的系統驗證流程。此外,人工建立的測試輸入未必能反映函式在真實 BMC 環境中接收到的資料。

    本論文提出可替換與可測試函式(Replaceable and Testable Functions, RTF)模型,並實作其中的可測試執行階段,以支援 OpenBMC C++ 函式的函式層級驗證。所提出的工作流程從 BMC 執行期間擷取選定函式的真實輸入與輸出,並在開發主機端透過 LLVM 即時編譯,使用相同輸入重播修改前後的函式版本,再比較其執行結果與實際觀察到的呼叫行為。

    實驗以一個 OpenBMC C++ 函式設計三種情境進行評估。結果顯示,基準版本的主機端重播結果與 BMC 實際執行時擷取的結果一致;系統能辨識造成回傳值改變的修改,並在觀察行為未改變時回報無差異。在本研究的實驗環境中,以目標 BMC 為核心的驗證流程共需 162.65 秒。取得初始執行快照後,後續主機端的函式重播與差異比較僅需 4.80 秒,相當於可省下約 97% 的實測驗證時間,主要來自不需重複執行 OpenBMC 建置與 BMC 啟動。結果顯示,此方法能利用真實執行資料進行針對性的函式層級比較,並降低重複驗證的成本。目前實作仍限於選定的函式與資料型別且尚未完整處理指標所參照的資料及其他未擷取的執行狀態。

    In complex systems such as OpenBMC, even a small source code change often requires developers to rebuild OpenBMC, start the BMC, and trigger the relevantexecution path before the resulting behavior can be observed. Consequently, a function-level modification may still require a costly system-level validation workflow. Moreover, manually constructing test inputs may not accurately reproduce the data that a function receives during actual BMC execution.

    This thesis proposes the Replaceable and Testable Functions (RTF) model, and implements its testable execution stage to support function-level validation of OpenBMC C++ functions. The proposed workflow captures real inputs and outputs of a selected function during BMC execution. It then uses LLVM just-in-time compilation on the development host to replay the same input against the baseline and modified function versions and compares their execution results and observed call behavior.

    The workflow was evaluated using one OpenBMC C++ function in three scenarios. The results show that the baseline host replay produced outputs identical to those captured during actual BMC execution. The workflow also detected a modification that changed the return value and reported no difference when another modification preserved the observed behavior. In the evaluated environment, the target-based validation workflow required 162.65 seconds. After the initial runtime snapshot was obtained, subsequent host-side function replay and trace comparison required only 4.80 seconds, saving approximately 97% of the measured validation time, primarily by avoiding repeated OpenBMC builds and BMC startup. These results demonstrate that real runtime data can support focused function-level comparison while reducing the cost of repeated validation. The current implementation remains limited to selected functions and data types and does not fully capture pointer-referenced data or other unrecorded execution state.

    摘要 i Abstract ii 誌謝 iii Table of Contents iv List of Tables vi List of Figures vii Chapter 1. Introduction 1 1.1. Motivation 1 1.2. Problem Statement and Research Objectives 2 1.3. Contributions 2 1.4. Related Work 2 1.4.1. Record-and-Replay Systems 3 1.4.2. Differential Testing 3 1.4.3. Dynamic Software Updating and Hot Patching 4 1.4.4. Summary 4 1.5. Thesis Organization 5 Chapter 2. Background 6 2.1. OpenBMC 6 2.2. D-Bus, Redfish, and bmcweb 6 2.3. Tree-sitter 7 2.4. Clang and clangd 7 2.5. LLVM IR and LLVM JIT 7 Chapter 3. RTF Model and Testable Execution Design 9 3.1. RTF Model Definition 9 3.2. Scope and Design Goals 10 3.3. System Overview 10 3.4. Candidate Discovery and Target Selection 11 3.5. Runtime Capture Schema and Trace Exposure 11 3.6. Host Replay, Diffing, and Assumptions 13 3.7. Design Considerations 14 3.8. Design Limitations 14 Chapter 4. Implementation and Evaluation 15 4.1. Implementation Overview 15 4.2. VS Code Extension and Call Graph Interface 15 4.3. Analysis Toolchain and Host Replay 16 4.4. OpenBMC Runtime Capture through D-Bus and Redfish 17 4.5. Evaluation Setup 18 4.5.1. Evaluation Environment 18 4.5.2. Case Study Design 18 4.5.3. Evaluation Criteria 19 4.6. Case Study Results 21 4.6.1. C1: Replay Consistency with BMC Runtime Result 21 4.6.2. C2: Return Behavior Change 21 4.6.3. C3: No Observed Behavior Change 24 4.6.4. Summary of Case Study Results 25 4.7. Discussion 25 4.7.1. Evaluation Summary 25 4.7.2. Initial Capture Cost vs. Repeated Replay Cost 25 4.7.3. Limitations 27 Chapter 5. Conclusion and Future Work 29 5.1. Conclusion and Limitations 29 5.2. Future Work 29 References 31

    [1] Jeff Arnold and M Frans Kaashoek. Ksplice: Automatic rebootless kernel updates. In Proceedings of the 4th ACM European conference on Computer systems, pages 187–198, 2009.
    [2] Yuting Chen, Ting Su, Chengnian Sun, Zhendong Su, and Jianjun Zhao. Coverage-directed differential testing of jvm implementations. In proceedings of the 37th ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 85–99, 2016.
    [3] DMTF. Redfish Specification. https://www.dmtf.org/sites/default/files/standards/documents/DSP0266_1.24.0.pdf, 2026. Accessed: 2026-07-07.
    [4] Sebastian Elbaum, Hui Nee Chin, Matthew B Dwyer, and Matthew Jorde. Carving and replaying differential unit test cases from system test cases. IEEE Transactions on Software Engineering, 35(1):29–45, 2008.
    [5] freedesktop.org. D-Bus Specification. https://dbus.freedesktop.org/doc/dbus-specification.html. Accessed: 2026-07-07.
    [6] Christopher M Hayden, Edward K Smith, Michail Denchev, Michael Hicks, and Jeffrey S Foster. Kitsune: Efficient, general-purpose dynamic software updating for C. In Proceedings of the ACM international conference on Object oriented programming systems languages and applications, pages 249–264, 2012.
    [7] Chris Lattner and Vikram Adve. LLVM: A compilation framework for lifelong program analysis & transformation. In International symposium on code generation and optimization, 2004. CGO 2004., pages 75–86. IEEE, 2004.
    [8] LLVM Project. Clang Compiler User’s Manual. https://clang.llvm.org/docs/UsersManual.html. Accessed: 2026-07-07.
    [9] LLVM Project. clangd Documentation. https://clangd.llvm.org/. Accessed: 2026-07-07.
    [10] LLVM Project. ORC Design and Implementation. https://llvm.org/docs/ORCv2.html. Accessed: 2026-07-07.
    [11] William M McKeeman. Differential testing for software. Digital Technical Journal, 10(1):100–107, 1998.
    [12] Iulian Neamtiu, Michael Hicks, Gareth Stoyle, and Manuel Oriol. Practical dynamic software updating for C. ACM SIGPLAN Notices, 41(6):72–83, 2006.
    [13] Robert O’Callahan, Chris Jones, Nathan Froyd, Kyle Huey, Albert Noll, and Nimrod Partush. Engineering record and replay for deployability. In 2017 usenix annual technical conference (usenix atc 17), pages 377–389, 2017.
    [14] OpenBMC Project. OpenBMC Distribution. https://github.com/openbmc/openbmc. Accessed: 2026-07-07.
    [15] OpenBMC Project. OpenBMC Documentation. https://github.com/openbmc/docs. Accessed: 2026-07-07.
    [16] OpenBMC Project. OpenBMC webserver. https://github.com/openbmc/bmcweb. Accessed: 2026-07-07.
    [17] Tree-sitter Project. Tree-sitter Documentation. https://tree-sitter.github.io/tree-sitter/. Accessed: 2026-07-07.
    [18] Xuejun Yang, Yang Chen, Eric Eide, and John Regehr. Finding and understanding bugs in C compilers. In Proceedings of the 32nd ACM SIGPLAN conference on Programming language design and implementation, pages 283–294, 2011.
    [19] Yocto Project. BitBake User Manual. https://docs.yoctoproject.org/bitbake/2.18/index.html. Accessed: 2026-07-07.
    [20] Yocto Project. The Yocto Project. https://www.yoctoproject.org/. Accessed: 2026-07-07.

    QR CODE