From: Daniel Vetter <daniel@ffwll.ch>
To: Ben Widawsky <ben@bwidawsk.net>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 07/25] drm/i915: context trace events
Date: Thu, 14 Jun 2012 00:23:12 +0200 [thread overview]
Message-ID: <20120613222312.GS4829@phenom.ffwll.local> (raw)
In-Reply-To: <1338846185-10571-8-git-send-email-ben@bwidawsk.net>
On Mon, Jun 04, 2012 at 02:42:47PM -0700, Ben Widawsky wrote:
> Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
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
> ---
> 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
--
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48
next prev parent reply other threads:[~2012-06-13 22:21 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-04 21:42 [PATCH 00/25] i915 HW context support Ben Widawsky
2012-06-04 21:42 ` [PATCH 01/25] drm/i915: CXT_SIZE register offsets added Ben Widawsky
2012-06-04 21:42 ` [PATCH 02/25 v2] drm/i915: preliminary context support Ben Widawsky
2012-06-05 12:23 ` Ville Syrjälä
2012-06-05 16:30 ` Ben Widawsky
2012-06-04 21:42 ` [PATCH 03/25 v2] drm/i915: context basic create & destroy Ben Widawsky
2012-06-13 23:27 ` Ben Widawsky
2012-06-04 21:42 ` [PATCH 04/25] drm/i915: add context information to objects Ben Widawsky
2012-06-13 22:01 ` Daniel Vetter
2012-06-13 23:26 ` Ben Widawsky
2012-06-04 21:42 ` [PATCH 05/25] drm/i915: always bind context objects immediately Ben Widawsky
2012-06-04 21:42 ` [PATCH 06/25 v3] drm/i915: context switch implementation Ben Widawsky
2012-06-04 21:42 ` [PATCH 07/25] drm/i915: context trace events Ben Widawsky
2012-06-13 22:23 ` Daniel Vetter [this message]
2012-06-13 23:27 ` Ben Widawsky
2012-06-04 21:42 ` [PATCH 08/25] drm/i915: Ivybridge MI_ARB_ON_OFF context w/a Ben Widawsky
2012-06-04 21:42 ` [PATCH 09/25] drm/i915: PIPE_CONTROL_TLB_INVALIDATE Ben Widawsky
2012-06-04 21:42 ` [PATCH 10/25 v2] drm/i915: possibly invalidate TLB before context switch Ben Widawsky
2012-06-04 21:42 ` [PATCH 11/25] drm/i915: use the default context Ben Widawsky
2012-06-04 21:42 ` [PATCH 12/25] drm/i915: add ccid to error state Ben Widawsky
2012-06-04 21:42 ` [PATCH 13/25 v3] drm/i915: switch to default context on idle Ben Widawsky
2012-06-04 21:42 ` [PATCH 14/25 v3] drm/i915/context: create & destroy ioctls Ben Widawsky
2012-06-04 21:42 ` [PATCH 15/25 v2] drm/i915/context: switch contexts with execbuf2 Ben Widawsky
2012-06-04 21:42 ` [PATCH 16/25] drm/i915: reset the GPU on context fini Ben Widawsky
2012-06-04 21:42 ` [PATCH 17/25] intel: wait render placeholder Ben Widawsky
2012-06-04 21:42 ` [PATCH 18/25] intel: Merge updated kernel header Ben Widawsky
2012-06-04 21:42 ` [PATCH 19/25] intel/context: Add drm_intel_context type Ben Widawsky
2012-06-04 21:43 ` [PATCH 20/25] intel/context: new execbuf interface for contexts Ben Widawsky
2012-06-04 21:43 ` [PATCH 21/25] intel: add decoding of MI_SET_CONTEXT Ben Widawsky
2012-06-04 21:43 ` [PATCH 22/25] context: libdrm wrappers Ben Widawsky
2012-06-04 21:43 ` [PATCH 23/25] context: update for new execbuf2 element Ben Widawsky
2012-06-04 21:43 ` [PATCH 24/25] contexts: basic test coverage Ben Widawsky
2012-06-13 23:30 ` Daniel Vetter
2012-06-14 3:13 ` [PATCH] " Ben Widawsky
2012-06-04 21:43 ` [PATCH 25/25] i965: hw context support Ben Widawsky
2012-06-04 23:01 ` Paul Berry
2012-06-04 23:10 ` [Intel-gfx] " Ben Widawsky
2012-06-05 5:53 ` [PATCH 00/25] i915 HW " Dave Airlie
2012-06-05 7:08 ` [Mesa-dev] " Kenneth Graunke
2012-06-05 16:32 ` Ben Widawsky
2012-06-05 23:37 ` Kenneth Graunke
2012-06-07 16:17 ` Ben Widawsky
2012-06-14 16:04 ` Daniel Vetter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120613222312.GS4829@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=ben@bwidawsk.net \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox