透過您的圖書館登入
IP:3.12.71.237
  • 學位論文

使用Oprofile之嵌入式系統取樣式功耗分析

Sampling-based Power Monitoring of Embedded Systems with Oprofile

指導教授 : 劉靖家

摘要


耗電量資訊對於嵌入式系統是重要且有用的資訊,我們可以利用耗電量資訊來延長系統的使用時間。對於嵌入式系統的幫助十分有用,可以利用這些資訊幫助程式設計者做耗電最佳化設計。功率量測的方法可以利用simulation-based跟measurement-based的方法來獲得。前者為利用功率模型來進行功耗計算的模擬,但是因為模型沒有辦法反映實際硬體的精確功耗在精準度受有所限制。相較之下後者量測的結果就比較接近於實際情況,但是在時間精確度就不若前者。 在這篇論文中,我們使用一個實體的即時嵌入式功耗量測板來量測CPU與記憶體的功率消耗。利用外部的FPGA硬體收集功耗量測模板所收集到的資訊儲存,軟體端便能觀察功率消耗狀態。這樣的設計讓我們可以知道CPU在這段觀察時間內所造成的功率消耗,但並不能了解是哪些原因所造成。所以在論文中我們將這些量測到的資訊與系統上的軟體資訊做結合,試著估算程式在系統上所造成的功率消耗。然而,軟體時間和功率量測系統時間是不同步的,所以當軟體發一個命令給驅動程式控制功率量測系統,驅動程式接收到這個命令與開始控制功率量測系統的時間是不一樣的,所以軟體收集的功率消耗資訊是不正確的。因此,我們提出一個同步化方法去補償驅動程式延遲時間。 除此之外,在軟體與系統驅動程式溝通的過程中,受到作業系統的排成影響,會有一段的延遲,這段延遲也使我們量測到的資訊有誤差,所以我們提出了取樣式的方法,利用Oprofile取樣式的特性,藉由中斷的機制直接觀察CPU的執行狀態並紀錄。用規律的中斷持續的對CPU做取樣,配合功耗量測系統所測量到的結果,利用線性規劃的方法對整個嵌入式系統做進一步的分析,了解程式在系統平台上的功率消耗。

並列摘要


Power consumption is critical constrain for embedded system. In order to provide a criterion for designers to optimize system power as well as performance, various power evaluation methods have been proposed. Power evaluation methods can be classified into two groups: simulation-based and measurement-based. Simulation-based modeling is a good tool for evaluating power due to the controllability of simulator. However, the simulation accuracy might be questioned since model might not reflect all the details of actual hardware. Besides, the long simulation time could be a burden while the extreme accuracy is required. By contrast, the measurement-based method is closer to reality, but also introduces other issues. In this thesis, we use a real-time embedded power measurement board, which is developed by previous work in [1], to measure the power of ARM core and DRAM module on an embedded system development board. A power collection hardware is designed on FPGA to interface with the power measurement board. Combining the driver which we develop, the software on ARM core can access the measured power data real-timely. To further utilize the real-time power information, in this thesis, we try to map the measured power data to the corresponding software context on system. One of the challenges we face is the latency of passing a command to enable power monitor from software. If the command is issued by a user-level application, it must pass through driver and then to FPGA hardware. From experiment results, the delay between driver and hardware is almost constant, so we can easily compensate it by buffering the power data in this constant period. Conversely, the response time from driver to application is determined by scheduling and varies depending on current system context. To deal with this difficulty, we propose a sampling-based power monitoring method, based on a system profile tool, OProfile. Oprofile can record program counter (PC) value periodically by an interrupt handler which is triggered by performance counter or timer. Finally, due to the limited OProfile sample rate in our system, an OProfile sample is mapped to multiple samples of measured power. Trying to rebuild the lost software context, we proposed a linear programming method to analyze and estimate the power consumption of each profiled function calls.

參考文獻


[8] Stephen P. Boyd Michael C. Grant, The CVX Users’ Guide, 2012, http://cvxr.com/cvx.
[7] Texas Instruments, OMAP35x Evaluation Module (EVM),
“Mibench: A free, commercially representative embedded benchmark suite”, Workload
[1] C.-C. Hs, “Real-Time Power Measurements of an Embedded System”, Master’s thesis, National Tsing-Hua University, Electrical Engineering Department, 2011.
[2] C.-C. Hs, “Power Monitor of Embedded System with Power Signal Compression”, Master’s

延伸閱讀