[RFC,2/8] drm/i915/tracepoints: Adjust i915_gem_ring_dispatch

Submitted by Tvrtko Ursulin on Jan. 27, 2017, 12:01 p.m.

Details

Message ID 1485518487-4464-3-git-send-email-tvrtko.ursulin@linux.intel.com
State New
Headers show
Series "Tracepoints cleanup and improvements for requests" ( rev: 1 ) in Intel GFX

Commit Message

Tvrtko Ursulin Jan. 27, 2017, 12:01 p.m.
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Rename it to i915_gem_request_queue and fix the logged info
equivalent to the i915_gem_request even class. Also moved it
a bit further apart from the i915_gem_request_add tracepoint
since they otherwise provide similar information too close in
time.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/i915_gem_execbuffer.c |  4 ++--
 drivers/gpu/drm/i915/i915_trace.h          | 11 +++++++----
 2 files changed, 9 insertions(+), 6 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index c66e90571031..3cb7b0a3dd38 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -1492,8 +1492,6 @@  execbuf_submit(struct i915_execbuffer_params *params,
 	if (ret)
 		return ret;
 
-	trace_i915_gem_ring_dispatch(params->request, params->dispatch_flags);
-
 	i915_gem_execbuffer_move_to_active(vmas, params->request);
 
 	return 0;
@@ -1803,6 +1801,8 @@  i915_gem_do_execbuffer(struct drm_device *dev, void *data,
 	params->dispatch_flags          = dispatch_flags;
 	params->ctx                     = ctx;
 
+	trace_i915_gem_request_queue(params->request, dispatch_flags);
+
 	ret = execbuf_submit(params, args, &eb->vmas);
 err_request:
 	__i915_add_request(params->request, ret == 0);
diff --git a/drivers/gpu/drm/i915/i915_trace.h b/drivers/gpu/drm/i915/i915_trace.h
index d890e4b03902..79162c369812 100644
--- a/drivers/gpu/drm/i915/i915_trace.h
+++ b/drivers/gpu/drm/i915/i915_trace.h
@@ -503,13 +503,14 @@  TRACE_EVENT(i915_gem_ring_sync_to,
 		      __entry->seqno)
 );
 
-TRACE_EVENT(i915_gem_ring_dispatch,
+TRACE_EVENT(i915_gem_request_queue,
 	    TP_PROTO(struct drm_i915_gem_request *req, u32 flags),
 	    TP_ARGS(req, flags),
 
 	    TP_STRUCT__entry(
 			     __field(u32, dev)
 			     __field(u32, ring)
+			     __field(u32, ctx)
 			     __field(u32, seqno)
 			     __field(u32, flags)
 			     ),
@@ -517,13 +518,15 @@  TRACE_EVENT(i915_gem_ring_dispatch,
 	    TP_fast_assign(
 			   __entry->dev = req->i915->drm.primary->index;
 			   __entry->ring = req->engine->id;
-			   __entry->seqno = req->global_seqno;
+			   __entry->ctx = req->ctx->hw_id;
+			   __entry->seqno = req->fence.seqno;
 			   __entry->flags = flags;
 			   dma_fence_enable_sw_signaling(&req->fence);
 			   ),
 
-	    TP_printk("dev=%u, ring=%u, seqno=%u, flags=%x",
-		      __entry->dev, __entry->ring, __entry->seqno, __entry->flags)
+	    TP_printk("dev=%u, ring=%u, ctx=%u, seqno=%u, flags=%x",
+		      __entry->dev, __entry->ring, __entry->ctx, __entry->seqno,
+		      __entry->flags)
 );
 
 TRACE_EVENT(i915_gem_ring_flush,

Comments

On Fri, Jan 27, 2017 at 12:01:21PM +0000, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> Rename it to i915_gem_request_queue and fix the logged info
> equivalent to the i915_gem_request even class. Also moved it
> a bit further apart from the i915_gem_request_add tracepoint
> since they otherwise provide similar information too close in
> time.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_gem_execbuffer.c |  4 ++--
>  drivers/gpu/drm/i915/i915_trace.h          | 11 +++++++----
>  2 files changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> index c66e90571031..3cb7b0a3dd38 100644
> --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> @@ -1492,8 +1492,6 @@ execbuf_submit(struct i915_execbuffer_params *params,
>  	if (ret)
>  		return ret;
>  
> -	trace_i915_gem_ring_dispatch(params->request, params->dispatch_flags);
> -
>  	i915_gem_execbuffer_move_to_active(vmas, params->request);
>  
>  	return 0;
> @@ -1803,6 +1801,8 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
>  	params->dispatch_flags          = dispatch_flags;
>  	params->ctx                     = ctx;
>  
> +	trace_i915_gem_request_queue(params->request, dispatch_flags);
> +
>  	ret = execbuf_submit(params, args, &eb->vmas);
>  err_request:
>  	__i915_add_request(params->request, ret == 0);
> diff --git a/drivers/gpu/drm/i915/i915_trace.h b/drivers/gpu/drm/i915/i915_trace.h
> index d890e4b03902..79162c369812 100644
> --- a/drivers/gpu/drm/i915/i915_trace.h
> +++ b/drivers/gpu/drm/i915/i915_trace.h
> @@ -503,13 +503,14 @@ TRACE_EVENT(i915_gem_ring_sync_to,
>  		      __entry->seqno)
>  );
>  
> -TRACE_EVENT(i915_gem_ring_dispatch,
> +TRACE_EVENT(i915_gem_request_queue,
>  	    TP_PROTO(struct drm_i915_gem_request *req, u32 flags),
>  	    TP_ARGS(req, flags),
>  
>  	    TP_STRUCT__entry(
>  			     __field(u32, dev)
>  			     __field(u32, ring)
> +			     __field(u32, ctx)
>  			     __field(u32, seqno)
>  			     __field(u32, flags)
>  			     ),
> @@ -517,13 +518,15 @@ TRACE_EVENT(i915_gem_ring_dispatch,
>  	    TP_fast_assign(
>  			   __entry->dev = req->i915->drm.primary->index;
>  			   __entry->ring = req->engine->id;
> -			   __entry->seqno = req->global_seqno;
> +			   __entry->ctx = req->ctx->hw_id;
> +			   __entry->seqno = req->fence.seqno;
>  			   __entry->flags = flags;
>  			   dma_fence_enable_sw_signaling(&req->fence);

In keeping with the better tracking for in/out, this hack to enable the
notify irq here is no longer required.
-Chris