Source for tegrastats and/or info about querying overall GPU utilization?

Hi there,
Is the source code or underlying mechanism used by the tegrastats scrip available somewhere?

We would like to write a tool to programatically monitor/report the overall GPU usage.

We could just “scrape” the output of tegrastats, but it seems like it would be better to read the underlying information directly. Is there a file in /proc (or elsewhere) where the overall GPU utilization can be read from?

Thanks!

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", O_RDONLY) = 3
open("/sys/kernel/debug/clock/cpu/rate", O_RDONLY) = 3
open("/sys/devices/system/cpu/cpu2/online", O_RDONLY) = 3
open("/sys/kernel/debug/clock/cpu/rate", O_RDONLY) = 3
open("/sys/devices/system/cpu/cpu3/online", O_RDONLY) = 3
open("/sys/kernel/debug/clock/cpu/rate", O_RDONLY) = 3
open("/proc/stat", O_RDONLY)            = 3
open("/proc/meminfo", O_RDONLY)         = 3
open("/sys/devices/platform/tegra-nvmap/misc/nvmap/heap-generic-0/total_size", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/sys/devices/platform/tegra-nvmap/misc/nvmap/heap-generic-0/free_size", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/sys/devices/platform/tegra-nvmap/misc/nvmap/heap-generic-0/free_max", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/sys/kernel/debug/cpu-tegra/cpu_edp_limit", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/devices/virtual/thermal/", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 3
open("/sys/devices/virtual/thermal/thermal_zone0/type", O_RDONLY) = 4
open("/sys/devices/virtual/thermal/thermal_zone1/type", O_RDONLY) = 4
open("/sys/devices/virtual/thermal/thermal_zone2/type", O_RDONLY) = 4
open("/sys/devices/virtual/thermal/thermal_zone3/type", O_RDONLY) = 4
open("/sys/devices/virtual/thermal/thermal_zone4/type", O_RDONLY) = 4
open("/sys/devices/virtual/thermal/thermal_zone5/type", O_RDONLY) = 4
open("/sys/devices/virtual/thermal/thermal_zone6/type", O_RDONLY) = 4
open("/sys/devices/virtual/thermal/thermal_zone7/type", O_RDONLY) = 4
open("/proc/iovmminfo", O_RDONLY)       = -1 ENOENT (No such file or directory)
open("/sys/devices/platform/tegra-nvmap/misc/nvmap/heap-iram/total_size", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/sys/devices/platform/tegra-nvmap/misc/nvmap/heap-iram/free_size", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/sys/devices/platform/tegra-nvmap/misc/nvmap/heap-iram/free_max", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/proc/buddyinfo", O_RDONLY)       = 3
open("/dev/gpu_freq_max", O_RDONLY)     = 3
open("/dev/gpu_freq_min", O_RDONLY)     = 3
open("/dev/cpu_freq_max", O_RDONLY)     = 3
open("/dev/cpu_freq_min", O_RDONLY)     = 3
open("/dev/min_online_cpus", O_RDONLY)  = 3
open("/dev/max_online_cpus", O_RDONLY)  = 3
open("/sys/kernel/debug/tegra_denver/nvmstats/instantaneous_stats", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/sys/kernel/debug/clock/emc/rate", O_RDONLY) = 3
open("/sys/kernel/debug/clock/avp.sclk/rate", O_RDONLY) = 3
open("/sys/kernel/debug/clock/vde/rate", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/sys/kernel/debug/clock/3d/rate", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/sys/kernel/debug/clock/gk20a.gbus/rate", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/sys/kernel/debug/clock/gm20b.gbus/rate", O_RDONLY) = 3
open("/sys/kernel/debug/tegra_actmon/emc/avg_activity", O_RDONLY) = 3
open("/sys/kernel/debug/tegra_actmon/avp/avg_activity", O_RDONLY) = 3
open("/sys/kernel/debug/tegra_host/3d_actmon_avg_norm", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/sys/devices/platform/host1x/gk20a.0/load", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/sys/devices/platform/host1x/gpu.0/load", O_RDONLY) = 3

Any info on how to cpu load precentage? Also what are units are gpu.0/load? See numbers above 100 in that field, so don’t understand how to compute a precentage.

Hi richtark,

Introducing from r24.2.1, we added the Tegra Stats Utility section at L4T documentation, you can check the percentage by use tegrastats: https://developer.nvidia.com/embedded/dlc/l4t-documentation-24-2-1

Thanks

Here’s the strace output for a Xavier

openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib/aarch64-linux-gnu/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib/aarch64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/tmp/", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3
openat(AT_FDCWD, "/tmp/.tstats.txt", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/present", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_cur_freq", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu2/cpufreq/cpuinfo_cur_freq", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu3/cpufreq/cpuinfo_cur_freq", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu4/cpufreq/cpuinfo_cur_freq", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu5/cpufreq/cpuinfo_cur_freq", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu6/cpufreq/cpuinfo_cur_freq", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu7/cpufreq/cpuinfo_cur_freq", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/kernel/debug/gpu_pci/clocks/gpc2clk", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/sys/bus/pci/drivers/nvgpu/", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3
openat(AT_FDCWD, "/sys/bus/pci/drivers/nvgpu/module/load", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/sys/kernel/debug/nvmap/iram/size", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/proc/meminfo", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/kernel/debug/tegra_denver/nvmstats/instantaneous_stats", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/devices/virtual/thermal/", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3
openat(AT_FDCWD, "/sys/devices/virtual/thermal/", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3
openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone3/temp", O_RDONLY) = 4
openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone3/type", O_RDONLY) = 4
openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone1/temp", O_RDONLY) = 4
openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone1/type", O_RDONLY) = 4
openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone6/temp", O_RDONLY) = 4
openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone6/type", O_RDONLY) = 4
openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone4/temp", O_RDONLY) = 4
openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone4/type", O_RDONLY) = 4
openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone2/temp", O_RDONLY) = 4
openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone2/type", O_RDONLY) = 4
openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone0/temp", O_RDONLY) = 4
openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone0/type", O_RDONLY) = 4
openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone7/temp", O_RDONLY) = 4
openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone7/type", O_RDONLY) = 4
openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone5/temp", O_RDONLY) = 4
openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone5/type", O_RDONLY) = 4
openat(AT_FDCWD, "/sys/bus/i2c/devices/", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3
openat(AT_FDCWD, "/sys/bus/i2c/devices/0-0040/name", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/sys/bus/i2c/devices/0-0041/name", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/sys/bus/i2c/devices/1-0040/name", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/bus/i2c/devices/1-0040/iio_device/", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3
openat(AT_FDCWD, "/sys/bus/i2c/devices/1-0040/iio_device/rail_name_1", O_RDONLY) = 4
openat(AT_FDCWD, "/sys/bus/i2c/devices/1-0040/iio_device/in_power1_input", O_RDONLY) = 4
openat(AT_FDCWD, "/sys/bus/i2c/devices/1-0040/iio_device/rail_name_2", O_RDONLY) = 4
openat(AT_FDCWD, "/sys/bus/i2c/devices/1-0040/iio_device/in_power2_input", O_RDONLY) = 4
openat(AT_FDCWD, "/sys/bus/i2c/devices/1-0040/iio_device/rail_name_0", O_RDONLY) = 4
openat(AT_FDCWD, "/sys/bus/i2c/devices/1-0040/iio_device/in_power0_input", O_RDONLY) = 4
openat(AT_FDCWD, "/sys/bus/i2c/devices/1-0041/name", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/bus/i2c/devices/1-0041/iio_device/", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3
openat(AT_FDCWD, "/sys/bus/i2c/devices/1-0041/iio_device/rail_name_1", O_RDONLY) = 4
openat(AT_FDCWD, "/sys/bus/i2c/devices/1-0041/iio_device/in_power1_input", O_RDONLY) = 4
openat(AT_FDCWD, "/sys/bus/i2c/devices/1-0041/iio_device/rail_name_2", O_RDONLY) = 4
openat(AT_FDCWD, "/sys/bus/i2c/devices/1-0041/iio_device/in_power2_input", O_RDONLY) = 4
openat(AT_FDCWD, "/sys/bus/i2c/devices/1-0041/iio_device/rail_name_0", O_RDONLY) = 4
openat(AT_FDCWD, "/sys/bus/i2c/devices/1-0041/iio_device/in_power0_input", O_RDONLY) = 4
openat(AT_FDCWD, "/sys/bus/i2c/devices/6-0040/name", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/tmp/.tstats.txt", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
openat(AT_FDCWD, "/sys/kernel/debug/bpmp/debug/clk/ape/rate", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/kernel/debug/bpmp/debug/clk/emc/rate", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/kernel/actmon_avg_activity/mc_all", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/kernel/debug/bpmp/debug/clk/gpcclk/rate", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/devices/gpu.0/load", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/kernel/debug/clk/nvenc/clk_enable_count", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/kernel/debug/clk/nvenc1/clk_enable_count", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/kernel/debug/bpmp/debug/clk/nvenc/rate", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/kernel/debug/bpmp/debug/clk/nvenc1/rate", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/kernel/debug/clk/nvdec/clk_enable_count", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/kernel/debug/clk/nvdec1/clk_enable_count", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/kernel/debug/bpmp/debug/clk/nvdec/rate", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/kernel/debug/bpmp/debug/clk/nvdec1/rate", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_cur_freq", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu2/cpufreq/cpuinfo_cur_freq", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu3/cpufreq/cpuinfo_cur_freq", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu4/cpufreq/cpuinfo_cur_freq", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu5/cpufreq/cpuinfo_cur_freq", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu6/cpufreq/cpuinfo_cur_freq", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu7/cpufreq/cpuinfo_cur_freq", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/bus/i2c/devices/1-0040/iio_device/in_power0_input", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/bus/i2c/devices/1-0040/iio_device/in_power1_input", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/bus/i2c/devices/1-0040/iio_device/in_power2_input", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/bus/i2c/devices/1-0041/iio_device/in_power0_input", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/bus/i2c/devices/1-0041/iio_device/in_power1_input", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/bus/i2c/devices/1-0041/iio_device/in_power2_input", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone3/temp", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone1/temp", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone6/temp", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone4/temp", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone2/temp", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone0/temp", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone7/temp", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone5/temp", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu0/online", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu1/online", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu2/online", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu3/online", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu4/online", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu5/online", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu6/online", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu7/online", O_RDONLY) = 3
openat(AT_FDCWD, "/proc/stat", O_RDONLY) = 3
openat(AT_FDCWD, "/proc/meminfo", O_RDONLY) = 3
openat(AT_FDCWD, "/proc/buddyinfo", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/kernel/debug/tegra_denver/nvmstats/instantaneous_stats", O_RDONLY) = 3

I have the same question. How we can calculate CPU usage per cores?
In this link there was the equation to calculate that in general…


But in L4T or more specific on Jetson TX2 which file and which params are needed? Appreciate for any guide to this. Milad

Here is my strace for tegrastat

strace tegrastats 2>&1 | grep open                                                                                                                                                          openat(AT_FDCWD, "/usr/local/cuda-10.2/lib64/tls/aarch64/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)                                                                                   openat(AT_FDCWD, "/usr/local/cuda-10.2/lib64/tls/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)                                                                                           openat(AT_FDCWD, "/usr/local/cuda-10.2/lib64/aarch64/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)                                                                                       openat(AT_FDCWD, "/usr/local/cuda-10.2/lib64/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)                                                                                               openat(AT_FDCWD, "/usr/include/tls/aarch64/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)                                                                                                 openat(AT_FDCWD, "/usr/include/tls/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)                                                                                                         openat(AT_FDCWD, "/usr/include/aarch64/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)                                                                                                     openat(AT_FDCWD, "/usr/include/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)                                                                                                             openat(AT_FDCWD, "tls/aarch64/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)                                                                                                              openat(AT_FDCWD, "tls/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)                                                                                                                      openat(AT_FDCWD, "aarch64/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)                                                                                                                  openat(AT_FDCWD, "libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)                                                                                                                          openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3                                                                                                                                                       openat(AT_FDCWD, "/lib/aarch64-linux-gnu/libm.so.6", O_RDONLY|O_CLOEXEC) = 3                                                                                                                                       openat(AT_FDCWD, "/usr/local/cuda-10.2/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)                                                                                               openat(AT_FDCWD, "/usr/include/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)                                                                                                             openat(AT_FDCWD, "tls/aarch64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)                                                                                                              openat(AT_FDCWD, "tls/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)                                                                                                                      openat(AT_FDCWD, "aarch64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)                                                                                                                  openat(AT_FDCWD, "libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)                                                                                                                          openat(AT_FDCWD, "/lib/aarch64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3                                                                                                                                       openat(AT_FDCWD, "/tmp/", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3                                                                                                                                           openat(AT_FDCWD, "/dev/nvbpmpdebugfs/bpmp_debug/clk/emc/rate", O_RDONLY) = -1 ENOENT (No such file or directory)                                                                                                   openat(AT_FDCWD, "/sys/kernel/actmon_avg_activity/mc_all", O_RDONLY) = 3                                                                                                                                           openat(AT_FDCWD, "/sys/class/devfreq/18000000.vgpu/cur_freq", O_RDONLY) = -1 ENOENT (No such file or directory)                                                                                                    openat(AT_FDCWD, "/sys/kernel/tegra_gpu/gpu_rate", O_RDONLY) = -1 ENOENT (No such file or directory)                                                                                                               openat(AT_FDCWD, "/dev/nvbpmpdebugfs/bpmp_debug/clk/gpcclk/rate", O_RDONLY) = -1 ENOENT (No such file or directory)                                                                                                openat(AT_FDCWD, "/sys/devices/17000000.gp10b/load", O_RDONLY) = 3                                                                                                                                                 openat(AT_FDCWD, "/dev/nvbpmpdebugfs/bpmp_debug/clk/nvenc/state", O_RDONLY) = -1 ENOENT (No such file or directory)                                                                                                openat(AT_FDCWD, "/dev/nvbpmpdebugfs/bpmp_debug/clk/nvenc1/state", O_RDONLY) = -1 ENOENT (No such file or directory)                                                                                               openat(AT_FDCWD, "/dev/nvbpmpdebugfs/bpmp_debug/clk/nvenc/rate", O_RDONLY) = -1 ENOENT (No such file or directory)                                                                                                 openat(AT_FDCWD, "/dev/nvbpmpdebugfs/bpmp_debug/clk/nvenc1/rate", O_RDONLY) = -1 ENOENT (No such file or directory)                                                                                                openat(AT_FDCWD, "/dev/nvbpmpdebugfs/bpmp_debug/clk/nvdec/state", O_RDONLY) = -1 ENOENT (No such file or directory)                                                                                                openat(AT_FDCWD, "/dev/nvbpmpdebugfs/bpmp_debug/clk/nvdec1/state", O_RDONLY) = -1 ENOENT (No such file or directory)                                                                                               openat(AT_FDCWD, "/dev/nvbpmpdebugfs/bpmp_debug/clk/nvdec/rate", O_RDONLY) = -1 ENOENT (No such file or directory)                                                                                                 openat(AT_FDCWD, "/dev/nvbpmpdebugfs/bpmp_debug/clk/nvdec1/rate", O_RDONLY) = -1 ENOENT (No such file or directory)                                                                                                openat(AT_FDCWD, "/dev/nvbpmpdebugfs/bpmp_debug/clk/nvjpg/state", O_RDONLY) = -1 ENOENT (No such file or directory)                                                                                                openat(AT_FDCWD, "/dev/nvbpmpdebugfs/bpmp_debug/clk/nvjpg/rate", O_RDONLY) = -1 ENOENT (No such file or directory)                                                                                                 openat(AT_FDCWD, "/sys/devices/system/cpu/present", O_RDONLY) = 3                                                                                                                                                  openat(AT_FDCWD, "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq", O_RDONLY) = -1 EACCES (Permission denied)                                                                                                openat(AT_FDCWD, "/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq", O_RDONLY) = 3                                                                                                                            openat(AT_FDCWD, "/sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_cur_freq", O_RDONLY) = -1 EACCES (Permission denied)                                                                                                openat(AT_FDCWD, "/sys/devices/system/cpu/cpu1/cpufreq/scaling_cur_freq", O_RDONLY) = 3                                                                                                                            openat(AT_FDCWD, "/sys/devices/system/cpu/cpu2/cpufreq/cpuinfo_cur_freq", O_RDONLY) = -1 EACCES (Permission denied)                                                                                                openat(AT_FDCWD, "/sys/devices/system/cpu/cpu2/cpufreq/scaling_cur_freq", O_RDONLY) = 3                                                                                                                            openat(AT_FDCWD, "/sys/devices/system/cpu/cpu3/cpufreq/cpuinfo_cur_freq", O_RDONLY) = -1 EACCES (Permission denied)                                                                                                openat(AT_FDCWD, "/sys/devices/system/cpu/cpu3/cpufreq/scaling_cur_freq", O_RDONLY) = 3                                                                                                                            openat(AT_FDCWD, "/sys/devices/system/cpu/cpu4/cpufreq/cpuinfo_cur_freq", O_RDONLY) = -1 EACCES (Permission denied)                                                                                                openat(AT_FDCWD, "/sys/devices/system/cpu/cpu4/cpufreq/scaling_cur_freq", O_RDONLY) = 3                                                                                                                            openat(AT_FDCWD, "/sys/devices/system/cpu/cpu5/cpufreq/cpuinfo_cur_freq", O_RDONLY) = -1 EACCES (Permission denied)                                                                                                openat(AT_FDCWD, "/sys/devices/system/cpu/cpu5/cpufreq/scaling_cur_freq", O_RDONLY) = 3                                                                                                                            openat(AT_FDCWD, "/sys/bus/pci/drivers/nvgpu/", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3                                                                                                                     openat(AT_FDCWD, "/sys/bus/pci/drivers/nvgpu/module/load", O_RDONLY) = -1 ENOENT (No such file or directory)                                                                                                       openat(AT_FDCWD, "/proc/meminfo", O_RDONLY) = 3                                                                                                                                                                    openat(AT_FDCWD, "/sys/devices/virtual/thermal/", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3                                                                                                                   openat(AT_FDCWD, "/sys/devices/virtual/thermal/", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3                                                                                                                   openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone3/temp", O_RDONLY) = 4                                                                                                                                  openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone3/type", O_RDONLY) = 4                                                                                                                                  openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone1/temp", O_RDONLY) = 4                                                                                                                                  openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone1/type", O_RDONLY) = 4                                                                                                                                  openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone6/temp", O_RDONLY) = 4                                                                                                                                  openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone6/type", O_RDONLY) = 4                                                                                                                                  openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone4/temp", O_RDONLY) = 4                                                                                                                                  openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone4/type", O_RDONLY) = 4                                                                                                                                  openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone2/temp", O_RDONLY) = 4                                                                                                                                  openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone2/type", O_RDONLY) = 4                                                                                                                                  openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone0/temp", O_RDONLY) = 4                                                                                                                                  openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone0/type", O_RDONLY) = 4                                                                                                                                  openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone7/temp", O_RDONLY) = 4                                                                                                                                  openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone7/type", O_RDONLY) = 4                                                                                                                                  openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone5/temp", O_RDONLY) = 4                                                                                                                                  openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone5/type", O_RDONLY) = 4                                                                                                                                  openat(AT_FDCWD, "/sys/bus/i2c/devices/", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3                                                                                                                           openat(AT_FDCWD, "/sys/bus/i2c/devices/0-0040/name", O_RDONLY) = 3                                                                                                                                                 openat(AT_FDCWD, "/sys/bus/i2c/devices/0-0040/iio_device/", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3                                                                                                         openat(AT_FDCWD, "/sys/bus/i2c/devices/0-0040/iio_device/rail_name_1", O_RDONLY) = 4                                                                                                                               openat(AT_FDCWD, "/sys/bus/i2c/devices/0-0040/iio_device/in_power1_input", O_RDONLY) = 4                                                                                                                           openat(AT_FDCWD, "/sys/bus/i2c/devices/0-0040/iio_device/rail_name_2", O_RDONLY) = 4                                                                                                                               openat(AT_FDCWD, "/sys/bus/i2c/devices/0-0040/iio_device/in_power2_input", O_RDONLY) = 4                                                                                                                           openat(AT_FDCWD, "/sys/bus/i2c/devices/0-0040/iio_device/rail_name_0", O_RDONLY) = 4                                                                                                                               openat(AT_FDCWD, "/sys/bus/i2c/devices/0-0040/iio_device/in_power0_input", O_RDONLY) = 4                                                                                                                           openat(AT_FDCWD, "/sys/bus/i2c/devices/0-0041/name", O_RDONLY) = 3                                                                                                                                                 openat(AT_FDCWD, "/sys/bus/i2c/devices/0-0041/iio_device/", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3                                                                                                         openat(AT_FDCWD, "/sys/bus/i2c/devices/0-0041/iio_device/rail_name_1", O_RDONLY) = 4                                                                                                                               openat(AT_FDCWD, "/sys/bus/i2c/devices/0-0041/iio_device/in_power1_input", O_RDONLY) = 4                                                                                                                           openat(AT_FDCWD, "/sys/bus/i2c/devices/0-0041/iio_device/rail_name_2", O_RDONLY) = 4                                                                                                                               openat(AT_FDCWD, "/sys/bus/i2c/devices/0-0041/iio_device/in_power2_input", O_RDONLY) = 4                                                                                                                           openat(AT_FDCWD, "/sys/bus/i2c/devices/0-0041/iio_device/rail_name_0", O_RDONLY) = 4                                                                                                                               openat(AT_FDCWD, "/sys/bus/i2c/devices/0-0041/iio_device/in_power0_input", O_RDONLY) = 4                                                                                                                           openat(AT_FDCWD, "/sys/bus/i2c/devices/1-0040/name", O_RDONLY) = -1 ENOENT (No such file or directory)                                                                                                             openat(AT_FDCWD, "/sys/bus/i2c/devices/1-0041/name", O_RDONLY) = -1 ENOENT (No such file or directory)                                                                                                             openat(AT_FDCWD, "/sys/bus/i2c/devices/6-0040/name", O_RDONLY) = -1 ENOENT (No such file or directory)                                                                                                             openat(AT_FDCWD, "/sys/bus/i2c/devices/7-0040/name", O_RDONLY) = -1 ENOENT (No such file or directory)                                                                                                             openat(AT_FDCWD, "/sys/kernel/actmon_avg_activity/mc_all", O_RDONLY) = 3                                                                                                                                           openat(AT_FDCWD, "/sys/devices/17000000.gp10b/load", O_RDONLY) = 3                                                                                                                                                 openat(AT_FDCWD, "/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq", O_RDONLY) = 3                                                                                                                            openat(AT_FDCWD, "/sys/devices/system/cpu/cpu1/cpufreq/scaling_cur_freq", O_RDONLY) = 3                                                                                                                            openat(AT_FDCWD, "/sys/devices/system/cpu/cpu2/cpufreq/scaling_cur_freq", O_RDONLY) = 3                                                                                                                            openat(AT_FDCWD, "/sys/devices/system/cpu/cpu3/cpufreq/scaling_cur_freq", O_RDONLY) = 3                                                                                                                            openat(AT_FDCWD, "/sys/devices/system/cpu/cpu4/cpufreq/scaling_cur_freq", O_RDONLY) = 3                                                                                                                            openat(AT_FDCWD, "/sys/devices/system/cpu/cpu5/cpufreq/scaling_cur_freq", O_RDONLY) = 3                                                                                                                            openat(AT_FDCWD, "/sys/bus/i2c/devices/0-0040/iio_device/in_power0_input", O_RDONLY) = 3                                                                                                                           openat(AT_FDCWD, "/sys/bus/i2c/devices/0-0040/iio_device/in_power1_input", O_RDONLY) = 3                                                                                                                           openat(AT_FDCWD, "/sys/bus/i2c/devices/0-0040/iio_device/in_power2_input", O_RDONLY) = 3                                                                                                                           openat(AT_FDCWD, "/sys/bus/i2c/devices/0-0041/iio_device/in_power0_input", O_RDONLY) = 3                                                                                                                           openat(AT_FDCWD, "/sys/bus/i2c/devices/0-0041/iio_device/in_power1_input", O_RDONLY) = 3                                                                                                                           openat(AT_FDCWD, "/sys/bus/i2c/devices/0-0041/iio_device/in_power2_input", O_RDONLY) = 3                                                                                                                           openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone3/temp", O_RDONLY) = 3                                                                                                                                  openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone1/temp", O_RDONLY) = 3                                                                                                                                  openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone6/temp", O_RDONLY) = 3                                                                                                                                  openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone4/temp", O_RDONLY) = 3                                                                                                                                  openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone2/temp", O_RDONLY) = 3                                                                                                                                  openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone0/temp", O_RDONLY) = 3                                                                                                                                  openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone7/temp", O_RDONLY) = 3                                                                                                                                  openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone5/temp", O_RDONLY) = 3                                                                                                                                  openat(AT_FDCWD, "/sys/devices/system/cpu/cpu0/online", O_RDONLY) = 3                                                                                                                                              openat(AT_FDCWD, "/sys/devices/system/cpu/cpu1/online", O_RDONLY) = 3                                                                                                                                              openat(AT_FDCWD, "/sys/devices/system/cpu/cpu2/online", O_RDONLY) = 3                                                                                                                                              openat(AT_FDCWD, "/sys/devices/system/cpu/cpu3/online", O_RDONLY) = 3                                                                                                                                              openat(AT_FDCWD, "/sys/devices/system/cpu/cpu4/online", O_RDONLY) = 3                                                                                                                                              openat(AT_FDCWD, "/sys/devices/system/cpu/cpu5/online", O_RDONLY) = 3                                                                                                                                              openat(AT_FDCWD, "/proc/stat", O_RDONLY) = 3                                                                                                                                                                       openat(AT_FDCWD, "/proc/meminfo", O_RDONLY) = 3                                                                                                                                                                    openat(AT_FDCWD, "/proc/buddyinfo", O_RDONLY) = 3                                                                                                                                                                  openat(AT_FDCWD, "/sys/kernel/actmon_avg_activity/mc_all", O_RDONLY) = 3                                                                                                                                           openat(AT_FDCWD, "/sys/devices/17000000.gp10b/load", O_RDONLY) = 3                                                                                                                                                 openat(AT_FDCWD, "/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq", O_RDONLY) = 3                                                                                                                            openat(AT_FDCWD, "/sys/devices/system/cpu/cpu1/cpufreq/scaling_cur_freq", O_RDONLY) = 3                                                                                                                            openat(AT_FDCWD, "/sys/devices/system/cpu/cpu2/cpufreq/scaling_cur_freq", O_RDONLY) = 3                                                                                                                            openat(AT_FDCWD, "/sys/devices/system/cpu/cpu3/cpufreq/scaling_cur_freq", O_RDONLY) = 3                                                                                                                            openat(AT_FDCWD, "/sys/devices/system/cpu/cpu4/cpufreq/scaling_cur_freq", O_RDONLY) = 3                                                                                                                            openat(AT_FDCWD, "/sys/devices/system/cpu/cpu5/cpufreq/scaling_cur_freq", O_RDONLY) = 3                                                                                                                            openat(AT_FDCWD, "/sys/bus/i2c/devices/0-0040/iio_device/in_power0_input", O_RDONLY) = 3                                                                                                                           openat(AT_FDCWD, "/sys/bus/i2c/devices/0-0040/iio_device/in_power1_input", O_RDONLY) = 3                                                                                                                           openat(AT_FDCWD, "/sys/bus/i2c/devices/0-0040/iio_device/in_power2_input", O_RDONLY) = 3                                                                                                                           openat(AT_FDCWD, "/sys/bus/i2c/devices/0-0041/iio_device/in_power0_input", O_RDONLY) = 3                                                                                                                           openat(AT_FDCWD, "/sys/bus/i2c/devices/0-0041/iio_device/in_power1_input", O_RDONLY) = 3                                                                                                                           openat(AT_FDCWD, "/sys/bus/i2c/devices/0-0041/iio_device/in_power2_input", O_RDONLY) = 3                                                                                                                           openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone3/temp", O_RDONLY) = 3                                                                                                                                  openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone1/temp", O_RDONLY) = 3                                                                                                                                  openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone6/temp", O_RDONLY) = 3                                                                                                                                  openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone4/temp", O_RDONLY) = 3                                                                                                                                  openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone2/temp", O_RDONLY) = 3                                                                                                                                  openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone0/temp", O_RDONLY) = 3                                                                                                                                  openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone7/temp", O_RDONLY) = 3                                                                                                                                  openat(AT_FDCWD, "/sys/devices/virtual/thermal/thermal_zone5/temp", O_RDONLY) = 3                                                                                                                                  openat(AT_FDCWD, "/sys/devices/system/cpu/cpu0/online", O_RDONLY) = 3                                                                                                                                              openat(AT_FDCWD, "/sys/devices/system/cpu/cpu1/online", O_RDONLY) = 3                                                                                                                                              openat(AT_FDCWD, "/sys/devices/system/cpu/cpu2/online", O_RDONLY) = 3                                                                                                                                              openat(AT_FDCWD, "/sys/devices/system/cpu/cpu3/online", O_RDONLY) = 3                                                                                                                                              openat(AT_FDCWD, "/sys/devices/system/cpu/cpu4/online", O_RDONLY) = 3                                                                                                                                              openat(AT_FDCWD, "/sys/devices/system/cpu/cpu5/online", O_RDONLY) = 3                                                                                                                                              openat(AT_FDCWD, "/proc/stat", O_RDONLY) = 3                                                                                                                                                                       openat(AT_FDCWD, "/proc/meminfo", O_RDONLY) = 3                                                                                                                                                                    openat(AT_FDCWD, "/proc/buddyinfo", O_RDONLY) = 3                                                                                                                                                                  openat(AT_FDCWD, "/sys/kernel/actmon_avg_activity/mc_all", O_RDONLY) = 3                                                                                                                                           openat(AT_FDCWD, "/sys/devices/17000000.gp10b/load", O_RDONLY) = 3 ```

I found a way from this link


that use /proc/stat and calculate per core usage.
But I’m not sure that is the best way, or tegrastat uses this way. Because it compares pervious state and current state of core usages. So you have to store last stat… Somehow lame in contrast with gpu usage that u can simply read gpu.0/load file