All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tursulin@ursulin.net>
To: Intel-gfx@lists.freedesktop.org
Subject: [RFC 5/8] drm/i915/tracepoints: Add request submit and execute tracepoints
Date: Fri, 27 Jan 2017 12:01:24 +0000	[thread overview]
Message-ID: <1485518487-4464-6-git-send-email-tvrtko.ursulin@linux.intel.com> (raw)
In-Reply-To: <1485518487-4464-1-git-send-email-tvrtko.ursulin@linux.intel.com>

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

These new tracepoints are emitted once the request is ready to
be submitted to the GPU and once the request is about to
be submitted to the GPU, respectively.

Former condition triggers as soon as all the fences and
dependencies have been resolved, and the latter once the
backend is about to submit it to the GPU.

New tracepoint are enabled via the new
DRM_I915_LOW_LEVEL_TRACEPOINTS Kconfig option which is disabled
by default to alleviate the performance impact concerns.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/Kconfig.debug      | 11 +++++++++++
 drivers/gpu/drm/i915/i915_gem_request.c |  2 ++
 drivers/gpu/drm/i915/i915_trace.h       | 24 ++++++++++++++++++++++++
 3 files changed, 37 insertions(+)

diff --git a/drivers/gpu/drm/i915/Kconfig.debug b/drivers/gpu/drm/i915/Kconfig.debug
index 597648c7a645..4fba5e1356a0 100644
--- a/drivers/gpu/drm/i915/Kconfig.debug
+++ b/drivers/gpu/drm/i915/Kconfig.debug
@@ -58,3 +58,14 @@ config DRM_I915_SW_FENCE_DEBUG_OBJECTS
           Recommended for driver developers only.
 
           If in doubt, say "N".
+
+config DRM_I915_LOW_LEVEL_TRACEPOINTS
+        bool "Enable low level request tracing events"
+        depends on DRM_I915
+        default n
+        help
+          Choose this option to turn on low level request tracing events.
+          This provides the ability to precisely monitor engine utilisation
+          and also analyze the request dependency resolving timeline.
+
+          If in doubt, say "N".
diff --git a/drivers/gpu/drm/i915/i915_gem_request.c b/drivers/gpu/drm/i915/i915_gem_request.c
index 72b7f7d9461d..4a88b8ea01db 100644
--- a/drivers/gpu/drm/i915/i915_gem_request.c
+++ b/drivers/gpu/drm/i915/i915_gem_request.c
@@ -449,6 +449,7 @@ submit_notify(struct i915_sw_fence *fence, enum i915_sw_fence_notify state)
 
 	switch (state) {
 	case FENCE_COMPLETE:
+		trace_i915_gem_request_submit(request);
 		request->engine->submit_request(request);
 		break;
 
@@ -468,6 +469,7 @@ execute_notify(struct i915_sw_fence *fence, enum i915_sw_fence_notify state)
 
 	switch (state) {
 	case FENCE_COMPLETE:
+		trace_i915_gem_request_execute(request);
 		break;
 
 	case FENCE_FREE:
diff --git a/drivers/gpu/drm/i915/i915_trace.h b/drivers/gpu/drm/i915/i915_trace.h
index f08ccac0d959..1fe1417f8c4d 100644
--- a/drivers/gpu/drm/i915/i915_trace.h
+++ b/drivers/gpu/drm/i915/i915_trace.h
@@ -582,6 +582,30 @@ DEFINE_EVENT(i915_gem_request, i915_gem_request_add,
 	    TP_ARGS(req)
 );
 
+#if defined(CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS)
+DEFINE_EVENT(i915_gem_request, i915_gem_request_submit,
+	     TP_PROTO(struct drm_i915_gem_request *req),
+	     TP_ARGS(req)
+);
+
+DEFINE_EVENT(i915_gem_request, i915_gem_request_execute,
+	     TP_PROTO(struct drm_i915_gem_request *req),
+	     TP_ARGS(req)
+);
+#else
+#if !defined(TRACE_HEADER_MULTI_READ)
+static inline void
+trace_i915_gem_request_submit(struct drm_i915_gem_request *req)
+{
+}
+
+static inline void
+trace_i915_gem_request_execute(struct drm_i915_gem_request *req)
+{
+}
+#endif
+#endif
+
 TRACE_EVENT(i915_gem_request_notify,
 	    TP_PROTO(struct intel_engine_cs *engine),
 	    TP_ARGS(engine),
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2017-01-27 12:01 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-27 12:01 [RFC 0/8] Tracepoints cleanup and improvements for requests Tvrtko Ursulin
2017-01-27 12:01 ` [RFC 1/8] drm/i915/tracepoints: Tidy request event class Tvrtko Ursulin
2017-01-27 12:01 ` [RFC 2/8] drm/i915/tracepoints: Adjust i915_gem_ring_dispatch Tvrtko Ursulin
2017-01-27 12:37   ` Chris Wilson
2017-01-30 18:05     ` [PATCH v2 " Tvrtko Ursulin
2017-01-27 12:01 ` [RFC 3/8] drm/i915/tracepoints: Tidy i915_gem_request_wait_begin Tvrtko Ursulin
2017-01-27 12:14   ` Chris Wilson
2017-01-30 18:06     ` [PATCH v2 " Tvrtko Ursulin
2017-01-27 12:01 ` [RFC 4/8] drm/i915/tracepoints: Remove unused i915_gem_request_complete Tvrtko Ursulin
2017-01-27 12:46   ` Chris Wilson
2017-01-27 12:01 ` Tvrtko Ursulin [this message]
2017-01-27 12:01 ` [RFC 6/8] drm/i915/tracepoints: Rename i915_gem_request_notify Tvrtko Ursulin
2017-01-27 12:20   ` Chris Wilson
2017-01-27 13:56     ` Tvrtko Ursulin
2017-01-30 18:07     ` [PATCH v2 " Tvrtko Ursulin
2017-01-30 19:44       ` Chris Wilson
2017-02-20 15:58         ` Tvrtko Ursulin
2017-02-20 16:07           ` Chris Wilson
2017-02-20 17:13             ` Tvrtko Ursulin
2017-01-27 12:01 ` [RFC 7/8] drm/i915/tracepoints: Add backend level request in and out tracepoints Tvrtko Ursulin
2017-01-27 12:27   ` Chris Wilson
2017-01-27 13:59     ` Tvrtko Ursulin
2017-01-27 14:07       ` Chris Wilson
2017-01-27 14:18         ` Tvrtko Ursulin
2017-01-27 14:29           ` Chris Wilson
2017-01-30 18:08             ` [PATCH v2 " Tvrtko Ursulin
2017-01-27 12:01 ` [RFC 8/8] drm/i915/tracepoints: Add hw_id to context tracepoints Tvrtko Ursulin
2017-01-27 13:32 ` ✗ Fi.CI.BAT: failure for Tracepoints cleanup and improvements for requests Patchwork
2017-01-30 23:24 ` ✓ Fi.CI.BAT: success for Tracepoints cleanup and improvements for requests (rev5) Patchwork

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=1485518487-4464-6-git-send-email-tvrtko.ursulin@linux.intel.com \
    --to=tursulin@ursulin.net \
    --cc=Intel-gfx@lists.freedesktop.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.