[PATCH v2 0/3] PMU support for function engine activity

Riana Tauro riana.tauro at intel.com
Tue Mar 11 07:17:56 UTC 2025


Extend PMU support for engine activity for PF and VF's.
PMU provides two counters (engine-active-ticks, engine-total-ticks)
to calculate engine activity. To get function engine activity from PF,
the user must provide the function values using the format

function - config:44-59

If 2 VF's are enabled, then the applicable function values are

0 - PF engine activity
1 - VF1 engine activity
2 - VF2 engine activity

This can be read from perf tool as shown below

./perf stat -e xe_<bdf>/engine-active-ticks,gt=<id>,engine_class=<class>,
			engine_instance=<instance>,function=<n>/,
	       xe_<bdf>/engine-total-ticks,gt=<id>,engine_class=<class>,
			engine_instance=<instance>,function=<n>/ -I 1000

Riana Tauro (3):
  drm/xe: Add support for per-function engine activity
  drm/xe/xe_pmu: Add PMU support for per-function engine activity stats
  drm/xe/pf: Enable per-function engine activity stats

 drivers/gpu/drm/xe/abi/guc_actions_abi.h      |   1 +
 drivers/gpu/drm/xe/xe_guc_engine_activity.c   | 200 +++++++++++++++---
 drivers/gpu/drm/xe/xe_guc_engine_activity.h   |   7 +-
 .../gpu/drm/xe/xe_guc_engine_activity_types.h |  12 +-
 drivers/gpu/drm/xe/xe_pci_sriov.c             |  20 ++
 drivers/gpu/drm/xe/xe_pmu.c                   |  38 +++-
 6 files changed, 240 insertions(+), 38 deletions(-)

-- 
2.47.1



More information about the Intel-xe mailing list