Skip to content

RFC expose global performance counters

Samuel Pitoiset nouveau 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest20 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/20pm: prevent freeing the wrong engine contextdrm/nouveau/nvkm/engine/pm/base.c+5 -20 replies
2/20pm: fix a potential race condition when creating an engine contextdrm/nouveau/nvkm/engine/pm/base.c+3 -40 replies
3/20pm: remove pmu signalsdrm/nouveau/include/nvkm/engine/pm.h drm/nouveau/nvkm/engine/pm/Kbuild drm/nouveau/nvkm/engine/pm/daemon.c +5 more+1 -1510 replies
4/20pm: remove unused nvkm_perfsig_wrap() functiondrm/nouveau/nvkm/engine/pm/base.c drm/nouveau/nvkm/engine/pm/priv.h+0 -240 replies
5/20pm: reorganize the nvif interfacebin/nv_perfmon.c drm/nouveau/include/nvif/class.h drm/nouveau/include/nvif/ioctl.h +1 more+57 -244 replies
6/20pm: prevent creating a perfctr object when signals are not founddrm/nouveau/nvkm/engine/pm/base.c+4 -20 replies
7/20pm: implement NVIF_PERFMON_V0_QUERY_DOMAIN methoddrm/nouveau/include/nvif/class.h drm/nouveau/nvkm/engine/pm/base.c+96 -10 replies
8/20pm: allow to query signals by domainbin/nv_perfmon.c drm/nouveau/include/nvif/class.h drm/nouveau/nvkm/engine/pm/base.c+150 -740 replies
9/20pm: change signal iter to u16bin/nv_perfmon.c drm/nouveau/include/nvif/class.h drm/nouveau/nvkm/engine/pm/base.c +1 more+12 -110 replies
10/20pm: use hardware signals indexes instead of user-readable namesbin/nv_perfmon.c drm/nouveau/include/nvif/class.h drm/nouveau/nvkm/engine/pm/base.c+23 -460 replies
11/20pm: allow to monitor hardware signal index 0x00drm/nouveau/nvkm/engine/pm/base.c drm/nouveau/nvkm/engine/pm/gf100.c drm/nouveau/nvkm/engine/pm/nv40.c+10 -60 replies
12/20pm: add concept of sourcesdrm/nouveau/include/nvkm/engine/pm.h drm/nouveau/nvkm/engine/pm/base.c drm/nouveau/nvkm/engine/pm/priv.h+103 -40 replies
13/20pm: allow to query the number of sources for a signaldrm/nouveau/include/nvif/class.h drm/nouveau/nvkm/engine/pm/base.c+21 -40 replies
14/20pm: implement NVIF_PERFMON_V0_QUERY_SOURCE methoddrm/nouveau/include/nvif/class.h drm/nouveau/nvkm/engine/pm/base.c+89 -00 replies
15/20pm: allow the userspace to schedule hardware countersdrm/nouveau/include/nvif/class.h drm/nouveau/nvkm/engine/pm/base.c drm/nouveau/nvkm/engine/pm/priv.h+48 -250 replies
16/20pm: allow to configure domains instead of simple countersbin/nv_perfmon.c drm/nouveau/include/nvif/class.h drm/nouveau/include/nvif/ioctl.h +4 more+293 -1700 replies
17/20pm: allow the userspace to configure sourcesdrm/nouveau/include/nvif/class.h drm/nouveau/nvkm/engine/pm/base.c drm/nouveau/nvkm/engine/pm/priv.h+95 -100 replies
18/20pm/nv50: add compute and graphics signals/sourcesdrm/nouveau/include/nvkm/engine/pm.h drm/nouveau/nvkm/engine/device/nv50.c drm/nouveau/nvkm/engine/pm/Kbuild +5 more+485 -110 replies
19/20sw/nv50: add some private functions to factorize codedrm/nouveau/nvkm/engine/sw/nv50.c+38 -180 replies
20/20sw/nv50: add and interface for controlling performance countersdrm/nouveau/nvkm/engine/sw/nv50.c drm/nouveau/nvkm/engine/sw/nv50.h+166 -00 replies

Reviews trailers per patch

3 of 20 patches have a Reviewed-by or Acked-by.

PatchMartin Peres
1/20R-b
2/20
3/20R-b
4/20R-b
5/20
6/20
7/20
8/20
9/20
10/20
11/20
12/20
13/20
14/20
15/20
16/20
17/20
18/20
19/20
20/20

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH RFC 00/20] expose global performance counters

