Hey, I’d like to create excel tables in csv format, from recorded logs, as the Jetson Power GUI does. I want to avoid parsing and use interface commands that would convert a given log file in txt format to an excel table in csv format, , exactly as the Jetson Power GUI does. I emphasize my interest in avoiding parsing a txt file, and prefer using existing interface libraries, as opposed to the answer given in this postת that suggested using the tr commands How to create log files and change Jetson's power using python (Jetson AGX Xavier)
How to create excel tables in csv format from recorded logs like in Jetson power GUI
may I know what’s the real use-case?
This is a short log for an example (from an Xavier NX):
RAM 954/7772MB (lfb 1420x4MB) SWAP 0/3886MB (cached 0MB) CPU [0%@1190,0%@1190,0%@1190,0%@1190,0%@1267,0%@1267] EMC_FREQ 0%@204 GR3D_FREQ 0%@114 APE 150 MTS fg 0% bg 0% AO@38.5C GPU@39C PMIC@100C AUX@38.5C CPU@39C firstname.lastname@example.orgC VDD_IN 1796/1796 VDD_CPU_GPU_CV 285/285 VDD_SOC 408/408 RAM 954/7772MB (lfb 1420x4MB) SWAP 0/3886MB (cached 0MB) CPU [0%@1190,0%@1190,0%@1190,0%@1190,0%@1190,0%@1267] EMC_FREQ 0%@204 GR3D_FREQ 0%@114 APE 150 MTS fg 0% bg 0% AO@38.5C GPU@39C PMIC@100C AUX@38.5C CPU@39C email@example.comC VDD_IN 1837/1816 VDD_CPU_GPU_CV 285/285 VDD_SOC 449/428 RAM 954/7772MB (lfb 1420x4MB) SWAP 0/3886MB (cached 0MB) CPU [1%@1190,0%@1190,0%@1190,0%@1190,0%@1338,0%@1344] EMC_FREQ 0%@204 GR3D_FREQ 0%@114 APE 150 MTS fg 0% bg 0% AO@38.5C GPU@39C PMIC@100C AUX@38C CPU@39C firstname.lastname@example.orgC VDD_IN 1796/1809 VDD_CPU_GPU_CV 285/285 VDD_SOC 408/421
Are you looking for a “title” row, and then just numbers?
@JerryChang, I am curious, is the source code for
tegrastats available? It probably isn’t very difficult to output CSV directly, although something like
awk in a
bash script would work (it would be clumsy versus putting it directly into
ya, as I point-out in this discussion thread, Topic 232753, it can be done by simply reprocess the data with
tr options, and saving the file as
I am still curious if
tegrastats has public source, or if NVIDIA would be willing to release it. I could see making some interesting modifications on it to try, and I doubt there is anything NVIDIA would consider “private”.
this simple tool is used widely and pretty popular across different OS (Android, Linux, V4L…etc), build favor (debug, release, user build), and platforms (t210, t186, t194…etc).
I don’t see release plans to public
so, it’s now keeping as private sources.
Thanks. I’ll suggest public release for the Jetson variety. I could see some interesting options to this.
I agree with @linuxdev that a public version would help.
As mentioned in the above provided link, a simplistic way would to turn spaces separators in tegrastats output into semicolons (or colons, or else…) with:
sudo tegrastats | tr " " ";" > tegrastats.csv
However, be aware that colums order may not be fixed, such as SWAP/NVENC/NVDEC/… being only displayed when used.
NVIDIA team, this is a feature that would be nice and probably not so hard to implement: having an option for displaying everything in a static columns order.
Note that most of that information is available from sysfs (/sys). Exploring there may be meaningful, as long as you’re only reading it would be harmless.
You may find the sysfs paths that tegrastats uses with strace (
sudo apt install strace):
sudo strace tegrastats
Is there an API which i can use from terminal to activate the “capture logs” option which available in the Jetson GUI and to save the results as CSV?
Also, how can i get the GPU power consumption? this value isn’t part of tegrastats output but it is part of the GUI values.
Actually, it is being shown if i activate “run tegrastats” option from the GUI but it isn’t shown if i run tegrastats from a regular cmd termial.
output from tegrastats via terminal:
output from tegrastats via GUI:
you need to grant root permission for running
tegrastats to obtain power consumption.
12-07-2022 05:39:01 RAM 1385/31003MB (lfb 7169x4MB) SWAP 0/15501MB (cached 0MB) CPU [3%@1190,1%@1190,0%@1190,0%@1190,off,off,off,off] EMC_FREQ 0% GR3D_FREQ 0% AUX@40C CPU@41C email@example.comC Tboard@41C AO@41C GPU@41C Tdiode@43.25C PMIC@50C ...
$ sudo tegrastats
12-07-2022 05:39:10 RAM 1386/31003MB (lfb 7169x4MB) SWAP 0/15501MB (cached 0MB) CPU [1%@1161,3%@1159,0%@1159,0%@1159,off,off,off,off] EMC_FREQ 0%@1331 GR3D_FREQ 0%@318 VIC_FREQ 115 APE 150 AUX@39.5C CPU@41C firstname.lastname@example.orgC Tboard@41C AO@41C GPU@41C Tdiode@43C PMIC@50C GPU 0mW/0mW CPU 466mW/466mW SOC 778mW/778mW CV 0mW/0mW VDDRQ 311mW/311mW SYS5V 1751mW/1751mW
hello @linuxdev, @Honey_Patouceul
regrading to your comment #8, and comment #9.
I cannot guarantee to public
tegrastats sources, but it should be feasible for adding some features.
let me put this into internal discussion, thanks