tegrastat source code or example of monitor CPU/GPS usages in C++ programs

Our software engineers want to include CPU/GPS usages in C++ programs, where can I get source code of “tegrastat” or example of monitor CPU/GPS usages in C++ programs?

Thanks

Hi yahoo2016,

There is no source code of “tegrastat” provided, you can get details from Tegra Stats Utility section on L4T documentation to know how to check the percentage by use tegrastats: https://developer.nvidia.com/embedded/dlc/l4t-documentation-24-2-1

Thanks