[Atrix 4G Android Development] Da_G:
Hi again :)

The Atrix 4G includes a nice little command-line app called "tegrastats" (root required)

The app has 4 functions:

"tegrastats -max" - sets cpu min and max frequencies to 1ghz (locks cpu speed @ max)

"tegrastats -default" - sets cpu min and max frequencies to default (seems to range from 300MHz to 1000MHz and have many more steppings available than listed in /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies)

"tegrastats [delay in ms]" - outputs a line per second to adb logcat detailing the current system load per cpu, overall, and the % load relative to current CPU speed. If [delay in ms] is specified that value will be used for the delay between logcat updates rather than 1 second.

"tegrastats -debug" - same as above with more detailed info

[size=+1]What does the logcat output mean?[/size]

RAM X/Y (lfb Z) - X is the amount of RAM in use in megabytes. Y is the total amount of RAM available for applications. Z is the size of the largest free block.

Carveout X/Y (lfb Z) - ("carveout" refers to video memory, or GPU memory.) X is the amount of carveout memory in use, in megabytes. Y is the total amount available. Z is the size of the largest free block.

GART X/Y (lfb Z) - ("GART" refers to system memory that has been mapped to be visible to the GPU. It is typically allocated when carveout allocations fail.) X is the amount of GART memory in use, in megabytes Y is the total amount available. Z is the size of the largest free block.

IRAM X/Y (lfb Z) - ("IRAM" refers to dedicated memory attached to the AVP processor.) X is the amount of IRAM memory in use, in kilobytes. Y is the total amount available. Z is the size of the largest free block.

cpu [X%,Y%]@Z - X is the percent of CPU0 being used relative to the current running frequency. Z. Y is the percent of CPU1 being used (or 'off' if second core is turned off.) Z is the CPU frequency in MHz (the frequency will dynamically go up or down depending on what workload the CPU is seeing.)

avp X%@Y - ("avp" is the audio/video processor, which is not visible to either the OS or applications. However, some forms of video decode/encode make heavy use of it.) X is the percent of the AVP that is being used (aka CPU load), relative to the current running frequency Y. Y is the AVP frequency in MHz (the frequency will dynamically go up or down depending on what workload the AVP is seeing)

vde X%@Y ("vde" is the video decode engine.) X is the percent of the VDE that is being used (aka CPU load), relative to the current running frequency Y. Y is the VDE frequency in MHz.

emc X%@Y ("emc" is the external memory controller, which all sysmem/carveout/GART memory accesses go through) X is the percent of the EMC memory bandwidth that is being used, relative to the current running frequency Y. Y is the EMC frequency in MHz.

I've noticed that changing CPU limits with SetCPU or /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq & scaling_max_freq seem to conflict with the built in Dynamic Frequency Scaler, sometimes it honors the request, other times overrides it (per the tegrastats output)

For more info about tegrastats etc.: http://developer.download.nvidia.com/tegra/docs/linux_for_tegra_quickstart_20100903_10_8_2.pdf

Below are several sample output lines from "tegrastats -debug" from adb:

03-16 19:11:10.669 10014 10014 E TegraStats: total0 101 idle0 96 | total1 146 idle1 146
03-16 19:11:10.669 10014 10014 E TegraStats: DFS CPU load 6, OS CPU load 2
03-16 19:11:10.669 10014 10014 E TegraStats: RAM 555/818MB (lfb 1x2MB) Carveout 48/192MB (lfb 38MB) GART 11204/32768KB (lfb 8MB) GART_Free(21564KB) GART_Pins(80KB) GART_Non-Pins(11124KB, lnpb(1056KB)) IRAM 72/256kB (lfb 184kB) | DFS(%@MHz): cpu [4%,0%]@501 avp 2%@120 vde 0%@120 emc 0%@108
03-16 19:11:11.670 10014 10014 E TegraStats: total0 100 idle0 88 | total1 149 idle1 149
03-16 19:11:11.670 10014 10014 E TegraStats: DFS CPU load 9, OS CPU load 4
03-16 19:11:11.670 10014 10014 E TegraStats: RAM 555/818MB (lfb 1x2MB) Carveout 48/192MB (lfb 38MB) GART 11204/32768KB (lfb 8MB) GART_Free(21564KB) GART_Pins(80KB) GART_Non-Pins(11124KB, lnpb(1056KB)) IRAM 72/256kB (lfb 184kB) | DFS(%@MHz): cpu [12%,0%]@501 avp 2%@120 vde 0%@120 emc 0%@108
03-16 19:11:12.679 10014 10014 E TegraStats: total0 100 idle0 90 | total1 105 idle1 104
03-16 19:11:12.679 10014 10014 E TegraStats: DFS CPU load 13, OS CPU load 5
03-16 19:11:12.679 10014 10014 E TegraStats: RAM 555/818MB (lfb 1x2MB) Carveout 48/192MB (lfb 38MB) GART 11204/32768KB (lfb 8MB) GART_Free(21564KB) GART_Pins(80KB) GART_Non-Pins(11124KB, lnpb(1056KB)) IRAM 72/256kB (lfb 184kB) | DFS(%@MHz): cpu [10%,0%]@501 avp 2%@120 vde 0%@120 emc 0%@108
03-16 19:11:13.679 10014 10014 E TegraStats: total0 101 idle0 99 | total1 49 idle1 49
03-16 19:11:13.679 10014 10014 E TegraStats: DFS CPU load 8, OS CPU load 1
03-16 19:11:13.679 10014 10014 E TegraStats: RAM 555/818MB (lfb 1x2MB) Carveout 48/192MB (lfb 38MB) GART 11204/32768KB (lfb 8MB) GART_Free(21564KB) GART_Pins(80KB) GART_Non-Pins(11124KB, lnpb(1056KB)) IRAM 72/256kB (lfb 184kB) | DFS(%@MHz): cpu [1%,0%]@501 avp 2%@120 vde 0%@120 emc 0%@108
03-16 19:11:14.679 10014 10014 E TegraStats: total0 100 idle0 99 | total1 68 idle1 68
03-16 19:11:14.689 10014 10014 E TegraStats: DFS CPU load 5, OS CPU load 0
03-16 19:11:14.689 10014 10014 E TegraStats: RAM 555/818MB (lfb 1x2MB) Carveout 48/192MB (lfb 38MB) GART 11204/32768KB (lfb 8MB) GART_Free(21564KB) GART_Pins(80KB) GART_Non-Pins(11124KB, lnpb(1056KB)) IRAM 72/256kB (lfb 184kB) | DFS(%@MHz): cpu [1%,0%]@501 avp 2%@120 vde 0%@120 emc 0%@108
03-16 19:11:15.691 10014 10014 E TegraStats: total0 101 idle0 99 | total1 93 idle1 93
03-16 19:11:15.691 10014 10014 E TegraStats: DFS CPU load 4, OS CPU load 1
03-16 19:11:15.691 10014 10014 E TegraStats: RAM 555/818MB (lfb 1x2MB) Carveout 48/192MB (lfb 38MB) GART 11204/32768KB (lfb 8MB) GART_Free(21564KB) GART_Pins(80KB) GART_Non-Pins(11124KB, lnpb(1056KB)) IRAM 72/256kB (lfb 184kB) | DFS(%@MHz): cpu [1%,0%]@501 avp 2%@120 vde 0%@120 emc 0%@108
03-16 19:11:16.692 10014 10014 E TegraStats: total0 100 idle0 98 | total1 195 idle1 193
03-16 19:11:16.692 10014 10014 E TegraStats: DFS CPU load 5, OS CPU load 1
03-16 19:11:16.692 10014 10014 E TegraStats: RAM 555/818MB (lfb 1x2MB) Carveout 48/192MB (lfb 38MB) GART 11204/32768KB (lfb 8MB) GART_Free(21564KB) GART_Pins(80KB) GART_Non-Pins(11124KB, lnpb(1056KB)) IRAM 72/256kB (lfb 184kB) | DFS(%@MHz): cpu [2%,1%]@501 avp 2%@120 vde 0%@120 emc 0%@108