1. GPU 相关参数目录
/d/ged/hal/
Z91:/d/ged/hal # ls -all
ls -all
total 0
drwxr-xr-x 2 root root 0 1970-01-01 08:00 .
drwxr-xr-x 4 root root 0 1970-01-01 08:00 ..
-r--r--r-- 1 root root 0 1970-01-01 08:00 current_freqency
-rw-rw-rw- 1 root root 0 1970-01-01 08:00 custom_boost_gpu_freq
-rw-rw-rw- 1 root root 0 1970-01-01 08:00 custom_dvfs_mode
-rw-rw-rw- 1 root root 0 1970-01-01 08:00 custom_upbound_gpu_freq
-rw-rw-rw- 1 root root 0 2018-02-07 09:48 event_notify
-rw-rw-rw- 1 root root 0 1970-01-01 08:00 fps_upper_bound
-r--r--r-- 1 root root 0 1970-01-01 08:00 ged_kpi
-r--r--r-- 1 root root 0 1970-01-01 08:00 gpu_utilization
-r--r--r-- 1 root root 0 1970-01-01 08:00 integration_report
--w--w--w- 1 root root 0 1970-01-01 08:00 media_event
-r--r--r-- 1 root root 0 1970-01-01 08:00 previous_freqency
-r--r--r-- 1 root root 0 1970-01-01 08:00 total_gpu_freq_level_count
-rw-rw-rw- 1 root root 0 2018-02-07 08:22 vsync_offset_level
1.1 /d/ged/hal/current_freqency
获取 GPU 频率
cat current_freqency
3 290000
1.2 /d/ged/hal/custom_boost_gpu_freq
0
1.3 /d/ged/hal/custom_dvfs_mode
0
1.4 /d/ged/hal/custom_upbound_gpu_freq
3
1.5 /d/ged/hal/event_notify
cat event_notify
g_ui32EventStatus =0
g_ui32EventDebugStatus =0
Touch: 0
WFD: 0
MHL: 0
GAS: 0
VR: 0
Thermal: 0
Low power mode: 0
MHL4K Video: 0
Video merge MD: 0
LCD: 0
NETWORK: 0
DOPT_WIFI_SCAN: 0
1.6 /d/ged/hal/fps_upper_bound
60
1.7 /d/ged/hal/ged_kpi
0,1521372427,96961,1550167888,17131845,28698500,290
1.8 /d/ged/hal/gpu_utilization
0 0 100
1.9 /d/ged/hal/integration_report
GPU Utilization fp: ffffff80085c1188
GPU DVFS idx commit fp: ffffff80085c165c
GPU clock notify on: 1
GPU clock notify off: 1
1.10 /d/ged/hal/media_event
居然重启了,没查到什么东西
1.11 /d/ged/hal/previous_freqency
0 450000
1.12 /d/ged/hal/total_gpu_freq_level_count
获取系统有多少级 GPU 频率
4
1.13 /d/ged/hal/vsync_offset_level
8300000
2. GPU 频率获取
GpuUtils.java
package com.fadisu.cpurun.util;
import com.fadisu.cpurun.bean.GpuFreqInfo;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
public class GpuUtils {
/**
* CPU 场景配置文件
*
* @return
*/
public static GpuFreqInfo getGpuFreq() {
GpuFreqInfo result = new GpuFreqInfo();
BufferedReader br = null;
try {
String line;
br = new BufferedReader(new FileReader("/d/ged/hal/current_freqency"));
if ((line = br.readLine()) != null) {
String[] info = line.split("\\s+");
result.id = Integer.parseInt(info[0]);
result.freq = Integer.parseInt(info[1]);
}
br.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (br != null) {
try {
br.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return result;
}
}
GpuFreqInfo.java
package com.fadisu.cpurun.bean;
public class GpuFreqInfo {
public int id;
public int freq;
}