From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Widawsky Subject: Re: [PATCH 07/25] drm/i915: context trace events Date: Wed, 13 Jun 2012 16:27:16 -0700 Message-ID: <20120613162716.6b8a7079@bwidawsk.net> References: <1338846185-10571-1-git-send-email-ben@bwidawsk.net> <1338846185-10571-8-git-send-email-ben@bwidawsk.net> <20120613222312.GS4829@phenom.ffwll.local> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from cloud01.chad-versace.us (184-106-247-128.static.cloud-ips.com [184.106.247.128]) by gabe.freedesktop.org (Postfix) with ESMTP id 397199E9BE for ; Wed, 13 Jun 2012 16:27:24 -0700 (PDT) In-Reply-To: <20120613222312.GS4829@phenom.ffwll.local> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Daniel Vetter Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Thu, 14 Jun 2012 00:23:12 +0200 Daniel Vetter wrote: > On Mon, Jun 04, 2012 at 02:42:47PM -0700, Ben Widawsky wrote: > > Signed-off-by: Ben Widawsky > > I'll punt on that one because I've punted on the obj->context_id patch, > too. Imo we could switch the context_switch tracepoint to object pointers > for both to and from (and maybe keep to->id for convenience). > -Daniel Reading through traces it's really a lot easier to read id numbers over pointers. However, if you're going to insist on removing from->id, we may as well remove to->id also. > > > --- > > drivers/gpu/drm/i915/i915_gem_context.c | 4 +++ > > drivers/gpu/drm/i915/i915_trace.h | 55 +++++++++++++++++++++++++++++++ > > 2 files changed, 59 insertions(+) > > > > diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c > > index aabe7d9..388cf62 100644 > > --- a/drivers/gpu/drm/i915/i915_gem_context.c > > +++ b/drivers/gpu/drm/i915/i915_gem_context.c > > @@ -130,6 +130,8 @@ static void do_destroy(struct i915_hw_context *ctx) > > else > > BUG_ON(ctx != dev_priv->ring[RCS].default_context); > > > > + trace_i915_context_destroy(ctx); > > + > > drm_gem_object_unreference(&ctx->obj->base); > > kfree(ctx); > > } > > @@ -185,6 +187,7 @@ again: > > > > out: > > (*ctx_out)->obj->context_id = (*ctx_out)->id; > > + trace_i915_context_create(*ctx_out); > > return 0; > > > > err_out: > > @@ -398,6 +401,7 @@ static int do_switch(struct drm_i915_gem_object *from_obj, > > ring->last_context_obj = to->obj; > > to->is_initialized = true; > > > > + trace_i915_context_switch(from_obj, to); > > return 0; > > } > > > > diff --git a/drivers/gpu/drm/i915/i915_trace.h b/drivers/gpu/drm/i915/i915_trace.h > > index fe90b3a..6d8412c 100644 > > --- a/drivers/gpu/drm/i915/i915_trace.h > > +++ b/drivers/gpu/drm/i915/i915_trace.h > > @@ -434,6 +434,61 @@ TRACE_EVENT(i915_reg_rw, > > (u32)(__entry->val >> 32)) > > ); > > > > +/* Context tracking */ > > +TRACE_EVENT(i915_context_create, > > + TP_PROTO(struct i915_hw_context *ctx), > > + TP_ARGS(ctx), > > + > > + TP_STRUCT__entry( > > + __field(struct i915_hw_context *, ctx) > > + __field(u32, id) > > + __field(struct drm_i915_gem_object *, obj) > > + ), > > + > > + TP_fast_assign( > > + __entry->ctx = ctx; > > + __entry->id = ctx->id; > > + __entry->obj = ctx->obj; > > + ), > > + > > + TP_printk("ctx=%p, id=%u, obj=%p", > > + __entry->ctx, __entry->id, __entry->obj) > > +); > > + > > +TRACE_EVENT(i915_context_destroy, > > + TP_PROTO(struct i915_hw_context *ctx), > > + TP_ARGS(ctx), > > + > > + TP_STRUCT__entry( > > + __field(struct i915_hw_context *, ctx) > > + __field(u32, id) > > + ), > > + > > + TP_fast_assign( > > + __entry->ctx = ctx; > > + __entry->id = ctx->id; > > + ), > > + > > + TP_printk("ctx=%p, id=%u", __entry->ctx, __entry->id) > > +); > > + > > +TRACE_EVENT(i915_context_switch, > > + TP_PROTO(struct drm_i915_gem_object *from, struct i915_hw_context *to), > > + TP_ARGS(from, to), > > + > > + TP_STRUCT__entry( > > + __field(int, from) > > + __field(int, to) > > + ), > > + > > + TP_fast_assign( > > + __entry->from = from->context_id; > > + __entry->to = to->id; > > + ), > > + > > + TP_printk("context switch from %d to %d", > > + __entry->from, __entry->to) > > +); > > #endif /* _I915_TRACE_H_ */ > > > > /* This part must be outside protection */ > > -- > > 1.7.10.2 > > > > _______________________________________________ > > Intel-gfx mailing list > > Intel-gfx@lists.freedesktop.org > > http://lists.freedesktop.org/mailman/listinfo/intel-gfx > -- Ben Widawsky, Intel Open Source Technology Center