[PATCH 0/8] drm/xe: GPU frequency tracing support

S Sebinraj s.sebinraj at intel.com
Tue Aug 19 06:34:09 UTC 2025


A periodic GPU frequency monitoring and tracing program for the
Xe driver. The implementation provides periodic sampling of
GPU frequency through the Linux ftrace infrastructure.

Key features:
- Periodic GPU frequency sampling with configurable intervals
- Immediate frequency change reporting via tracepoints
- Integration with Linux ftrace subsystem under 'power' events
- Per-GT (Graphics Technology) monitoring support
- Dedicated workqueue for non-blocking frequency sampling
- Configurable via CONFIG_DRM_XE_GPUFREQTRACER kernel option
- The monitoring interval can be configured at runtime via the sysfs
  (default 5sec).

The module parameter is:
/sys/module/xe/parameters/gpufreq_monitoring_interval_ms

The tracepoint is exposed at:
/sys/kernel/debug/tracing/events/power/gpu_frequency

Format: {unsigned int state, unsigned int gpu_id}
- state: GPU frequency in KHz
- gpu_id: GPU clock domain identifier

This enables userspace tools and system monitoring applications to track
GPU frequency changes for power management analysis, performance tuning,
and debugging purposes.

Signed-off-by: S Sebinraj <s.sebinraj at intel.com>

S Sebinraj (8):
  drm/xe: Add Kconfig option for GPU frequency tracing
  drm/xe: Add module parameter for GPU frequency monitoring
  drm/xe: Add GPU frequency tracing tracepoint definition
  drm/xe: Add GPU frequency tracer interface
  drm/xe: Add basic GPU frequency tracer implementation
  drm/xe: Add GPU frequency tracer to build system
  drm/xe: Integrate GPU frequency tracer into device initialization
  drm/xe: Add core GPU frequency monitoring functionality

 drivers/gpu/drm/xe/Kconfig                  |  22 ++
 drivers/gpu/drm/xe/Makefile                 |   3 +
 drivers/gpu/drm/xe/xe_device.c              |   5 +
 drivers/gpu/drm/xe/xe_device_types.h        |   4 +
 drivers/gpu/drm/xe/xe_gpufreqtracer.c       | 336 ++++++++++++++++++++
 drivers/gpu/drm/xe/xe_gpufreqtracer.h       |  30 ++
 drivers/gpu/drm/xe/xe_gpufreqtracer_trace.h |  48 +++
 drivers/gpu/drm/xe/xe_module.c              |  12 +
 drivers/gpu/drm/xe/xe_module.h              |   3 +
 9 files changed, 463 insertions(+)
 create mode 100644 drivers/gpu/drm/xe/xe_gpufreqtracer.c
 create mode 100644 drivers/gpu/drm/xe/xe_gpufreqtracer.h
 create mode 100644 drivers/gpu/drm/xe/xe_gpufreqtracer_trace.h

-- 
2.34.1



More information about the Intel-xe mailing list