Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/8] PMU support for engine activity
@ 2025-02-06 10:43 Riana Tauro
  2025-02-06 10:40 ` ✓ CI.Patch_applied: success for " Patchwork
                   ` (15 more replies)
  0 siblings, 16 replies; 39+ messages in thread
From: Riana Tauro @ 2025-02-06 10:43 UTC (permalink / raw)
  To: intel-xe
  Cc: riana.tauro, anshuman.gupta, umesh.nerlige.ramappa,
	lucas.demarchi, vinay.belgaumkar, soham.purkait

This series adds support for engine activity for native and PF and VF's

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
        function        - config:59-44
        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>,function=<n>/,
                       xe_<bdf>/engine-total-ticks,gt=<n>,engine_class=<n>,
                                engine_instance=<n>,function<n>/
                       -I 1000

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


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

Riana Tauro (8):
  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
  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/Makefile                   |   1 +
 drivers/gpu/drm/xe/abi/guc_actions_abi.h      |   2 +
 drivers/gpu/drm/xe/regs/xe_gt_regs.h          |   2 +
 drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c    |  26 +-
 drivers/gpu/drm/xe/xe_gt_sriov_pf_config.h    |   1 +
 drivers/gpu/drm/xe/xe_guc.c                   |   5 +
 drivers/gpu/drm/xe/xe_guc_engine_activity.c   | 514 ++++++++++++++++++
 drivers/gpu/drm/xe/xe_guc_engine_activity.h   |  20 +
 .../gpu/drm/xe/xe_guc_engine_activity_types.h |  98 ++++
 drivers/gpu/drm/xe/xe_guc_fwif.h              |  19 +
 drivers/gpu/drm/xe/xe_guc_types.h             |   4 +
 drivers/gpu/drm/xe/xe_pci_sriov.c             |  25 +
 drivers/gpu/drm/xe/xe_pmu.c                   | 203 ++++++-
 drivers/gpu/drm/xe/xe_pmu_types.h             |   8 +
 drivers/gpu/drm/xe/xe_trace_guc.h             |  49 ++
 drivers/gpu/drm/xe/xe_uc.c                    |   3 +
 16 files changed, 965 insertions(+), 15 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] 39+ messages in thread

end of thread, other threads:[~2025-02-12  5:01 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-06 10:43 [PATCH v5 0/8] PMU support for engine activity Riana Tauro
2025-02-06 10:40 ` ✓ CI.Patch_applied: success for " Patchwork
2025-02-06 10:41 ` ✗ CI.checkpatch: warning " Patchwork
2025-02-06 10:42 ` ✓ CI.KUnit: success " Patchwork
2025-02-06 10:43 ` [PATCH v5 1/8] drm/xe: Add engine activity support Riana Tauro
2025-02-06 18:28   ` Michal Wajdeczko
2025-02-10  7:07     ` Riana Tauro
2025-02-06 10:43 ` [PATCH v5 2/8] drm/xe/trace: Add trace for engine activity Riana Tauro
2025-02-06 10:43 ` [PATCH v5 3/8] drm/xe/guc: Expose engine activity only for supported GuC version Riana Tauro
2025-02-06 18:39   ` Michal Wajdeczko
2025-02-07  7:59     ` Riana Tauro
2025-02-07 21:37   ` Umesh Nerlige Ramappa
2025-02-10  7:28     ` Riana Tauro
2025-02-06 10:43 ` [PATCH v5 4/8] drm/xe/xe_pmu: Add PMU support for engine activity Riana Tauro
2025-02-07 22:47   ` Umesh Nerlige Ramappa
2025-02-06 10:43 ` [PATCH v5 5/8] drm/xe/xe_pmu: Acquire forcewake on event init for engine events Riana Tauro
2025-02-07  3:09   ` Ghimiray, Himal Prasad
2025-02-07  6:18     ` Riana Tauro
2025-02-07  6:51       ` Ghimiray, Himal Prasad
2025-02-07 23:31         ` Umesh Nerlige Ramappa
2025-02-10 10:20           ` Riana Tauro
2025-02-11 17:33             ` Umesh Nerlige Ramappa
2025-02-12  5:01               ` Riana Tauro
2025-02-06 10:43 ` [PATCH v5 6/8] drm/xe: Add support for per-function engine activity Riana Tauro
2025-02-06 19:06   ` Michal Wajdeczko
2025-02-07  8:11     ` Riana Tauro
2025-02-07 23:50       ` Umesh Nerlige Ramappa
2025-02-06 10:43 ` [PATCH v5 7/8] drm/xe/xe_pmu: Add pmu support for per-function engine activity stats Riana Tauro
2025-02-06 19:15   ` Michal Wajdeczko
2025-02-07  7:52     ` Riana Tauro
2025-02-06 10:43 ` [PATCH v5 8/8] drm/xe/pf: Enable " Riana Tauro
2025-02-06 11:20   ` Riana Tauro
2025-02-06 19:29   ` Michal Wajdeczko
2025-02-07  6:25     ` Riana Tauro
2025-02-06 10:58 ` ✓ CI.Build: success for PMU support for engine activity Patchwork
2025-02-06 11:01 ` ✗ CI.Hooks: failure " Patchwork
2025-02-06 11:02 ` ✓ CI.checksparse: success " Patchwork
2025-02-06 11:28 ` ✗ Xe.CI.BAT: failure " Patchwork
2025-02-06 12:36 ` ✗ Xe.CI.Full: " Patchwork

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