[RFC 4/4] drm/i915: Updated request structure tracing

John.C.Harrison
2015-03-20T17:48:43Z

From: John Harrison <John.C.Harrison@Intel.com>

Added the '_complete' trace event which occurs when a fence/request is signaled
as complete. Also moved the notify event from the IRQ handler code to inside the
notify function itself.

For: VIZ-5190
Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
---
drivers/gpu/drm/i915/i915_gem.c | 3 +++
drivers/gpu/drm/i915/i915_irq.c | 2 --
drivers/gpu/drm/i915/i915_trace.h | 7 +++++--
3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 27b8893..e3ed94a 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2570,6 +2570,8 @@ void i915_gem_request_notify(struct intel_engine_cs *ring)
unsigned long flags;
u32 seqno;

+ trace_i915_gem_request_notify(ring);
+
if (list_empty(&ring->fence_signal_list))
return;

@@ -2582,6 +2584,7 @@ void i915_gem_request_notify(struct intel_engine_cs *ring)
continue;

fence_signal_locked(&req->fence);
+ trace_i915_gem_request_complete(req);
}

list_del(&req->signal_list);
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index d1cf226..34e7933 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -992,8 +992,6 @@ static void notify_ring(struct drm_device *dev,
if (!intel_ring_initialized(ring))
return;

- trace_i915_gem_request_notify(ring);
-
i915_gem_request_notify(ring);

wake_up_all(&ring->irq_queue);
diff --git a/drivers/gpu/drm/i915/i915_trace.h b/drivers/gpu/drm/i915/i915_trace.h
index 8ca536c..0a215d5 100644
--- a/drivers/gpu/drm/i915/i915_trace.h
+++ b/drivers/gpu/drm/i915/i915_trace.h
@@ -441,16 +441,19 @@ TRACE_EVENT(i915_gem_request_notify,
__field(u32, dev)
__field(u32, ring)
__field(u32, seqno)
+ __field(bool, is_empty)
),

TP_fast_assign(
__entry->dev = ring->dev->primary->index;
__entry->ring = ring->id;
__entry->seqno = ring->get_seqno(ring, false);
+ __entry->is_empty = list_empty(&ring->fence_signal_list);
),

- TP_printk("dev=%u, ring=%u, seqno=%u",
- __entry->dev, __entry->ring, __entry->seqno)
+ TP_printk("dev=%u, ring=%u, seqno=%u, empty=%d",
+ __entry->dev, __entry->ring, __entry->seqno,
+ __entry->is_empty)
);

DEFINE_EVENT(i915_gem_request, i915_gem_request_retire,
--
1.7.9.5