2. Purpose
This program was created to monitor CPU related behavior, by reporting result
after thermal management mechanism starts with information such as throttled
CPU temperature, frequency and trigger flag.
Preparation
1. Ubuntu/Linux environment is recommended to run this tool.
2. This tool will be functional in any kind of product on Android platform by
adb shell, including Smart phone (S500) and Tablet
(A720/A510/A700/A210/A100).
Contributions
1. Help User (RD/TE) to be familiar with the basic operation of CPU throttling
mechanism no matter on platform nVidia Tegra or QCT 8X series.
2. Customized configuration of testing count, timing and throttling threshold
are done within this tool to fit with different need in specified project.
3. Automatically report for the result of successfully CPU throttled by
customized messages such as, “Normal”, “PASS” or “Failed”.
4. Can be logged to text file for developer’s reference when problems need to
be traced or solved.
Concept
1. All related source code was created with shell script under GPL agreement .
2. Several arguments, variables or path may need to be fixed or adjusted by
specified project.
3. By regularly reporting routines, it will show the current platform
information (CPU frequency/temperature/flag, etc.), once the customized
threshold was reached, the information will changed to show messages
related to throttled result.
4. This tool will be automatically shutdown once the goal (successfully
throttled) was done, otherwise the process will keep going on monitoring.
Operation
1. Copy tool “run_nTM.sh” to path where adb resides.
cp run_nTM.sh /the/path/of/your/adb
2. Change permission by the following command,
chmod 755 run_nTM.sh
3. 3. Execute by the following command,
./run_nTM.sh
4. Console will show message as follow, please input with decimal number.
5. Input customized Throttling threshold with decimal number.
6. Daemon will start to monitor as the following message, Status item will
keep showing “Normal” when one any threshold was reached.
7. Daemon starts analyze the latest status once Throttling threshold was
reached by the following message, If DUT is still getting hot, the
monitoring daemon will keep working as usual by show “Failed, try again!”
as below:
4. 8. The “PASS” message will be popup to user when any one of cooling
condition was reached, including the lower of CPU frequency, temperature,
or Throttling flag was dismissed. Daemon will be automatically killed once
the result is PASS within 10 seconds. (customizable)
Implementation
Source code is presented at the bottom of this document.
5. #!/bin/bash
#
# Program: nVidia Throttling Monitor (nTM)
# This program was created to monitor CPU temperature
# and clock, reporting result after throttle mechanism starts.
#Arthor:
# StanleyTW_Chang@acer.com.tw
# History:
# 2012/10/25 v0.2
#Sysfs node:
# CPU Temperature: /sys/devices/platform/tegra-i2c.4/i2c-4/4-004c/temperature
# CPU Frequency: /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
# CPU Frequency: /d/clock/cpu/rate
# Throttle Flag: /sys/devices/system/cpu/cpu0/cpufreq/throttle
# Throttle Flag: /d/cpu-tegra/throttle
count=0
cpu_tp=0
cpu_ck=0
new_ck=0
cpu_tl=2
tl_level=0
st_level=90
bat_tp=0
chg_cr=0
tmp_lv=0
echo -n "Please Input Testing Count : "
read count
if [ "$count" = 0 -o "$count" = "" ]; then
echo "Invalid count, input AGAIN! "
read count
fi
echo -n "Please Input Throttle Threshold (>0) : "
read tl_level
if [ "$tl_level" = 0 -o "$tl_level" = "" ]; then