This is v4 of the patch series to add physical CPU monitoring to xentop. Changes since v3: - Split the single large patch into a logical series of 3 smaller patches for easier review. - Fixed the memory allocation error handling in pcpu.c as pointed out by Anthony PERARD. The realloc() result is now assigned immediately to avoid invalid pointers on failure. - Simplified the time calculation by using a single global timestamp instead of a per-CPU array, as the time difference is the same for all cores. - Removed the unnecessary check for small time intervals which could lead to incorrect usage calculations. - Integrated the PCPU display with the existing print() function to ensure correct behavior in both interactive and batch modes.
The series adds a new '-p'/'--pcpus' flag to xentop. When enabled, it displays a table showing the usage percentage of each physical CPU core in the system. Jahan Murudi (4): xentop: add pcpu header and basic infrastructure xentop: add pcpu implementation with proper error handling xentop: update Makefile to link against libxenctrl xentop: integrate pcpu support into main program tools/xentop/Makefile | 5 +- tools/xentop/pcpu.c | 141 ++++++++++++++++++++++++++++++++++++++++++ tools/xentop/pcpu.h | 17 +++++ tools/xentop/xentop.c | 79 +++++++++++++++++------ 4 files changed, 222 insertions(+), 20 deletions(-) create mode 100644 tools/xentop/pcpu.c create mode 100644 tools/xentop/pcpu.h -- 2.34.1