1.. SPDX-License-Identifier: GPL-2.0 2 3.. include:: ../disclaimer-zh_TW.rst 4 5:Original: Documentation/cpu-freq/cpufreq-stats.rst 6 7:������: 8 9 ��������� Yanteng Si <siyanteng@loongson.cn> 10 11:������: 12 13 ��������� Tang Yizhou <tangyeechou@gmail.com> 14 15========================================== 16sysfs CPUFreq Stats��������������� 17========================================== 18 19��������������������������� 20 21 22������: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> 23 24.. Contents 25 26 1. ������ 27 2. ���������������������(������������) 28 3. ������cpufreq-stats 29 30 311. ������ 32=============== 33 34cpufreq-stats������������������CPU������CPU������������������������ 35���������������������/sysfs������������������������������������������cpufreq-stats������������������������������������CPU������ 36/sysfs���<sysfs root>/devices/system/cpu/cpuX/cpufreq/stats/������cpufreq������������stats��������� 37������������������������stats��������������������������������������� 38 39������������������������������������������������������CPU������������cpufreq_driver������������������������������������������������ 40cpufreq_driver��������������� 41 42 432. ������������������������(���������) 44===================================== 45 46cpufreq stats��������������������������������������������������������� 47 48- time_in_state 49- total_trans 50- trans_table 51 52������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ 53��������������������������������������������������������������������������������� 54 55:: 56 57 <mysystem>:/sys/devices/system/cpu/cpu0/cpufreq/stats # ls -l 58 total 0 59 drwxr-xr-x 2 root root 0 May 14 16:06 . 60 drwxr-xr-x 3 root root 0 May 14 15:58 .. 61 --w------- 1 root root 4096 May 14 16:06 reset 62 -r--r--r-- 1 root root 4096 May 14 16:06 time_in_state 63 -r--r--r-- 1 root root 4096 May 14 16:06 total_trans 64 -r--r--r-- 1 root root 4096 May 14 16:06 trans_table 65 66- **reset** 67 68������������������������������������������������������������������������������������������������������������������������������ 69 70 71- **time_in_state** 72 73������������������������CPU������������������������������������������������cat������������������������������"<frequency> 74<time>"������������������CPU���<frequency>������������<time>���usertime������������������������������������������ 75������CPU������������������������usertime���������10mS������������/proc��������������������������� 76 77:: 78 79 <mysystem>:/sys/devices/system/cpu/cpu0/cpufreq/stats # cat time_in_state 80 3600000 2089 81 3400000 136 82 3200000 34 83 3000000 67 84 2800000 172488 85 86 87- **total_trans** 88 89������������������������CPU���������������������������cat������������������������������������������������������������������ 90 91:: 92 93 <mysystem>:/sys/devices/system/cpu/cpu0/cpufreq/stats # cat total_trans 94 20 95 96- **trans_table** 97 98���������������������CPU������������������������������������������cat������������������������������������������������<i, j>������ 99i���������j���������������Freq_i���Freq_j������������������Freq_i������Freq_j������������������������������cpufreq 100������������������������������������������������������������������������������������������������������������������������������ 101������������������������������������������������������������������ 102 103���������������������PAGE_SIZE���������������������������-EFBIG��������� 104 105:: 106 107 <mysystem>:/sys/devices/system/cpu/cpu0/cpufreq/stats # cat trans_table 108 From : To 109 : 3600000 3400000 3200000 3000000 2800000 110 3600000: 0 5 0 0 0 111 3400000: 4 0 2 0 0 112 3200000: 0 1 0 2 0 113 3000000: 0 0 1 0 3 114 2800000: 0 0 0 2 0 115 1163. ������cpufreq-stats 117============================ 118 119���������������������������������������cpufreq-stats:: 120 121 Config Main Menu 122 Power management options (ACPI, APM) ---> 123 CPU Frequency scaling ---> 124 [*] CPU Frequency scaling 125 [*] CPU frequency translation statistics 126 127 128"CPU Frequency scaling" (CONFIG_CPU_FREQ) ���������������������������������cpufreq-stats��� 129 130"CPU frequency translation statistics" (CONFIG_CPU_FREQ_STAT)��������������� 131time_in_state���total_trans���trans_table������������������ 132 133������������������������������������������CPU������cpufrequency������������������/sysfs���������CPU��������������� 134 135