Intel is developing pmtctl, a new Linux utility that provides command-line access to Platform Monitoring Technology telemetry data, offering enthusiasts and system administrators granular insights into hardware performance metrics.
Intel has submitted a set of 17 patches to the Linux kernel mailing list introducing pmtctl, a new command-line tool designed to interface with Intel's Platform Monitoring Technology (PMT). This development represents a significant step forward for Linux users who want detailed telemetry data from their Intel hardware without diving directly into sysfs.
Understanding Platform Monitoring Technology
Intel's Platform Monitoring Technology (PMT) is already supported by the mainline Linux kernel, exposing per-component telemetry counters through sysfs via the pmt_telemetry auxiliary bus driver. However, accessing this data has required manual navigation of sysfs files and understanding platform-specific metric definitions.
The new pmtctl tool aims to simplify this process by providing a user-friendly interface to these telemetry metrics. Like other Intel utilities such as turbostat, pmtctl is designed to live within the Linux kernel source tree, specifically under tools/arch/x86/pmtctl/ alongside other platform-specific userspace tools.
Architecture and Components
As explained by Intel engineer David Box, the pmtctl implementation is split into two main components:
libpmtctl_core (library)
This forms the backbone of the tool and provides several key functionalities:
- Device enumeration: Scans /sys/bus/auxiliary/drivers/pmt_telemetry and reads GUID and telem data path from sysfs attributes
- Metric definitions: Supports two loading modes:
- Built-in: A C struct array compiled at build time, generated from perf-style JSON by scripts/gen_builtin_defs.py
- Runtime: Loaded at invocation via -J/--json-file (requires libjansson)
- Metric DB: A block-based container with flat-index accessors
- GUID intern table: Canonical struct pmt_guid pointers shared between built-in and JSON providers
CLI Frontend
The command-line interface provides two primary commands:
- list: Enumerates discovered PMT devices and/or metric definitions, with optional GUID intersection report (--guids) and device-only mode (--devices)
- stat: Provides perf-stat-like metric sampling with configurable interval, count, event selection, and raw-register mode
Practical Applications for Enthusiasts
For the homelab builder and performance enthusiast, pmtctl opens up several possibilities:
- Detailed Power Analysis: Monitor power consumption at the component level, identifying power-hungry processes or inefficient hardware configurations
- Thermal Management: Track temperature metrics across different components to optimize cooling solutions
- Performance Tuning: Analyze performance counters to identify bottlenecks and optimize system configurations
- Hardware Validation: Verify that hardware is performing as expected, especially important for new builds or overclocked systems
Implementation Details
The implementation spans approximately 7k lines across the library, CLI frontend, code generation scripts, and documentation. Metric JSON files are not included in the kernel tree itself. Instead, users obtain them from the Intel-PMT repository using Makefile targets that fetch XML metric definitions over the network and convert them into the JSON format expected by the tool.
Requirements and Limitations
Potential users should note the following requirements:
- Testing requires a system with PMT-capable hardware and /sys/bus/auxiliary/drivers/pmt_telemetry populated
- Reading telemetry data (stat command) requires elevated privileges (CAP_SYS_ADMIN / sudo)
- Listing metrics and devices (list command) does not require elevated privileges
Integration with Existing Tools
pmtctl will join other Intel performance monitoring tools in the Linux kernel source tree, creating a comprehensive toolkit for system monitoring. Its integration with the kernel source tree ensures that it will be maintained and updated alongside the kernel itself, providing long-term reliability for users.
For those interested in exploring this new tool, the Intel pmtctl patches are currently undergoing review on the Linux kernel mailing list. Once merged, it will represent another valuable tool in the Linux performance monitoring toolkit, particularly valuable for system administrators, developers, and enthusiasts who need detailed insights into their Intel hardware's behavior.
The development of pmtctl aligns with Intel's increasing focus on providing better Linux support for its hardware monitoring capabilities, which has become increasingly important as Linux gains popularity in data centers, cloud environments, and even high-end workstations.

Comments
Please log in or register to join the discussion