除了 turbostat – https://benjr.tw/99181 外還有 cpupower – https://benjr.tw/99146 可以來檢視 CPU 狀態外,還可以透過 powertop .
測試環境為 CentOS 7 x86_64 (虛擬機)
[root@localhost ~]# yum install powertop
[root@localhost ~]# powertop
可以使用 Tab 與 Shift+Tab 鍵來瀏覽分頁 (Overview , Idle Stats , Frequency Stats , Device Stats , Tunables) .
- Overview
顯示系統運行的 process ,Timer , Interrupt , kWork 與 Device 的個別電源使用量.
- Idle Stats
就是指 CPU 的 C-States ,CPU 在沒有使用時可以被停用或以比較低的效能模式來運行,依據不同的狀態可以區分成為幾種 C-state ,C-state 從 C0 (不閒置)開始,數字越高表示越省電(每一家的 CPU 定義 C-state 會稍微不同).
CPU 的 C-state 有下面幾種.- C0 – Operating State
- C1 – Halt
- C1E – Enhanced Halt
- C2 – Stop Grant
- C2 – Stop Clock
- C2E – Extended Stop Grant
- C3 – Sleep
- C3 – Deep Sleep
- C3 – AltVID
- C4 – Deeper Sleep
- C4E/C5 -Enhanced Deeper Sleep
- C6 – Deep Power Down
- C7 – C6 + LLC may be flushed
- C8 – C7 + LLC must be flushed
- Frequency Stats
就是指 CPU 的 P-States ,CPU 依據目前狀態自行調整工作頻率,用以省電.
- Device Stats
- Tunables
如果要精準的估算出系統活動時所消耗的功耗,可以使用參數
-c, –calibrate
Runs powertop in calibration mode. When running on battery, powertop can track power consumption as well as system activity. When there are enough measurements, powertop can start to report power estimates. One can get more accurate estimates by using this option to enable a calibration cycle. This will cycle through various display levels and USB device activities and workloads.
[root@localhost ~]# powertop --calibrate Loaded 0 prior measurements Starting PowerTOP power estimate calibration Calibrating idle Calibrating: disk usage Calibrating backlight Calibrating idle Calibrating: CPU usage on 1 threads Calibrating: CPU usage on 4 threads Calibrating: CPU wakeup power consumption Calibrating: CPU wakeup power consumption Calibrating: CPU wakeup power consumption Calibrating USB devices .... device /sys/bus/usb/devices/1-1/power/control .... device /sys/bus/usb/devices/2-1/power/control .... device /sys/bus/usb/devices/2-2/power/control .... device /sys/bus/usb/devices/usb1/power/control .... device /sys/bus/usb/devices/usb2/power/control .... device /sys/bus/usb/devices/2-2.1/power/control Calibrating radio devices .... device /sys/class/rfkill/rfkill0/soft .... device /sys/class/rfkill/rfkill0/soft
沒有解決問題,試試搜尋本站其他內容