Abstract
Metis is a system-wide profiling toolkit designed for Xen virtual environments that virtualizes hardware performance counters (HPCs). Unlike traditional tools such as Xenoprof, which require all virtual machines (VMs) to share a single global profiling configuration, Metis enables users in different domains to monitor distinct hardware events independently and simultaneously. This paper describes the architecture, implementation, and evaluation of Metis, demonstrating its ability to provide flexible, accurate profiling without sacrificing data integrity.
Introduction
Performance analysis in virtualized environments is inherently difficult because multiple guest Operating Systems (OS) share the same physical hardware. Standard tools like OProfile or Xenoprof rely on hardware performance counters—specialized CPU registers that track events like clock cycles, cache misses, and instruction execution. However, Xenoprof requires a "coordinated profiling session," forcing every VM to monitor the exact same set of hardware events. Metis addresses this limitation by virtualizing the counters, allowing each VM to treat them as private, configurable resources.
System Architecture
The Metis framework is integrated directly into the Xen Virtual Machine Monitor (VMM) to provide a system-wide view of performance. It consists of a kernel-level component for sampling and virtualization logic and user-space daemons for data analysis.
As shown in Figure 1, the architecture manages communication between guest domains (VM0, VM1, VM2) and the hardware performance counters through a sampling interface and dedicated buffers within the Xen layer. This structure ensures that profiling data is captured accurately across the entire system, including routines within the hypervisor itself.
Operational Workflow
The toolkit utilizes a structured workflow to manage profiling sessions across domains. It leverages Xenstore for signaling between the privileged domain (Dom0) and guest domains (DomU), allowing users to start and stop sessions without global synchronization or reboots.
The workflow (Figure 2) begins with background daemons in each VM and involves checking the number of CPU events against hardware limits. If events exceed hardware capacity, Metis employs time-sharing multiplexing to rotate through events rapidly, ensuring comprehensive coverage even with limited physical registers.
Implementation Techniques
Key techniques implemented in Metis include:
- VCPU-Based Context Switching: Metis treats performance counters like CPU registers. During a Virtual CPU (VCPU) switch, Metis saves current counter values and loads configurations for the incoming VCPU.
- Time-Sharing Multiplexing: This allows a single VM to monitor more events than the hardware physically supports by rotating through them at high frequency.
- Interference Reduction: Read/write operations for counters are performed during the VMM's own time slice to prevent overhead from polluting guest application data.
Evaluation and Results
Metis was evaluated using the SPEC CPU2000 benchmark suite and the Gzip workload. The results demonstrated:
- Simultaneous Multi-Event Tracking: Different domains successfully monitored distinct sets of hardware events simultaneously (e.g., Domain 1 tracking cache misses while Domain 2 tracked branch mispredictions), a feat impossible with previous tools.
- Accuracy: Metis produced performance histograms for the Gzip benchmark that nearly perfectly matched Xenoprof results, identifying key hotspots like
deflateandinflate_codesaccurately. - System-Wide Diagnosis: The tool effectively identified resource consumption within both the Xen hypervisor (
xen-syms) and the Linux kernel (vmlinux).
Conclusion
Metis breaks the coordination barrier in virtualized profiling, making it an essential tool for multi-tenant cloud environments where different tenants have unique debugging needs. While future work will address scalability and overhead under high-frequency switching, Metis currently provides a robust solution for independent, system-wide performance analysis.
Summary updated