有没有办法删除旧的统计数据,以重新开始?我已将cpufrequtils文件中的最大CPU速度设置为950 D0.我的问题是,这个限制在启动时没有起作用,在此期间,cpufrequtils正在收集从输出:cpufreq stats: 1.20 GHz:27,27%中可以看到的数据。因此,在引导之后,我想将统计值重置为零。
peter@peter-HP-Compaq-2510p:~$ cpufreq-info
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
driver: acpi-cpufreq
CPUs which run at the same hardware frequency: 0
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: 10.0 us.
hardware limits: 800 MHz - 1.20 GHz
available frequency steps: 1.20 GHz, 1.07 GHz, 933 MHz, 800 MHz
available cpufreq governors: conservative, ondemand, userspace, powersave, performance
current policy: frequency should be within 800 MHz and 950 MHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency is 933 MHz.
cpufreq stats: 1.20 GHz:27,27%, 1.07 GHz:0,48%, 933 MHz:47,91%, 800 MHz:24,34% (1449)
analyzing CPU 1:
driver: acpi-cpufreq
CPUs which run at the same hardware frequency: 1
CPUs which need to have their frequency coordinated by software: 1
maximum transition latency: 10.0 us.
hardware limits: 800 MHz - 1.20 GHz
available frequency steps: 1.20 GHz, 1.07 GHz, 933 MHz, 800 MHz
available cpufreq governors: conservative, ondemand, userspace, powersave, performance
current policy: frequency should be within 800 MHz and 950 MHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency is 933 MHz.
cpufreq stats: 1.20 GHz:30,29%, 1.07 GHz:0,29%, 933 MHz:51,91%, 800 MHz:17,52% (763)
peter@peter-HP-Compaq-2510p:~$ 
编辑:尝试遵循在答复中给出的建议,但文件夹中没有重置:
peter@peter-HP-Compaq-2510p:~$ cd /sys/devices/system/cpu/cpu0/cpufreq/stats
peter@peter-HP-Compaq-2510p:/sys/devices/system/cpu/cpu0/cpufreq/stats$ ls -l
total 0
-r--r--r-- 1 root root 4096 apr 28 09:46 time_in_state
-r--r--r-- 1 root root 4096 apr 28 09:46 total_trans
-r--r--r-- 1 root root 4096 apr 28 09:46 trans_table
peter@peter-HP-Compaq-2510p:/sys/devices/system/cpu/cpu0/cpufreq/stats$ dir
time_in_state total_trans trans_table
peter@peter-HP-Compaq-2510p:/sys/devices/system/cpu/cpu0/cpufreq/stats$ 发布于 2019-04-27 22:15:04
:/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可用于重置stat计数器的只读属性。这对于在不需要重新启动的情况下评估不同调控器下的系统行为很有用。
这应该重置所有的统计数据:
echo '1' | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/stats/reset来自:如何使用频率
允许设置
-d minimum frequency,
-u maximum frequency,
-f specific frequency (userspace governor must be set first) and
-g governor on a
-c specific CPU.cpufreq-set需要根特权才能工作。
在您的设置中查找这个:
sudo cpufreq-set -u 950MGhz然后把它移走。或将此添加到您的设置中:
sudo cpufreq-set -u 1.20Ghz/etc/default/cpufrequtils中的调控器变量未生效
因此,您在/etc/default/cpufrequtils中配置了调控器变量,在重新启动之后,通过运行cpufreq-info注意到,活动调控器仍然是“按需”。
如果您安装了膝上型计算机模式工具,可能会发生这种情况。膝上型计算机模式通过以下变量配置活动调控器: BATT_CPU_GOVERNOR、LM_AC_CPU_GOVERNOR、NOLM_AC_CPU_GOVERNOR.您可以在/etc/膝上型/笔记本-mode.conf中根据自己的喜好重写它们:
BATT_CPU_GOVERNOR=powersave
LM_AC_CPU_GOVERNOR=conservative
NOLM_AC_CPU_GOVERNOR=ondemand来自:CPU频率缩放
在极少数情况下,可能需要手动设置最大和最小频率。
若要设置最大时钟频率(clock_freq是具有单位: GHz、MHz)的时钟频率:
sudo cpupower frequency-set -u clock_freq要设置最小时钟频率,请执行以下操作:
sudo cpupower frequency-set -d clock_freq若要将CPU设置为以指定频率运行:
sudo cpupower frequency-set -f clock_freqhttps://askubuntu.com/questions/1138729
复制相似问题