[Intel-gfx] [RFC 38/38] drm/i915: Added preemption info to various trace points
John.C.Harrison at Intel.com
John.C.Harrison at Intel.com
Fri Dec 11 06:50:04 PST 2015
From: John Harrison <John.C.Harrison at Intel.com>
v2: Fixed a typo (and improved the names in general). Updated for
changes to notify() code.
For: VIZ-2021
Signed-off-by: Dave Gordon <david.s.gordon at intel.com>
---
drivers/gpu/drm/i915/i915_gem.c | 5 +++--
drivers/gpu/drm/i915/i915_scheduler.c | 2 +-
drivers/gpu/drm/i915/i915_trace.h | 30 +++++++++++++++++++-----------
3 files changed, 23 insertions(+), 14 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 68bf8ce..d90b12c 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2872,12 +2872,12 @@ void i915_gem_request_notify(struct intel_engine_cs *ring, bool fence_locked)
u32 seqno;
if (list_empty(&ring->fence_signal_list)) {
- trace_i915_gem_request_notify(ring, 0);
+ trace_i915_gem_request_notify(ring, 0, 0, 0);
return;
}
seqno = ring->get_seqno(ring, false);
- trace_i915_gem_request_notify(ring, seqno);
+ trace_i915_gem_request_notify(ring, seqno, 0, 0);
/* Is there anything new to process? */
if ((seqno == ring->last_irq_seqno) && !i915_scheduler_is_ring_preempting(ring))
@@ -2930,6 +2930,7 @@ void i915_gem_request_notify(struct intel_engine_cs *ring, bool fence_locked)
preempt_start = intel_read_status_page(ring, I915_PREEMPTIVE_ACTIVE_SEQNO);
preempt_done = intel_read_status_page(ring, I915_PREEMPTIVE_DONE_SEQNO);
+ trace_i915_gem_request_notify(ring, seqno, preempt_start, preempt_done);
/*
* A preemption request leaves both ACTIVE and DONE set to the same
diff --git a/drivers/gpu/drm/i915/i915_scheduler.c b/drivers/gpu/drm/i915/i915_scheduler.c
index e0db268..37fcd7c 100644
--- a/drivers/gpu/drm/i915/i915_scheduler.c
+++ b/drivers/gpu/drm/i915/i915_scheduler.c
@@ -616,7 +616,7 @@ bool i915_scheduler_notify_request(struct drm_i915_gem_request *req,
unsigned long flags;
bool result;
- trace_i915_scheduler_landing(req);
+ trace_i915_scheduler_landing(req, preempt);
spin_lock_irqsave(&scheduler->lock, flags);
diff --git a/drivers/gpu/drm/i915/i915_trace.h b/drivers/gpu/drm/i915/i915_trace.h
index 73b0ee9..5725cfa 100644
--- a/drivers/gpu/drm/i915/i915_trace.h
+++ b/drivers/gpu/drm/i915/i915_trace.h
@@ -569,13 +569,16 @@ DEFINE_EVENT(i915_gem_request, i915_gem_request_add,
);
TRACE_EVENT(i915_gem_request_notify,
- TP_PROTO(struct intel_engine_cs *ring, uint32_t seqno),
- TP_ARGS(ring, seqno),
+ TP_PROTO(struct intel_engine_cs *ring, uint32_t seqno,
+ uint32_t preempt_start, uint32_t preempt_done),
+ TP_ARGS(ring, seqno, preempt_start, preempt_done),
TP_STRUCT__entry(
__field(u32, dev)
__field(u32, ring)
__field(u32, seqno)
+ __field(u32, preempt_start)
+ __field(u32, preempt_done)
__field(bool, is_empty)
),
@@ -583,11 +586,14 @@ TRACE_EVENT(i915_gem_request_notify,
__entry->dev = ring->dev->primary->index;
__entry->ring = ring->id;
__entry->seqno = seqno;
+ __entry->preempt_start = preempt_start;
+ __entry->preempt_done = preempt_done;
__entry->is_empty = list_empty(&ring->fence_signal_list);
),
- TP_printk("dev=%u, ring=%u, seqno=%u, empty=%d",
+ TP_printk("dev=%u, ring=%u, seqno=%u, preempt_start=%u, preempt_done=%u, empty=%d",
__entry->dev, __entry->ring, __entry->seqno,
+ __entry->preempt_start, __entry->preempt_done,
__entry->is_empty)
);
@@ -887,25 +893,27 @@ TRACE_EVENT(i915_scheduler_unfly,
);
TRACE_EVENT(i915_scheduler_landing,
- TP_PROTO(struct drm_i915_gem_request *req),
- TP_ARGS(req),
+ TP_PROTO(struct drm_i915_gem_request *req, bool preempt),
+ TP_ARGS(req, preempt),
TP_STRUCT__entry(
__field(u32, ring)
__field(u32, uniq)
__field(u32, seqno)
__field(u32, status)
+ __field(bool, preempt)
),
TP_fast_assign(
- __entry->ring = req->ring->id;
- __entry->uniq = req->uniq;
- __entry->seqno = req->seqno;
- __entry->status = req->scheduler_qe ? req->scheduler_qe->status : ~0U;
+ __entry->ring = req->ring->id;
+ __entry->uniq = req->uniq;
+ __entry->seqno = req->seqno;
+ __entry->status = req->scheduler_qe ? req->scheduler_qe->status : ~0U;
+ __entry->preempt = preempt;
),
- TP_printk("ring=%d, uniq=%d, seqno=%d, status=%d",
- __entry->ring, __entry->uniq, __entry->seqno, __entry->status)
+ TP_printk("ring=%d, uniq=%d, seqno=%d, status=%d, preempt=%d",
+ __entry->ring, __entry->uniq, __entry->seqno, __entry->status, __entry->preempt)
);
TRACE_EVENT(i915_scheduler_remove,
--
1.9.1
More information about the Intel-gfx
mailing list