mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
Introduce a new '-p/--pcpus' flag to display physical CPU utilization metrics using xc_interface. This provides hypervisor-level CPU usage insights alongside existing domain statistics. This helps correlate VM resource usage with host CPU load patterns. Changes: - Add pcpu.c/pcpu.h for PCPU stat collection logic - Link against libxenctrl for xc_handle access - Extend CLI with '-p' flag and output formatting - Forward declare xenstat_handle to access xc_handle - Include cleanup for PCPU resources in exit handler Example usage: xentop -p # Shows physical CPU stats xentop -bp # Batch mode xentop -d 1 -p # With different delays Example output with '-p': NAME STATE CPU(%) MEM(%) VCPUS ... Domain-0 -----r 17.0 6.3 8 DomD -----r 767.0 38.1 8 Physical CPU Usage: ┌───────┬────────┐ │ Core │ Usage │ ├───────┼────────┤ │ 0 │ 98.1% │ │ ... │ ... │ │ 7 │ 97.3% │ └───────┴────────┘ Signed-off-by: Jahan Murudi <jahan.murudi.zg@renesas.com> Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>