Documentation/translations/zh_CN/cpu-freq/cpufreq-stats.rst

Source file repositories/reference/linux-study-clean/Documentation/translations/zh_CN/cpu-freq/cpufreq-stats.rst

File Facts

System
Linux kernel
Corpus path
Documentation/translations/zh_CN/cpu-freq/cpufreq-stats.rst
Extension
.rst
Size
4501 bytes
Lines
134
Domain
Support Tooling And Documentation
Bucket
Documentation
Inferred role
Support Tooling And Documentation: documentation
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

.. SPDX-License-Identifier: GPL-2.0

.. include:: ../disclaimer-zh_CN.rst

:Original: Documentation/cpu-freq/cpufreq-stats.rst

:翻译:

 司延腾 Yanteng Si <siyanteng@loongson.cn>

:校译:

 唐艺舟 Tang Yizhou <tangyeechou@gmail.com>

==========================================
sysfs CPUFreq Stats的一般说明
==========================================

为使用者准备的信息


作者: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>

.. Contents

   1. 简介
   2. 提供的统计数据(举例说明)
   3. 配置cpufreq-stats


1. 简介
===============

cpufreq-stats是一种为每个CPU提供CPU频率统计的驱动。
这些统计数据以/sysfs中一系列只读接口的形式呈现。cpufreq-stats接口(若已配置)将为每个CPU生成
/sysfs(<sysfs root>/devices/system/cpu/cpuX/cpufreq/stats/)中cpufreq目录下的stats目录。
各项统计数据将在stats目录下形成对应的只读文件。

此驱动是以独立于任何可能运行在你所用CPU上的特定cpufreq_driver的方式设计的。因此,它将能和任何
cpufreq_driver协同工作。


2. 已提供的统计数据(有例子)
=====================================

cpufreq stats提供了以下统计数据(在下面详细解释)。

-  time_in_state
-  total_trans
-  trans_table

所有统计数据来自以下时间范围:从统计驱动被加载的时间(或统计数据被重置的时间)开始,到某一统计数据被读取的时间为止。
显然,统计驱动不会保存它被加载之前的任何频率转换信息。

::

    <mysystem>:/sys/devices/system/cpu/cpu0/cpufreq/stats # ls -l
    total 0
    drwxr-xr-x  2 root root    0 May 14 16:06 .
    drwxr-xr-x  3 root root    0 May 14 15:58 ..
    --w-------  1 root root 4096 May 14 16:06 reset
    -r--r--r--  1 root root 4096 May 14 16:06 time_in_state
    -r--r--r--  1 root root 4096 May 14 16:06 total_trans
    -r--r--r--  1 root root 4096 May 14 16:06 trans_table

- **reset**

只写属性,可用于重置统计计数器。这对于评估不同调节器的系统行为非常有用,且无需重启。

Annotation

Implementation Notes