Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v9 0/2] drm/xe/pmu: Enable PMU interface
@ 2024-06-13 10:04 Riana Tauro
  2024-06-13  9:57 ` ✓ CI.Patch_applied: success for drm/xe/pmu: Enable PMU interface (rev9) Patchwork
                   ` (9 more replies)
  0 siblings, 10 replies; 32+ messages in thread
From: Riana Tauro @ 2024-06-13 10:04 UTC (permalink / raw)
  To: intel-xe
  Cc: riana.tauro, anshuman.gupta, ashutosh.dixit, aravind.iddamsetty,
	rodrigo.vivi, umesh.nerlige.ramappa, krishnaiah.bommu

There are a set of engine group busyness counters provided by HW which are
perfect fit to be exposed via PMU perf events.

BSPEC: 46559, 46560, 46722, 46729, 52071, 71028

events can be listed using:
perf list
  xe_0000_03_00.0/any-engine-group-busy-gt0/         [Kernel PMU event]
  xe_0000_03_00.0/copy-group-busy-gt0/               [Kernel PMU event]
  xe_0000_03_00.0/media-group-busy-gt0/              [Kernel PMU event]
  xe_0000_03_00.0/render-group-busy-gt0/             [Kernel PMU event]

and can be read using:

perf stat -e "xe_0000_8c_00.0/render-group-busy-gt0/" -I 1000
           time             counts unit events
     1.001139062                  0 ns  xe_0000_8c_00.0/render-group-busy-gt0/
     2.003294678                  0 ns  xe_0000_8c_00.0/render-group-busy-gt0/
     3.005199582                  0 ns  xe_0000_8c_00.0/render-group-busy-gt0/
     4.007076497                  0 ns  xe_0000_8c_00.0/render-group-busy-gt0/
     5.008553068                  0 ns  xe_0000_8c_00.0/render-group-busy-gt0/
     6.010531563              43520 ns  xe_0000_8c_00.0/render-group-busy-gt0/
     7.012468029              44800 ns  xe_0000_8c_00.0/render-group-busy-gt0/
     8.013463515                  0 ns  xe_0000_8c_00.0/render-group-busy-gt0/
     9.015300183                  0 ns  xe_0000_8c_00.0/render-group-busy-gt0/
    10.017233010                  0 ns  xe_0000_8c_00.0/render-group-busy-gt0/
    10.971934120                  0 ns  xe_0000_8c_00.0/render-group-busy-gt0/

The pmu base implementation is taken from i915.

v9:
1. replace drmm_add_action_or_reset with devm
2. add doc to xe_gt_clock_cycles_to_ns
 
v8:
1. rebase
2. drop interrupt pmu event 

v7:
1. update UAPI documentation
2. drop MEDIA_GT specific change for media busyness counter.

v6:
1. drop engine_busyness_sample_type
2. update UAPI documentation

v5:
1. Use spinlock in forcewake instead of mutex
2. take forcewake when accessing the OAG registers

v4: minor nits.

v3:
1. drop init_samples, as storing counters before going to suspend should
be sufficient.
2. ported the "drm/i915/pmu: Make PMU sample array two-dimensional" and
dropped helpers to store and read samples.
3. use xe_device_mem_access_get_if_ongoing to check if device is active
before reading the OA registers.
4. dropped format attr as no longer needed
5. introduce xe_pmu_suspend to call engine_group_busyness_store
6. few other nits.

v2:
Store last known value when device is awake return that while the GT is
suspended and then update the driver copy when read during awake.

Aravind Iddamsetty (2):
  drm/xe: Get GT clock to nanosecs
  drm/xe/pmu: Enable PMU interface

 drivers/gpu/drm/xe/Makefile          |   2 +
 drivers/gpu/drm/xe/regs/xe_gt_regs.h |   5 +
 drivers/gpu/drm/xe/xe_device.c       |   2 +
 drivers/gpu/drm/xe/xe_device_types.h |   4 +
 drivers/gpu/drm/xe/xe_gt.c           |   2 +
 drivers/gpu/drm/xe/xe_gt_clock.c     |  13 +
 drivers/gpu/drm/xe/xe_gt_clock.h     |   2 +-
 drivers/gpu/drm/xe/xe_module.c       |   5 +
 drivers/gpu/drm/xe/xe_pmu.c          | 631 +++++++++++++++++++++++++++
 drivers/gpu/drm/xe/xe_pmu.h          |  26 ++
 drivers/gpu/drm/xe/xe_pmu_types.h    |  67 +++
 include/uapi/drm/xe_drm.h            |  39 ++
 12 files changed, 797 insertions(+), 1 deletion(-)
 create mode 100644 drivers/gpu/drm/xe/xe_pmu.c
 create mode 100644 drivers/gpu/drm/xe/xe_pmu.h
 create mode 100644 drivers/gpu/drm/xe/xe_pmu_types.h

-- 
2.40.0


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

end of thread, other threads:[~2024-06-28 18:50 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-13 10:04 [PATCH v9 0/2] drm/xe/pmu: Enable PMU interface Riana Tauro
2024-06-13  9:57 ` ✓ CI.Patch_applied: success for drm/xe/pmu: Enable PMU interface (rev9) Patchwork
2024-06-13  9:57 ` ✗ CI.checkpatch: warning " Patchwork
2024-06-13  9:59 ` ✓ CI.KUnit: success " Patchwork
2024-06-13 10:04 ` [PATCH v9 1/2] drm/xe: Get GT clock to nanosecs Riana Tauro
2024-06-14 14:57   ` Lucas De Marchi
2024-06-13 10:04 ` [PATCH v9 2/2] drm/xe/pmu: Enable PMU interface Riana Tauro
2024-06-14 16:15   ` Lucas De Marchi
2024-06-14 16:38     ` Tvrtko Ursulin
2024-06-14 20:54   ` Ghimiray, Himal Prasad
2024-06-27  5:21     ` Riana Tauro
2024-06-20 19:52   ` Umesh Nerlige Ramappa
2024-06-27  6:49     ` Aravind Iddamsetty
2024-06-27 16:05       ` Umesh Nerlige Ramappa
2024-06-28  9:41         ` Aravind Iddamsetty
2024-06-28 16:36           ` Umesh Nerlige Ramappa
2024-06-28 15:55     ` Lucas De Marchi
2024-06-28 16:52       ` Umesh Nerlige Ramappa
2024-06-28 18:24         ` Lucas De Marchi
2024-06-28 18:49           ` Umesh Nerlige Ramappa
2024-06-13 10:11 ` ✓ CI.Build: success for drm/xe/pmu: Enable PMU interface (rev9) Patchwork
2024-06-13 10:13 ` ✗ CI.Hooks: failure " Patchwork
2024-06-13 10:14 ` ✓ CI.checksparse: success " Patchwork
2024-06-13 11:48 ` ✓ CI.BAT: " Patchwork
2024-06-13 18:39 ` [PATCH v9 0/2] drm/xe/pmu: Enable PMU interface Dixit, Ashutosh
2024-06-14  5:50   ` Riana Tauro
2024-06-14 15:34     ` Dixit, Ashutosh
2024-06-20 19:15       ` Umesh Nerlige Ramappa
2024-06-21  4:29         ` Aravind Iddamsetty
2024-06-21 18:32           ` Umesh Nerlige Ramappa
2024-06-24 10:27             ` Aravind Iddamsetty
2024-06-24 23:23               ` Umesh Nerlige Ramappa

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