GPUs that rely on the fdinfo to expose process information
(AMDGPU/Intel) can register a callback function to parse a fdinfo file
open to the DRM driver.
The callback function returns a populated process info struct uppon
successfull parsing.
During each main loop iteration, the processes in /proc are scanned only
once instead of once per AMDGPU previously.
For some older AMG GPU, the total usage is not available from the DRM
interface.
If such case arise, and per-process usage is valid, compute the global
usage from per-process usage.
Fixes#146
- Change from exponential to linear realloc strategy.
There are not too many processes running on the GPUs, incrementing the
process buffer by increments of 16 is more reasonable.
Similarly for DRM file descriptors, there are usually 2-4 of them open
at one time by one process. Increment of 8 should cover most cases.
- Share the PID buffer for DRM FDs while scanning processes to avoid
unnecessary allocations.
- Exit the program if reallocarray fails
* Use shifts for mask and make it into ssize_t (so it gets arithmetic
shift instead of logical)
* Remove hardcoded names of nvidia in variable names outside of nvidia
file.
Using typedef struct aliases is makes it more difficult to understand
what exactly is being abstrated away [1], I need this change to
understand the code.
nvmlDevice_t in continue to use nvmlDevice_t to make consistent
with nvml headers.
[1] https://www.kernel.org/doc/html/latest/process/coding-style.html#typedefs
The interface layout selection has been updated to support the interface option.
The interface option stores which data that needs to be plotted for each
devices.
The plot drawing code now supports the reverse plotting option.
The interface uses the ring buffer, the updated version of
the layout computation and plots the data specified by the interface options.
- Add a general option category.
- Moved the disable color option to the general category.
- Add the interface update interval to the general category.