Re: [PATCH] drm/i915/trace: Hide backend specific fields behind Kconfig

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Matthew Brost (2021-10-25 19:34:04)
> Hide the guc_id and tail fields, for request trace points, behind
> CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS Kconfig option. Trace points
> are ABI (maybe?) so don't change them without kernel developers Kconfig
> options.

I've pushed the simple fix to eliminate the 'guc_id' field.

In my opinion a separate tracepoint with more information would be a
better choice here compared to mutating an existing one.

The idea with LOW_LEVEL_TRACEPOINTS is to make sure there are two sets
of tracepoints: one that is quasi stable and the other that is unstable.
Mutating the other set when the unstable set is enabled kind of breaks
that clean split.

Regards, Joonas

> Signed-off-by: Matthew Brost <matthew.brost@xxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/i915_trace.h | 27 +++++++++++++++++++++++++++
>  1 file changed, 27 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_trace.h b/drivers/gpu/drm/i915/i915_trace.h
> index 9795f456cccf..4f5238d02b51 100644
> --- a/drivers/gpu/drm/i915/i915_trace.h
> +++ b/drivers/gpu/drm/i915/i915_trace.h
> @@ -787,6 +787,7 @@ TRACE_EVENT(i915_request_queue,
>                       __entry->ctx, __entry->seqno, __entry->flags)
>  );
>  
> +#if defined(CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS)
>  DECLARE_EVENT_CLASS(i915_request,
>             TP_PROTO(struct i915_request *rq),
>             TP_ARGS(rq),
> @@ -816,6 +817,32 @@ DECLARE_EVENT_CLASS(i915_request,
>                       __entry->guc_id, __entry->ctx, __entry->seqno,
>                       __entry->tail)
>  );
> +#else
> +DECLARE_EVENT_CLASS(i915_request,
> +           TP_PROTO(struct i915_request *rq),
> +           TP_ARGS(rq),
> +
> +           TP_STRUCT__entry(
> +                            __field(u32, dev)
> +                            __field(u64, ctx)
> +                            __field(u16, class)
> +                            __field(u16, instance)
> +                            __field(u32, seqno)
> +                            ),
> +
> +           TP_fast_assign(
> +                          __entry->dev = rq->engine->i915->drm.primary->index;
> +                          __entry->class = rq->engine->uabi_class;
> +                          __entry->instance = rq->engine->uabi_instance;
> +                          __entry->ctx = rq->fence.context;
> +                          __entry->seqno = rq->fence.seqno;
> +                          ),
> +
> +           TP_printk("dev=%u, engine=%u:%u, ctx=%llu, seqno=%u",
> +                     __entry->dev, __entry->class, __entry->instance,
> +                     __entry->ctx, __entry->seqno)
> +);
> +#endif
>  
>  DEFINE_EVENT(i915_request, i915_request_add,
>              TP_PROTO(struct i915_request *rq),
> -- 
> 2.32.0
> 




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux