指導教授:黃鐘揚臺灣大學:電機工程學研究所王宏偉Wang, Hung-WeiHung-WeiWang2014-11-282018-07-062014-11-282018-07-062014http://ntur.lib.ntu.edu.tw//handle/246246/262924當嵌入式系統的行為出錯時,由於缺乏對系統內部行為的觀察力、系統行為的不可確定性、多時域的系統設計以及對即時的要求,使得傳統的除錯方法難以發現造成錯誤的原因。這使得我們希望可以在模擬的環境中重新產生並觀察錯誤的行為,因為在模擬的環境上所有的東西都是可被觀察和控制的。 然而由於模擬速度的限制,我們並不太可能將整個系統放到模擬的平台上模擬。而系統的不可確定性又使得這個問題更加的糟糕,錯誤可能只在某些情形下才會發生,而我們沒辦法確保每次執行都會遇到此情況,這讓我們需要更多的時間只為了在模擬上重新產生這個錯誤。 在這篇論文中,我們藉由抽象化的技巧將系統中跟錯誤無關的部分移除,藉此縮小除錯範圍、增加模擬速度並縮短讓錯誤發生所需的時間。我們討論怎樣的系統行為必須被紀錄並根據此紀錄重現錯誤發生的行為。When a system goes wrong, it is difficult to find out the root cause due to lack of system observability、non-deterministic behavior of the system、multiple clock domain and real-time application constraints. It is desirable if we can reproduce the bug on the simulation platform which is fully observable and controllable. However, it is nearly impossible to simulate the whole system due to limited simulation speed. Moreover, the non-deterministic behavior of the system make it even worse. The bug may only exist on specific path and it is hard to reproduce the bug. In this work, we try to remove the bug-unrelated parts of the system. By abstracting the system, we narrow down the root cause of the bug, shorten the bug trace and speed up the simulation. Besides, we discuss what the abstract system state transition should be so that we can record the necessary transactions of CPU and rebuild its behavior model later.口試委員會審定書 # 誌謝 i 中文摘要 ii ABSTRACT iii CONTENTS iv LIST OF FIGURES vii LIST OF TABLES ix Chapter 1 Introduction 1 1.1 Motivation 2 1.2 Related Works 2 1.3 Thesis Contributions 3 1.4 Thesis Organization 4 Chapter 2 Preliminaries 5 2.1 Embedded System 5 2.2 Android Bootup Sequence 6 2.2.1 Boot ROM 7 2.2.2 Bootloader 7 2.2.3 Kernel 8 2.2.4 Init process 8 2.2.5 Zygote and Dalvik VM 10 2.2.6 Boot completed 10 2.3 Debug Supports on Android 11 2.3.1 Dalvik Debug Monitor Server 11 2.3.2 Android Debug Bridge 11 2.3.3 Monkey Runner API 12 2.4 System Non-determinism 12 2.4.1 Software Non-determinism 12 2.4.2 Hardware Non-determinism 13 2.5 Deterministic Replay 13 2.6 ARM Cortext-A7 14 Chapter 3 Concept of Abstraction 16 3.1 Illustration of abstraction 18 3.1.1 Filter out long bug trace 19 3.1.2 Remove bug unrelated components 20 3.1.3 Constrain the input the same as bug trace 21 3.1.4 Abstract the bug trace by transaction level modeling 22 3.1.5 System State Snapshot for bug length minimizing on simulation 22 3.1.6 Summary 23 3.2 System transition and its transition 24 3.2.1 Hardware state and its transition 24 3.2.2 Software state and its transition 25 3.2.3 System state and its transition 25 Chapter 4 Implementation 27 4.1 Bug Scenario 27 4.2 Assumptions 29 4.3 CPU behavior and Record information 29 4.4 Overall process 31 4.4.1 Remove Bug-unrelated Parts 32 4.4.2 Apply run time filter 34 4.4.3 Dump system call information 35 4.4.4 Abstraction Program Generation 36 Chapter 5 Experiments 37 Chapter 6 Conclusion and Future Works 38 REFERENCE 391183726 bytesapplication/pdf論文使用權限:不同意授權除錯抽象化嵌入式系統針對嵌入式系統驗證之抽象化技術Apply Abstraction Techniques to Embedded System Debugthesishttp://ntur.lib.ntu.edu.tw/bitstream/246246/262924/1/ntu-103-R01921045-1.pdf