From: Ian Rogers <irogers@google.com>
To: Alejandro Colomar <alx@kernel.org>,
"G . Branden Robinson" <g.branden.robinson@gmail.com>
Cc: David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
Jonathan Corbet <corbet@lwn.net>,
dri-devel@lists.freedesktop.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-man@vger.kernel.org,
Ian Rogers <irogers@google.com>
Subject: [PATCH v5 4/4] proc_pid_fdinfo.5: Add DRM subsection
Date: Thu, 5 Dec 2024 23:38:28 -0800 [thread overview]
Message-ID: <20241206073828.1119464-4-irogers@google.com> (raw)
In-Reply-To: <20241206073828.1119464-1-irogers@google.com>
Add description of DRM fdinfo information based on the Linux kernel's
`Documentation/gpu/drm-usage-stats.rst`:
https://docs.kernel.org/gpu/drm-usage-stats.html
---
v5. Update style a suggested-by G. Branden Robinson
<g.branden.robinson@gmail.com>
---
man/man5/proc_pid_fdinfo.5 | 107 +++++++++++++++++++++++++++++++++++++
1 file changed, 107 insertions(+)
diff --git a/man/man5/proc_pid_fdinfo.5 b/man/man5/proc_pid_fdinfo.5
index c4914f1f3..bb77ee9a7 100644
--- a/man/man5/proc_pid_fdinfo.5
+++ b/man/man5/proc_pid_fdinfo.5
@@ -300,6 +300,113 @@ fields contain the values that
.BR timerfd_gettime (2)
on this file descriptor would return.)
.RE
+.SS Direct Rendering Manager
+.P
+DRM drivers can optionally choose to expose usage stats through
+/proc/pid/fdinfo/. For example:
+.P
+.in +4n
+.EX
+pos: 0
+flags: 02100002
+mnt_id: 26
+ino: 284
+drm-driver: i915
+drm-client-id: 39
+drm-pdev: 0000:00:02.0
+drm-total-system0: 6044 KiB
+drm-shared-system0: 0
+drm-active-system0: 0
+drm-resident-system0: 6044 KiB
+drm-purgeable-system0: 1688 KiB
+drm-total-stolen-system0: 0
+drm-shared-stolen-system0: 0
+drm-active-stolen-system0: 0
+drm-resident-stolen-system0: 0
+drm-purgeable-stolen-system0: 0
+drm-engine-render: 346249 ns
+drm-engine-copy: 0 ns
+drm-engine-video: 0 ns
+drm-engine-capacity-video: 2
+drm-engine-video-enhance: 0 ns
+.EE
+.TP
+.BR drm\-driver: " .+ (mandatory)"
+The name this driver registered.
+.TP
+.BR drm\-pdev: " [0-9A-F]{4}:[0-9A-F]{2}:[0-9A-F]{2}.[0-9A-F]"
+For PCI devices this should contain the PCI slot address of the device
+in question.
+.TP
+.BR drm\-client-id: " [0-9]+"
+Unique value relating to the open DRM file descriptor used to
+distinguish duplicated and shared file descriptors.
+.P
+GPUs usually contain multiple execution engines. Each shall be given a
+stable and unique name
+.IR engine-name ,
+with possible values documented in the driver specific documentation.
+.TP
+.BI drm\-engine\- engine-name :\c
+\& [0-9]+ ns
+GPU engine utilization, time spent busy executing workloads for this client.
+.TP
+.BI drm\-engine\-capacity\- engine-name :\c
+\& [0-9]+
+Capacity of the engine if not 1, cannot be 0.
+.TP
+.BI drm\-cycles\- engine-name :\c
+\& [0-9]+
+Contains the number of busy cycles for the given engine. Values are
+not required to be constantly monotonic, but are required to catch up
+with the previously reported larger value within a reasonable
+period. Upon observing a value lower than what was previously read,
+userspace is expected to stay with that larger previous value until a
+monotonic update is seen.
+.TP
+.BI drm\-total\-cycles\- engine-name :\c
+\& [0-9]+
+Contains the total number cycles for the given engine. This is a
+timestamp in GPU unspecified unit that matches the update rate of
+drm\-cycles\-\fIengine-name\fP.
+For drivers that implement this interface,
+the engine utilization can be calculated entirely on the GPU clock
+domain, without considering the CPU sleep time between 2 samples.
+.P
+Each possible memory type which can be used to store buffer objects by
+the GPU in question shall be given a stable and unique name
+.IR region .
+The name "memory" is reserved to refer to normal system memory.
+.TP
+.BI drm\-memory\- region :\c
+\& [0-9]+ [KiB|MiB]
+The amount of storage currently consumed by the buffer objects belong
+to this client, in the respective memory region.
+.IP
+Default unit shall be bytes with optional unit specifiers of 'KiB' or 'MiB'
+indicating kibi- or mebi-bytes.
+.TP
+.BI drm\-shared\- region :\c
+\& [0-9]+ [KiB|MiB]
+The total size of buffers that are shared with another file (e.g., have more
+than a single handle).
+.TP
+.BI drm\-total\- region :\c
+\& [0-9]+ [KiB|MiB]
+The total size of buffers that including shared and private memory.
+.TP
+.BI drm\-resident\- region :\c
+\& [0-9]+ [KiB|MiB]
+The total size of buffers that are resident in the specified region.
+.TP
+.BI drm\-purgeable\- region :\c
+\& [0-9]+ [KiB|MiB]
+The total size of buffers that are purgeable.
+.TP
+.BI drm\-active\- region :\c
+\& [0-9]+ [KiB|MiB]
+The total size of buffers that are active on one or more engines.
+
.SH HISTORY
Linux 2.6.22.
.SH SEE ALSO
--
2.47.0.338.g60cca15819-goog
next prev parent reply other threads:[~2024-12-06 7:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-06 7:38 [PATCH v5 1/4] proc_pid_fdinfo.5: Reduce indent for most of the page Ian Rogers
2024-12-06 7:38 ` [PATCH v5 2/4] proc_pid_fdinfo.5: Make pid clearer in the name and 1st paragraph Ian Rogers
2024-12-06 15:19 ` Alejandro Colomar
2024-12-06 7:38 ` [PATCH v5 3/4] proc_pid_fdinfo.5: Add subsection headers for different fd types Ian Rogers
2024-12-06 15:20 ` Alejandro Colomar
2024-12-06 7:38 ` Ian Rogers [this message]
2024-12-06 15:16 ` [PATCH v5 1/4] proc_pid_fdinfo.5: Reduce indent for most of the page Alejandro Colomar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241206073828.1119464-4-irogers@google.com \
--to=irogers@google.com \
--cc=airlied@gmail.com \
--cc=alx@kernel.org \
--cc=corbet@lwn.net \
--cc=dri-devel@lists.freedesktop.org \
--cc=g.branden.robinson@gmail.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-man@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox