NVIDIA Tegra
NVIDIA DRIVE OS 5.1 Linux SDK

Developer Guide
5.1.15 Release


 
tegrastats Utility
 
Reported Statistics
Running tegrastats
Re-Deploying tegrastats
tegrastats Options
This sdk provides the tegrastats utility, which reports memory usage and processor usage for Tegra-based devices.
You can find the utility in your package at the following location.
<top>/drive-t186ref-linux/bin-target/tegrastats
Reported Statistics
The following table shows the statistics the tegrastats utility reports.
Statistic
X
Y
Z
RAM X/Y (lfb NxZ)
Largest Free Block (lfb) is a statistic about the memory allocator. It refers to the largest contiguous block of physical memory that can currently be allocated: at most 4 MB. It can become smaller with memory fragmentation.
 
The physical allocations in virtual memory can be bigger.
Amount of RAM in use in MB.
Total amount of RAM available for applications.
Z is the size of the largest free block, N the number of free blocks of this size.
 
SWAP X/Y (cached Z)
Amount of SWAP in use in megabytes.
Total amount of SWAP available for applications.
Amount of SWAP cached in megabytes.
IRAM X/Y (lfb Z)
 
IRAM is memory local to the video hardware engine.
Amount of IRAM memory in use, in kilobytes.
Total amount of IRAM memory available.
Size of the largest free block.
CPU [X%,Y%, , ]@Z
or
CPU [X%@Z, Y%@Z,...]
 
X and Y are rough approximations based on time spent in the system idle process as reported by the Linux kernel in /proc/stat.
Load statistics for each of the CPU cores relative to the current running frequency Z, or 'off' in case a core is currently powered down.
Load statistics for each of the CPU cores relative to the current running frequency Z, or 'off' in case a core is currently powered down.
CPU frequency in megahertz. Goes up or down dynamically depending on the CPU workload.
APE Y
 
APE is the audio processing engine. The APE subsystem consists of ADSP (Cortex®-A9 CPU), mailboxes, AHUB, ADMA, etc.
N/A
APE frequency in megahertz.
N/A
GR3D X%@Y
 
GR3D is the GPU engine.
Percent of the GR3D that is being used, relative to the current running frequency.
GR3D frequency in megahertz
N/A
EMC X%@Y
 
EMC is the external memory controller, through which all sysmem/carve-out/GART memory accesses go.
Percent of EMC memory bandwidth being used, relative to the current running frequency.
EMC frequency in megahertz.
N/A
MSENC Y
 
MSENC is the video hardware encoding engine.
N/A
MSENC frequency in megahertz.
N/A
NVDEC Y
 
NVDEC is the video hardware decoding engine. It is shown only when hardware decoder/encoder engine is used.
N/A
NVDEC frequency in megahertz.
N/A
MTS fg X% bg Y%
Time spent in foreground tasks.
Time spent in background tasks.
N/A
[temp name] C
 
[temp name] is one of the names under the nodes /sys/devices/virtual/thermal/thermal_zoneX/type.
Temperature in degrees Celsius.
N/A
N/A
Running tegrastats
When you run tegrastats on Linux devices, it prints statistics to stdout.
Example Log Print
RAM 2669/7846MB (lfb 1065x4MB) CPU [100%@345,100%@2419,100%@2419,100%@344,11%@346,100%@345] EMC_FREQ 17%@1600 GR3D_FREQ 0%@114 APE 150 MTS fg 0% bg 0% PLL@43C thermal@42.8C MCPU@43C Tboard@40C AO@42.5C GPU@49C PMIC@100C BCPU@43C Tdiode@43.5C VDD_IN 5224/3423 VDD_CPU 844/712 VDD_GPU 360/361 VDD_SOC 884/664 VDD_WIFI -114/-91 VDD_DDR 240/240
To run tegrastats
To run tegrastats in the background, execute the following command:
tegrastats --interval <int> --logfile <out_file> &
Where:
<int> is the interval between log prints in milliseconds.
<out_file> is the pathname of the output file to which tegrastats writes the log prints.
To run tegrastats in the foreground, omit the trailing ‘&’. You may also omit the --logfile option to allow log output to go to stdout:
tegrastats --interval <int>
To stop tegrastats
If tegrastats is running in the background, execute the following commands:
ps
kill -9 <pid>
Where <pid> is the process ID of tegrastats as reported by the ps command.
Alternatively, you may run:
tegrastats --stop
If tegrastats is running in the foreground, press CTRL+C in the window where it is running.
Re-Deploying tegrastats
The tegrastats utility is preinstalled. If you have removed tegrastats from the build, you can re-deploy it on the target at runtime.
To re-deploy tegrastats
Execute the following comnand from the host PC:
scp tegrastats nvidia@<TARGET_DEVICE_IP>:/home/nvidia/
tegrastats Options
tegrastats supports the following command line options.
Option
Meaning
--help
Prints this help screen.
--interval <millisec>
Samples the information in <milliseconds>.
--logfile <filename>
Dumps the output of tegrastats to <filename>.
--load_cfg <filename>
Loads the information from <filename>.
--save_cfg <filename>
Saves the information to <filename>.
--start
Runs tegrastats as a daemon process in the background.
--stop
Stops any running instances of tegrastats.
--verbose
Prints verbose message.