Hello,

This series exposes global performance counters (PCOUNTER) to the userspace through the nvif interface by reworking most of the code related to the PM engine.

This interface will allow the userspace to control and monitor complex hardware events like the proprietary driver already does, for example with CUPTI and PerfKit.

For now, this series only exposes performance counters on NV50, but this is going to be pretty similar for other families. My plan is to submit more patches for Fermi and Kepler after this series will be reviewed.

The code of this series can be found here:

http://cgit.freedesktop.org/~hakzsam/nouveau/log/?h=nouveau_perfmon

And the corresponding libdrm branch can be found here:

http://cgit.freedesktop.org/~hakzsam/drm/log/?h=nouveau_perfmon

A full example which exposes both compute and graphics hardware events on NV50 can be found here:

http://cgit.freedesktop.org/~hakzsam/perfevent

Most of the code will be implemented in mesa once the kernel interface is going to be upstream and stable.

Below, you can find a summary of the series:

Patches 1-2: fix a bug related to the PM engine context
Patches 3-4: remove useless PMU signals and unused functions
Patches 5-6: reorganize the nvif interface to expose more stuff
Patches 7-11: expose PCOUNTER domains to the userspace
Patches 12-14: implement concept of sources (ie. multiplexers)
Patches 15-17: allow to monitor complex hardware events
Patches 18: add compute/graphics signals/sources
Patches 19-20: expose a software methods interface for controlling PM

Feel free to make a review.
Thanks in advance!

Samuel Pitoiset (20):
pm: prevent freeing the wrong engine context
pm: fix a potential race condition when creating an engine context
pm: remove pmu signals
pm: remove unused nvkm_perfsig_wrap() function
pm: reorganize the nvif interface
pm: prevent creating a perfctr object when signals are not found
pm: implement NVIF_PERFMON_V0_QUERY_DOMAIN method
pm: allow to query signals by domain
pm: change signal iter to u16
pm: use hardware signals indexes instead of user-readable names
pm: allow to monitor hardware signal index 0x00
pm: add concept of sources
pm: allow to query the number of sources for a signal
pm: implement NVIF_PERFMON_V0_QUERY_SOURCE method
pm: allow the userspace to schedule hardware counters
pm: allow to configure domains instead of simple counters
pm: allow the userspace to configure sources
pm/nv50: add compute and graphics signals/sources sw/nv50: add some private functions to factorize code sw/nv50: add and interface for controlling performance counters

 bin/nv_perfmon.c                      | 324 ++++++++++++----
 drm/nouveau/include/nvif/class.h      |  68 +++-
 drm/nouveau/include/nvif/ioctl.h      |   5 +-
 drm/nouveau/include/nvkm/engine/pm.h  |   6 +-
 drm/nouveau/nvkm/engine/device/nv50.c |   2 +-
 drm/nouveau/nvkm/engine/pm/Kbuild     |   2 +-
 drm/nouveau/nvkm/engine/pm/base.c     | 685 +++++++++++++++++++++++++---------
 drm/nouveau/nvkm/engine/pm/daemon.c   | 108 ------
 drm/nouveau/nvkm/engine/pm/g84.c      | 101 ++++-
 drm/nouveau/nvkm/engine/pm/gf100.c    |  13 +-
 drm/nouveau/nvkm/engine/pm/gk104.c    |   6 -
 drm/nouveau/nvkm/engine/pm/gk110.c    |   4 -
 drm/nouveau/nvkm/engine/pm/gt200.c    | 163 ++++++++
 drm/nouveau/nvkm/engine/pm/gt215.c    | 104 ++++--
 drm/nouveau/nvkm/engine/pm/nv40.c     |   8 +-
 drm/nouveau/nvkm/engine/pm/nv50.c     | 136 ++++++-
 drm/nouveau/nvkm/engine/pm/priv.h     |  53 ++-
 drm/nouveau/nvkm/engine/sw/nv50.c     | 216 ++++++++++-
 drm/nouveau/nvkm/engine/sw/nv50.h     |   6 +
 19 files changed, 1561 insertions(+), 449 deletions(-)
 delete mode 100644 drm/nouveau/nvkm/engine/pm/daemon.c
 create mode 100644 drm/nouveau/nvkm/engine/pm/gt200.c
Signature · 6 lines
2.4.2

_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau