]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
drm/i915/tracepoints: Tidy i915_gem_request_wait_begin
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>
Tue, 21 Feb 2017 11:00:24 +0000 (11:00 +0000)
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>
Tue, 21 Feb 2017 13:18:04 +0000 (13:18 +0000)
Provide the same information as the other request event classes.

v2: Pass in flags so we can properly report the blocking status.
    (Chris Wilson)

v3: Log hex with 0x prefix for clarity.

v4: Derive blocking status from flags. (Chris Wilson)

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
drivers/gpu/drm/i915/i915_gem_request.c
drivers/gpu/drm/i915/i915_trace.h

index a5fac40d2a4f00534afc60dab26d9f20e57b3d88..543cef57972bfd5fde1604ccdc8ff4ce137ad493 100644 (file)
@@ -1092,7 +1092,7 @@ long i915_wait_request(struct drm_i915_gem_request *req,
        if (!timeout)
                return -ETIME;
 
-       trace_i915_gem_request_wait_begin(req);
+       trace_i915_gem_request_wait_begin(req, flags);
 
        if (!i915_sw_fence_done(&req->execute)) {
                timeout = __i915_request_wait_for_execute(req, flags, timeout);
index d9ade8c38f92b88a2248149bb858777f4b38c210..557195b56087fb2b4f8d6dcfa60ee82570e3c0fa 100644 (file)
@@ -508,14 +508,16 @@ DEFINE_EVENT(i915_gem_request, i915_gem_request_complete,
 );
 
 TRACE_EVENT(i915_gem_request_wait_begin,
-           TP_PROTO(struct drm_i915_gem_request *req),
-           TP_ARGS(req),
+           TP_PROTO(struct drm_i915_gem_request *req, unsigned int flags),
+           TP_ARGS(req, flags),
 
            TP_STRUCT__entry(
                             __field(u32, dev)
                             __field(u32, ring)
+                            __field(u32, ctx)
                             __field(u32, seqno)
-                            __field(bool, blocking)
+                            __field(u32, global)
+                            __field(unsigned int, flags)
                             ),
 
            /* NB: the blocking information is racy since mutex_is_locked
@@ -527,14 +529,16 @@ TRACE_EVENT(i915_gem_request_wait_begin,
            TP_fast_assign(
                           __entry->dev = req->i915->drm.primary->index;
                           __entry->ring = req->engine->id;
-                          __entry->seqno = req->global_seqno;
-                          __entry->blocking =
-                                    mutex_is_locked(&req->i915->drm.struct_mutex);
+                          __entry->ctx = req->ctx->hw_id;
+                          __entry->seqno = req->fence.seqno;
+                          __entry->global = req->global_seqno;
+                          __entry->flags = flags;
                           ),
 
-           TP_printk("dev=%u, ring=%u, seqno=%u, blocking=%s",
-                     __entry->dev, __entry->ring,
-                     __entry->seqno, __entry->blocking ?  "yes (NB)" : "no")
+           TP_printk("dev=%u, ring=%u, ctx=%u, seqno=%u, global=%u, blocking=%u, flags=0x%x",
+                     __entry->dev, __entry->ring, __entry->ctx, __entry->seqno,
+                     __entry->global, !!(__entry->flags & I915_WAIT_LOCKED),
+                     __entry->flags)
 );
 
 DEFINE_EVENT(i915_gem_request, i915_gem_request_wait_end,