Tegrastats results ( missed samples)

Hello,

I tried to get samples with different intervals during 1m on the Jetson Nano, and I logged them. However, seems that some samples are missed. For instance, for intervals of 10ms, I had 217 entries in my log file. However, I expect to have 6000 entries in my log file. Writing to a file or printing in a standard output takes time. I was wondering if there is another way to take samples more accurately?

It might have just not had time. I’m curious, if you run it with a higher priority (“not as nice”, meaning a negative number), does more show up? An example:
sudo nice -5 tegrastats
(beware you shouldn’t go that negative most of the time, this is more of an experiment to see if it got preempted)

Hello,
Thank you very much for your response. I executed these commands below several times. However, I received different numbers of samples, from 90 to 160.
sudo nice -5 tegrastats --interval 10 --logfile log10.txt &
sleep 1m
tegrastats --stop

I suppose it is possible that the statistics measuring code is blocked at times, or that the system is just busy and did not have the ability to run successfully each time. I do not know the internals of tegrastats, so I can’t provide an answer, but if you had fewer logs fail with a “-5” priority/niceness, then it is likely that the system was just busy; but, if you had the same number of logs fail to appear, then the odds are in favor of the tegrastats application itself perhaps being blocked at some moments. Someone who knows the internals of tegrastats could probably answer that.

I am thinking that an alternate method of running tegrastats (not relying on its own interval) might be more reliable. The “repeat” command, calling tegrastats for one reading, and logging via “tee -a” (to append) might be reliable. Example:
watch -n 10 "tegrastats | head -n 1 | tee -a log_tegrastats.txt"

The above would require manually deleting the log file each time you start; otherwise the log would always append. You could also log the timestamp of each tegrastats line:
watch -n 10 "date | tee log_tegrastats.txt; tegrastats | head -n 1 | tee -a log_tegrastats.txt"

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.