Chinese translated version of Documentation/cpu-freq/cpufreq-stats.txt
If you have any comment or update to the content, please contact the original document maintainer directly. However, if you have a problem communicating in English you can also ask the Chinese maintainer for help. Contact the Chinese maintainer if this translation is outdated or if there is a problem with the translation.
Chinese maintainer: Liemin Ma <maliemin.jj@gmail.com> --------------------------------------------------------------------- Documentation/cpu-freq/cpufreq-stats.txt 的中文翻译
如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文 交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻 译存在问题,请联系中文版维护者。
中文版维护者: 马列敏 <maliemin.jj@gmail.com> 中文版翻译者: 马列敏<maliemin.jj@gmail.com> 中文版校译者: 马列敏<maliemin.jj@gmail.com>
以下为正文 ---------------------------------------------------------------------
1
2
3 CPU frequency and voltagescaling statistics in the Linux(TM) kernel
在Linux(TM)内核里CPU频率和电压缩放统计
4
5 L i n u x c p u f r e q - s t a t s d r i v e r
linux cpufreq-stats驱动程序
6
7 -information for users -
用户须知
8
9
10 Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
11
12 Contents
13 1. Introduction
14 2. Statistics Provided (with example)
15 3. Configuring cpufreq-stats
内容
1.引言
2.提供的统计数据(带有示例)
3.配置cpufreq-stats
16
17
18 1. Introduction
1.引言
19
20 cpufreq-stats is a driver that provides CPU frequency statistics foreach CPU.
21 These statistics are provided in /sysfs as a bunch of read_onlyinterfaces. This
22 interface (when configured) will appear in a separate directory undercpufreq
23 in /sysfs (<sysfs root>/devices/system/cpu/cpuX/cpufreq/stats/)for each CPU.
24 Various statistics will form read_only files under this directory.
cpufreq-stats是一个为每个CPU提供 CPU频率的统计数据的驱动程序。这些数据提供了/ sysfs中的一堆read_only接口,这个接口(在配置时)就会为了每个CPU出现在一个单独的目录在/ cpufreq sysfs(< sysfs root > /设备/系统/ cpu / cpuX / cpufreq /统计/)。各种统计数据将形成read_only这个目录下的文件。
25
26 This driver is designed to be independent of any particularcpufreq_driver
27 that may be running on your CPU. So, it will work with anycpufreq_driver.
这个驱动程序被设计成可能是你的CPU上运行的独立于任何特定的cpufreq_driver,所以它将与任何cpufreq_driver一同运行。
28
29
30 2. Statistics Provided (with example)
2.提供的统计数据(带有示例)
31
32 cpufreq stats provides following statistics (explained in detailbelow).
cpufreq统计提供了以下统计(下面详细解释)。
33 - time_in_state
34 - total_trans
35 - trans_table
36
37 All the statistics will be from the time the stats driver has beeninserted
38 to the time when a read of a particular statistic is done. Obviously,stats
39 driver will not have any information about the frequency transitionsbefore
40 the stats driver insertion.
所有的数据都是从数据驱动程序被插入时一直到一个特定统计的读操作完成时。显然,统计驱动程序之前不会有关于频率转换的任何信息的统计。
41
42 --------------------------------------------------------------------------------
43 <mysystem>:/sys/devices/system/cpu/cpu0/cpufreq/stats # ls -l
44 total 0
45 drwxr-xr-x 2 root root 0 May 14 16:06 .
46 drwxr-xr-x 3 root root 0 May 14 15:58 ..
47 -r--r--r-- 1 root root 4096 May14 16:06 time_in_state
48 -r--r--r-- 1 root root 4096 May14 16:06 total_trans
49 -r--r--r-- 1 root root 4096 May14 16:06 trans_table
50--------------------------------------------------------------------------------
51
52 - time_in_state
53 This gives the amount of time spent in each of the frequenciessupported by
54 this CPU. The cat output will have "<frequency><time>" pair in each line, which
55 will mean this CPU spent <time> usertime units of time at<frequency>. Output
56 will have one line for each of the supported frequencies. usertimeunits here
57 is 10mS (similar to other time exported in /proc).
这给出的时间都用在每个被CPU支持的频率里,猫输出将有“<frequency><time>”对中的每一行,这就意味着这个CPU花费的时间<time>的usertime单位<frequency>。输出将为每个支持频率都预留一行。这里的usertime单位为10mS(类似于其他出口时间
58
59--------------------------------------------------------------------------------
60 <mysystem>:/sys/devices/system/cpu/cpu0/cpufreq/stats # cattime_in_state
61 3600000 2089
62 3400000 136
63 3200000 34
64 3000000 67
65 2800000 172488
66 --------------------------------------------------------------------------------
67
68
69 - total_trans
70 This gives the total number of frequency transitions on this CPU. Thecat
71 output will have a single count which is the total number of frequency
72 transitions.
在这个CPU上给出了频率转换的总数,猫的输出将会有一个计数频率转换的总数。
73 74--------------------------------------------------------------------------------
75 <mysystem>:/sys/devices/system/cpu/cpu0/cpufreq/stats # cattotal_trans
76 20
77--------------------------------------------------------------------------------
78
79 - trans_table
80 This will give a fine grained information about all the CPU frequency
81 transitions. The cat output here is a two dimensional matrix, where anentry
82 <i,j> (row i, column j) represents the count of number oftransitions from
83 Freq_i to Freq_j. Freq_i is in descending order with increasing rowsand
84 Freq_j is in descending order with increasing columns. The output herealso
85 contains the actual freq values for each row and column for betterreadability.
这将会给出所有的有关于CPU频率转换的细粒度的信息。猫输出是一个二维矩阵,在那里一个条目< i,j >(行,列j)代表的数的转换Freq_i Freq_j。Freq_i与增加行和降序Freq_j降序排列,增加列。这里的输出还包含每行和每列更好的实际频率值。
86
87--------------------------------------------------------------------------------
88 <mysystem>:/sys/devices/system/cpu/cpu0/cpufreq/stats # cattrans_table
89 From : To
90 : 3600000 3400000 3200000 3000000 2800000
91 3600000: 0 5 0 0 0
92 3400000: 4 0 2 0 0
93 3200000: 0 1 0 2 0
94 3000000: 0 0 1 0 3
95 2800000: 0 0 0 2 0
96--------------------------------------------------------------------------------
97
98
99 3. Configuring cpufreq-stats
3.配置cpufreq-stats
100
101 To configure cpufreq-stats in your kernel
102 Config Main Menu
103 Power management options(ACPI, APM) --->
104 CPU Frequencyscaling --->
105 [*] CPUFrequency scaling
106 <*> CPU frequencytranslation statistics
107 [*] CPU frequency translation statisticsdetails
在内核里配置cpufreq-stats
配置主菜单
电源管理选项(ACPI,APM)--->
CPU频率调节--->
[*] CPU频率调节
<*> CPU频率转换统计
[*] CPU频率转化统计数字的详细资料
108
109
110 "CPU Frequency scaling" (CONFIG_CPU_FREQ) should be enabledto configure
CPU频率调节(CONFIG_CPU_FREQ) 应该能被配置
111 cpufreq-stats.
112
113 "CPU frequency translation statistics" (CONFIG_CPU_FREQ_STAT)provides the
114 basic statistics which includes time_in_state and total_trans.
“CPU频率转化统计”(CONFIG_CPU_FREQ_STAT)提供了基本的统计数据,其中包括time_in_state和total_trans。
115
116 "CPU frequency translation statistics details"(CONFIG_CPU_FREQ_STAT_DETAILS)
117 provides fine grained cpufreq stats by trans_table. The reason forhaving a
118 separate config option for trans_table is:
119 - trans_table goes against the traditional /sysfs rule of one value per
120 interface. It provides a wholebunch of value in a 2 dimensional matrix
121 form.
“CPU频率转化统计细节”(CONFIG_CPU_FREQ_STAT_DETAILS)提供了细粒cpufreq trans_table统计。单独的配置选项trans_table的原因是:-有悖于传统trans_table / sysfs规则每个接口的一个值。它在一个二维矩阵形式中提供了很多有价值的。
122
123 Once these two options are enabled and your CPU supports cpufrequency,you
124 will be able to see the CPU frequency statistics in /sysfs.
一旦这两个选项被启用,并且你的CPU支持 cpufrequency,你就将能看到/ sysfs中CPU频率的统计数据。
|