Skip to content

Commit f2742e4

Browse files
committed
drm/i915: Include priority and completed status in request in/out tracepoints
It is useful to see the priority as requests are coming in and completed status as requests are coming out of the GPU. To achieve this in a more readable way we need to abandon the common request_hw tracepoint class. Signed-off-by: Tvrtko Ursulin <[email protected]> Reviewed-by: Chris Wilson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 43c8c44 commit f2742e4

File tree

1 file changed

+58
-35
lines changed

1 file changed

+58
-35
lines changed

drivers/gpu/drm/i915/i915_trace.h

Lines changed: 58 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -679,45 +679,68 @@ DEFINE_EVENT(i915_request, i915_request_execute,
679679
TP_ARGS(rq)
680680
);
681681

682-
DECLARE_EVENT_CLASS(i915_request_hw,
683-
TP_PROTO(struct i915_request *rq, unsigned int port),
684-
TP_ARGS(rq, port),
685-
686-
TP_STRUCT__entry(
687-
__field(u32, dev)
688-
__field(u32, hw_id)
689-
__field(u32, ring)
690-
__field(u32, ctx)
691-
__field(u32, seqno)
692-
__field(u32, global_seqno)
693-
__field(u32, port)
694-
),
695-
696-
TP_fast_assign(
697-
__entry->dev = rq->i915->drm.primary->index;
698-
__entry->hw_id = rq->ctx->hw_id;
699-
__entry->ring = rq->engine->id;
700-
__entry->ctx = rq->fence.context;
701-
__entry->seqno = rq->fence.seqno;
702-
__entry->global_seqno = rq->global_seqno;
703-
__entry->port = port;
704-
),
705-
706-
TP_printk("dev=%u, hw_id=%u, ring=%u, ctx=%u, seqno=%u, global=%u, port=%u",
707-
__entry->dev, __entry->hw_id, __entry->ring,
708-
__entry->ctx, __entry->seqno,
709-
__entry->global_seqno, __entry->port)
710-
);
682+
TRACE_EVENT(i915_request_in,
683+
TP_PROTO(struct i915_request *rq, unsigned int port),
684+
TP_ARGS(rq, port),
685+
686+
TP_STRUCT__entry(
687+
__field(u32, dev)
688+
__field(u32, hw_id)
689+
__field(u32, ring)
690+
__field(u32, ctx)
691+
__field(u32, seqno)
692+
__field(u32, global_seqno)
693+
__field(u32, port)
694+
__field(u32, prio)
695+
),
711696

712-
DEFINE_EVENT(i915_request_hw, i915_request_in,
713-
TP_PROTO(struct i915_request *rq, unsigned int port),
714-
TP_ARGS(rq, port)
697+
TP_fast_assign(
698+
__entry->dev = rq->i915->drm.primary->index;
699+
__entry->hw_id = rq->ctx->hw_id;
700+
__entry->ring = rq->engine->id;
701+
__entry->ctx = rq->fence.context;
702+
__entry->seqno = rq->fence.seqno;
703+
__entry->global_seqno = rq->global_seqno;
704+
__entry->prio = rq->sched.attr.priority;
705+
__entry->port = port;
706+
),
707+
708+
TP_printk("dev=%u, hw_id=%u, ring=%u, ctx=%u, seqno=%u, prio=%u, global=%u, port=%u",
709+
__entry->dev, __entry->hw_id, __entry->ring, __entry->ctx,
710+
__entry->seqno, __entry->prio, __entry->global_seqno,
711+
__entry->port)
715712
);
716713

717-
DEFINE_EVENT(i915_request, i915_request_out,
718-
TP_PROTO(struct i915_request *rq),
719-
TP_ARGS(rq)
714+
TRACE_EVENT(i915_request_out,
715+
TP_PROTO(struct i915_request *rq),
716+
TP_ARGS(rq),
717+
718+
TP_STRUCT__entry(
719+
__field(u32, dev)
720+
__field(u32, hw_id)
721+
__field(u32, ring)
722+
__field(u32, ctx)
723+
__field(u32, seqno)
724+
__field(u32, global_seqno)
725+
__field(u32, completed)
726+
),
727+
728+
TP_fast_assign(
729+
__entry->dev = rq->i915->drm.primary->index;
730+
__entry->hw_id = rq->ctx->hw_id;
731+
__entry->ring = rq->engine->id;
732+
__entry->ctx = rq->fence.context;
733+
__entry->seqno = rq->fence.seqno;
734+
__entry->global_seqno = rq->global_seqno;
735+
__entry->completed = i915_request_completed(rq);
736+
),
737+
738+
TP_printk("dev=%u, hw_id=%u, ring=%u, ctx=%u, seqno=%u, global=%u, completed?=%u",
739+
__entry->dev, __entry->hw_id, __entry->ring,
740+
__entry->ctx, __entry->seqno,
741+
__entry->global_seqno, __entry->completed)
720742
);
743+
721744
#else
722745
#if !defined(TRACE_HEADER_MULTI_READ)
723746
static inline void

0 commit comments

Comments
 (0)