diff mbox

[4/8] drm/i915: trace vm eviction instead of everything

Message ID 1378936675-27587-4-git-send-email-benjamin.widawsky@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ben Widawsky Sept. 11, 2013, 9:57 p.m. UTC
Tracing vm eviction is really the event we care about. For the cases we
evict everything, we still will get the trace.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
---
 drivers/gpu/drm/i915/i915_gem_evict.c |  2 ++
 drivers/gpu/drm/i915/i915_trace.h     | 15 +++++++++++++++
 2 files changed, 17 insertions(+)

Comments

Chris Wilson Sept. 11, 2013, 10:02 p.m. UTC | #1
On Wed, Sep 11, 2013 at 02:57:51PM -0700, Ben Widawsky wrote:
> Tracing vm eviction is really the event we care about. For the cases we
> evict everything, we still will get the trace.
> 
> Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
> ---
>  drivers/gpu/drm/i915/i915_gem_evict.c |  2 ++
>  drivers/gpu/drm/i915/i915_trace.h     | 15 +++++++++++++++
>  2 files changed, 17 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_evict.c b/drivers/gpu/drm/i915/i915_gem_evict.c
> index a3e279d..b46f7b9 100644
> --- a/drivers/gpu/drm/i915/i915_gem_evict.c
> +++ b/drivers/gpu/drm/i915/i915_gem_evict.c
> @@ -175,6 +175,8 @@ int i915_gem_evict_vm(struct i915_address_space *vm, bool do_idle)
>  	struct i915_vma *vma, *next;
>  	int ret;
>  
> +	trace_i915_gem_evict_vm(vm);
> +
>  	if (do_idle) {
>  		ret = i915_gpu_idle(vm->dev);
>  		if (ret)
> diff --git a/drivers/gpu/drm/i915/i915_trace.h b/drivers/gpu/drm/i915/i915_trace.h
> index e2c5ee6..c1a24af 100644
> --- a/drivers/gpu/drm/i915/i915_trace.h
> +++ b/drivers/gpu/drm/i915/i915_trace.h
> @@ -233,6 +233,21 @@ TRACE_EVENT(i915_gem_evict_everything,
>  	    TP_printk("dev=%d", __entry->dev)
>  );
>  
> +TRACE_EVENT(i915_gem_evict_vm,
> +	    TP_PROTO(struct i915_address_space *vm),
> +	    TP_ARGS(vm),
> +
> +	    TP_STRUCT__entry(
> +			     __field(struct i915_address_space *, vm)
> +			    ),
> +
> +	    TP_fast_assign(
> +			   __entry->vm = vm;
> +			  ),
> +
> +	    TP_printk("vm=%p", __entry->vm)
> +);

Jesse drilled into me that we must never assume that we are the solitary
device on the system. Do we want to add dev here or remove all the
others?
-Chris
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem_evict.c b/drivers/gpu/drm/i915/i915_gem_evict.c
index a3e279d..b46f7b9 100644
--- a/drivers/gpu/drm/i915/i915_gem_evict.c
+++ b/drivers/gpu/drm/i915/i915_gem_evict.c
@@ -175,6 +175,8 @@  int i915_gem_evict_vm(struct i915_address_space *vm, bool do_idle)
 	struct i915_vma *vma, *next;
 	int ret;
 
+	trace_i915_gem_evict_vm(vm);
+
 	if (do_idle) {
 		ret = i915_gpu_idle(vm->dev);
 		if (ret)
diff --git a/drivers/gpu/drm/i915/i915_trace.h b/drivers/gpu/drm/i915/i915_trace.h
index e2c5ee6..c1a24af 100644
--- a/drivers/gpu/drm/i915/i915_trace.h
+++ b/drivers/gpu/drm/i915/i915_trace.h
@@ -233,6 +233,21 @@  TRACE_EVENT(i915_gem_evict_everything,
 	    TP_printk("dev=%d", __entry->dev)
 );
 
+TRACE_EVENT(i915_gem_evict_vm,
+	    TP_PROTO(struct i915_address_space *vm),
+	    TP_ARGS(vm),
+
+	    TP_STRUCT__entry(
+			     __field(struct i915_address_space *, vm)
+			    ),
+
+	    TP_fast_assign(
+			   __entry->vm = vm;
+			  ),
+
+	    TP_printk("vm=%p", __entry->vm)
+);
+
 TRACE_EVENT(i915_gem_ring_dispatch,
 	    TP_PROTO(struct intel_ring_buffer *ring, u32 seqno, u32 flags),
 	    TP_ARGS(ring, seqno, flags),