Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v8 0/5] PMU support for engine activity
@ 2025-02-21 10:59 Riana Tauro
  2025-02-21 10:59 ` [PATCH v8 1/5] drm/xe: Add engine activity support Riana Tauro
                   ` (12 more replies)
  0 siblings, 13 replies; 15+ messages in thread
From: Riana Tauro @ 2025-02-21 10:59 UTC (permalink / raw)
  To: intel-xe; +Cc: riana.tauro, anshuman.gupta, umesh.nerlige.ramappa,
	lucas.demarchi

PMU provides two counters (engine-active-ticks, engine-total-ticks)
to calculate engine activity. When querying this, user must group
these 2 counters using the perf_event group mechanism to ensure
both counters are sampled together.

To list the events

        ./perf list
        xe_0000_03_00.0/engine-active-ticks/    [Kernel PMU event]
        xe_0000_03_00.0/engine-total-ticks/     [Kernel PMU event]

The formats to be used with the above are

        gt              - config:60-63
        engine_class    - config:20-27
        engine_instance - config:12-19

The events can then be read using perf tool

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

Engine activity can then be calculated as below
engine activity % = (engine active ticks/engine total ticks) * 100

Test-with: 20250212095834.384508-1-riana.tauro@intel.com

Rev2: Add trace functions
      fix cosmetic review comments

Rev3: add engine class and instance as parameters
      replace busyness with engine activity

Rev4: add per-function engine activity
      fix review comments

Rev5: Remove global for SRIOV
      Add forcewake during init and destroy
      fix other review comments

Rev6: fix review comments

Rev7: Split VF and Native

Rev8: add fw_ref to pmu event data

Riana Tauro (5):
  drm/xe: Add engine activity support
  drm/xe/trace: Add trace for engine activity
  drm/xe/guc: Expose engine activity only for supported GuC version
  drm/xe/xe_pmu: Add PMU support for engine activity
  drm/xe/xe_pmu: Acquire forcewake on event init for engine events

 drivers/gpu/drm/xe/Makefile                   |   1 +
 drivers/gpu/drm/xe/abi/guc_actions_abi.h      |   1 +
 drivers/gpu/drm/xe/regs/xe_gt_regs.h          |   2 +
 drivers/gpu/drm/xe/xe_guc.c                   |   5 +
 drivers/gpu/drm/xe/xe_guc_engine_activity.c   | 373 ++++++++++++++++++
 drivers/gpu/drm/xe/xe_guc_engine_activity.h   |  19 +
 .../gpu/drm/xe/xe_guc_engine_activity_types.h |  92 +++++
 drivers/gpu/drm/xe/xe_guc_fwif.h              |  19 +
 drivers/gpu/drm/xe/xe_guc_types.h             |   4 +
 drivers/gpu/drm/xe/xe_pmu.c                   | 175 +++++++-
 drivers/gpu/drm/xe/xe_trace_guc.h             |  49 +++
 drivers/gpu/drm/xe/xe_uc.c                    |   3 +
 12 files changed, 734 insertions(+), 9 deletions(-)
 create mode 100644 drivers/gpu/drm/xe/xe_guc_engine_activity.c
 create mode 100644 drivers/gpu/drm/xe/xe_guc_engine_activity.h
 create mode 100644 drivers/gpu/drm/xe/xe_guc_engine_activity_types.h

-- 
2.47.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2025-02-22  1:54 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-21 10:59 [PATCH v8 0/5] PMU support for engine activity Riana Tauro
2025-02-21 10:59 ` [PATCH v8 1/5] drm/xe: Add engine activity support Riana Tauro
2025-02-21 10:59 ` [PATCH v8 2/5] drm/xe/trace: Add trace for engine activity Riana Tauro
2025-02-21 10:59 ` [PATCH v8 3/5] drm/xe/guc: Expose engine activity only for supported GuC version Riana Tauro
2025-02-21 10:59 ` [PATCH v8 4/5] drm/xe/xe_pmu: Add PMU support for engine activity Riana Tauro
2025-02-21 10:59 ` [PATCH v8 5/5] drm/xe/xe_pmu: Acquire forcewake on event init for engine events Riana Tauro
2025-02-21 19:43   ` Umesh Nerlige Ramappa
2025-02-21 11:25 ` ✓ CI.Patch_applied: success for PMU support for engine activity (rev4) Patchwork
2025-02-21 11:26 ` ✗ CI.checkpatch: warning " Patchwork
2025-02-21 11:27 ` ✓ CI.KUnit: success " Patchwork
2025-02-21 11:43 ` ✓ CI.Build: " Patchwork
2025-02-21 11:46 ` ✓ CI.Hooks: " Patchwork
2025-02-21 11:47 ` ✓ CI.checksparse: " Patchwork
2025-02-21 12:07 ` ✓ Xe.CI.BAT: " Patchwork
2025-02-22  1:54 ` ✗ Xe.CI.Full: failure " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox