[Acer Iconia A500] _motley:
Hello fellow iconians. I have created a down and dirty shell script to log CPU percentage and clock speed to a text file during different activities so I could see what those tegra 2 cores were doing. Now that overclocking has come to our Iconias, folks are wondering "What are my CPU cores doing?" This script is simple and fairly easy to use. If you don't like it, feel free to change it, but please share your improvements in this thread so we can all benefit.

Click thanks if you find this useful;).

Requirements: root access, busybox 1.18 or higher, and a terminal app

To use:

Copy the script file to a folder where you can assign execute permissions (i.e. /system)

Assign exec permissions to the script: $ chmod 777 getcpucurrinfo.sh

Run the script: $ ./getcpucurrinfo.sh

View the output from the terminal: $ cat /sdcard/getcpucurrinfo.txt

Delete the text log to get a clean start (it appends): $ rm /sdcard/getcpucurrinfo.txt

The output will look like this:

***Start logging to /sdcard/getcpucurrinfo.txt Mon Jun 27 23:17:27 EDT 2011
CPU0: 15% @ 1400000 MHz || CPU1: 06% @ 1400000 MHz
CPU0: 19% @ 1000000 MHz || CPU1: 07% @ 1000000 MHz
CPU0: 15% @ 1000000 MHz || CPU1: 05% @ 1000000 MHz
CPU0: 12% @ 1400000 MHz || CPU1: 05% @ 1400000 MHz
CPU0: 07% @ 1400000 MHz || CPU1: 03% @ 1400000 MHz
CPU0: 09% @ 1000000 MHz || CPU1: 07% @ 1000000 MHz
CPU0: 17% @ 1000000 MHz || CPU1: 09% @ 1000000 MHz
CPU0: 11% @ 1000000 MHz || CPU1: 06% @ 1000000 MHz
CPU0: 18% @ 1400000 MHz || CPU1: 10% @ 1400000 MHz

View attachment 639151 (just the script, not recovery flash-able!):

MD5 (getcpucurrinfo.sh) = bb6a7219a904412307899adf14eadd56

#!/system/bin/bash
# getcpucurrinfo.sh
#
# What are my Android dual CPUs doing?
#
# _motley 2011
# based on a script posted by paul colby http://colby.id.au/node/39
# free to distribute and modify for your use, but please give credit.
#
# logs cpu info to /sdcard/getcpucurrinfo.txt
#
# Usage: $ ./getcpucurrinfo.sh
# Then check results: $ cat /sdcard/getcpucurrinfo.txt
#
# To install:
# 1-copy script file to a folder where you can assign execute permissions (i.e. /system)
# 2-assign exec permissions ( $ chmod 777 /system/getcpucurrinfo.txt )
# 3-requires bash and busybox 1.18 or higher

echo "Started logging to /sdcard/getcpucurrinfo.txt...press ctl+c to stop"
echo ***Start logging to /sdcard/getcpucurrinfo.txt `date` >> /sdcard/getcpucurrinfo.txt

PREV_TOTAL=0
PREV_IDLE=0

PREV_TOTAL1=0
PREV_IDLE1=0

while true; do
CPU=(`cat /proc/stat | grep '^cpu0 '`) # Get the total CPU statistics.
CPU1=(`cat /proc/stat | grep '^cpu1 '`)

unset CPU[0] # Discard the "cpu" prefix.
IDLE=${CPU[4]} # Get the idle CPU time.

unset CPU1[0] # Discard the "cpu" prefix.
IDLE1=${CPU1[4]} # Get the idle CPU time.

# Calculate the total CPU time.
TOTAL=0
for VALUE in "${CPU[@]}"; do
let "TOTAL=$TOTAL+$VALUE"
done

TOTAL1=0
for VALUE1 in "${CPU1[@]}"; do
let "TOTAL1=$TOTAL1+$VALUE1"
done

# Calculate the CPU usage since we last checked.
let "DIFF_IDLE=$IDLE-$PREV_IDLE"
let "DIFF_TOTAL=$TOTAL-$PREV_TOTAL"
let "DIFF_USAGE=(1000*($DIFF_TOTAL-$DIFF_IDLE)/$DIFF_TOTAL+5)/10"

let "DIFF_IDLE1=$IDLE1-$PREV_IDLE1"
let "DIFF_TOTAL1=$TOTAL1-$PREV_TOTAL1"
let "DIFF_USAGE1=(1000*($DIFF_TOTAL1-$DIFF_IDLE1)/$DIFF_TOTAL1+5)/10"

# Output to text file
echo "CPU0: `printf "%02d" $DIFF_USAGE`% @ `cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq` MHz || CPU1: `printf "%02d" $DIFF_USAGE1`% @ `cat /sys/devices/system/cpu/cpu1/cpufreq/scaling_cur_freq` MHz" >> /sdcard/getcpucurrinfo.txt

# Remember the total and idle CPU times for the next check.
PREV_TOTAL="$TOTAL"
PREV_IDLE="$IDLE"

PREV_TOTAL1="$TOTAL1"
PREV_IDLE1="$IDLE1"

# Wait before checking again.
sleep 1

done