Hi,
Yes I am running tegrastats and trying to figure out where it is getting it’s information from. tegrastats’ output is not easily machine parse-able, and I need to record load metrics via my own task to ensure we don’t run out of GPU processing space at a critical point in a mission.
I know an nvidia representative hasn’t endorsed this directly, but many posts on the forum recommend using strace to figure out what tegrastats is reading from so we can access the information directly.
The interesting thing about tegrastats is that it simply reads files in “/sys” or “proc”. As an interesting experiment, if you don’t already have “strace” installed, do so with “sudo apt-get install strace”. Then run tegrastats via strace, but redirect the “standard output” to “/dev/null”:
sudo strace tegrastats 1>/dev/null
You’ll see just the strace output, including the calls to files in “/proc” and “/sys”. This repeats, so just hit CTRL-c to stop after one reading. You can easily read those…
I don’t know the details, but programs like ps, xosview, and top (and my favorite, htop) tend to aggregate what they use from “/proc”. Note that most of those link to “libprocps.so”, although they might use their own algorithm to look at individual files in “/proc”.
An interesting tool is “strace”. For example, to see system calls from ps (mixed with actual ps output):
sudo strace ps 2>&1 | less
Within less search for “proc” via:
/proc
(then the “n” key for the next match, or “p” key for pr…
GPU load reporting is at /sys/devices/platform/host1x/gpu.0/load
For those looking for other points of data you can get more info by running sudo sh -c “strace ./tegrastats 2>&1 | grep open”
open("/sys/devices/system/cpu/cpu1/online", O_RDONLY) = 3
open("/sys/devices/system/cpu/cpu2/online", O_RDONLY) = 3
open("/sys/devices/system/cpu/cpu0/online", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/sys/kernel/debug/clock/cpu/rate", O_RDONLY) = 3
open("/sys/devices/system/cpu/cpu1/online"…