* [PATCH] drm/i915: Trace context switches
@ 2013-08-29 12:34 Chris Wilson
2013-08-29 16:29 ` Ben Widawsky
0 siblings, 1 reply; 5+ messages in thread
From: Chris Wilson @ 2013-08-29 12:34 UTC (permalink / raw)
To: intel-gfx
Add a tracepoint for monitoring context switching.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/i915_gem_context.c | 2 ++
drivers/gpu/drm/i915/i915_trace.h | 22 ++++++++++++++++++++++
2 files changed, 24 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index fae2f4d..6d7a662 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -361,6 +361,8 @@ mi_set_context(struct intel_ring_buffer *ring,
return ret;
}
+ trace_i915_gem_ring_switch_context(ring, new_context, hw_flags);
+
len = 4;
switch (INTEL_INFO(ring->dev)->gen) {
case 7:
diff --git a/drivers/gpu/drm/i915/i915_trace.h b/drivers/gpu/drm/i915/i915_trace.h
index 163774a..c474a30 100644
--- a/drivers/gpu/drm/i915/i915_trace.h
+++ b/drivers/gpu/drm/i915/i915_trace.h
@@ -254,6 +254,28 @@ TRACE_EVENT(i915_gem_ring_sync_to,
TP_printk("dev=%u, sync-from=%u, sync-to=%u", __entry->dev, __entry->sync_from, __entry->sync_to)
);
+TRACE_EVENT(i915_gem_ring_switch_context,
+ TP_PROTO(struct intel_ring_buffer *ring, struct i915_hw_context *ctx, u32 flags),
+ TP_ARGS(ring, ctx, flags),
+
+ TP_STRUCT__entry(
+ __field(u32, dev)
+ __field(u32, ring)
+ __field(u32, ctx)
+ __field(u32, flags)
+ ),
+
+ TP_fast_assign(
+ __entry->dev = ring->dev->primary->index;
+ __entry->ring = ring->id;
+ __entry->ctx = ctx->id;
+ __entry->flags = flags;
+ ),
+
+ TP_printk("dev=%u, ring=%u, ctx=%u, flags=0x%08x",
+ __entry->dev, __entry->ring, __entry->ctx, __entry->flags)
+);
+
TRACE_EVENT(i915_gem_ring_dispatch,
TP_PROTO(struct intel_ring_buffer *ring, u32 flags),
TP_ARGS(ring, flags),
--
1.8.4.rc3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/i915: Trace context switches
2013-08-29 12:34 [PATCH] drm/i915: Trace context switches Chris Wilson
@ 2013-08-29 16:29 ` Ben Widawsky
2013-08-29 16:45 ` Chris Wilson
0 siblings, 1 reply; 5+ messages in thread
From: Ben Widawsky @ 2013-08-29 16:29 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx
On Thu, Aug 29, 2013 at 01:34:30PM +0100, Chris Wilson wrote:
> Add a tracepoint for monitoring context switching.
>
Sounds familiar
http://lists.freedesktop.org/archives/intel-gfx/2012-June/018003.html
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
[snip]
--
Ben Widawsky, Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/i915: Trace context switches
2013-08-29 16:29 ` Ben Widawsky
@ 2013-08-29 16:45 ` Chris Wilson
2013-08-29 16:54 ` Ben Widawsky
0 siblings, 1 reply; 5+ messages in thread
From: Chris Wilson @ 2013-08-29 16:45 UTC (permalink / raw)
To: Ben Widawsky; +Cc: intel-gfx
On Thu, Aug 29, 2013 at 09:29:18AM -0700, Ben Widawsky wrote:
> On Thu, Aug 29, 2013 at 01:34:30PM +0100, Chris Wilson wrote:
> > Add a tracepoint for monitoring context switching.
> >
>
> Sounds familiar
> http://lists.freedesktop.org/archives/intel-gfx/2012-June/018003.html
Not quite what I want though. I guess what I really want is
inter-process context switches in addition to hw-context switches.
But still that patch lack information that I think will be useful.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/i915: Trace context switches
2013-08-29 16:45 ` Chris Wilson
@ 2013-08-29 16:54 ` Ben Widawsky
2013-08-29 16:58 ` Chris Wilson
0 siblings, 1 reply; 5+ messages in thread
From: Ben Widawsky @ 2013-08-29 16:54 UTC (permalink / raw)
To: Chris Wilson, intel-gfx
On Thu, Aug 29, 2013 at 05:45:14PM +0100, Chris Wilson wrote:
> On Thu, Aug 29, 2013 at 09:29:18AM -0700, Ben Widawsky wrote:
> > On Thu, Aug 29, 2013 at 01:34:30PM +0100, Chris Wilson wrote:
> > > Add a tracepoint for monitoring context switching.
> > >
> >
> > Sounds familiar
> > http://lists.freedesktop.org/archives/intel-gfx/2012-June/018003.html
>
> Not quite what I want though. I guess what I really want is
> inter-process context switches in addition to hw-context switches.
>
> But still that patch lack information that I think will be useful.
> -Chris
>
> --
> Chris Wilson, Intel Open Source Technology Centre
Maybe I don't know what info you're trying to obtain. Fix the commit
message?
--
Ben Widawsky, Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/i915: Trace context switches
2013-08-29 16:54 ` Ben Widawsky
@ 2013-08-29 16:58 ` Chris Wilson
0 siblings, 0 replies; 5+ messages in thread
From: Chris Wilson @ 2013-08-29 16:58 UTC (permalink / raw)
To: Ben Widawsky; +Cc: intel-gfx
On Thu, Aug 29, 2013 at 09:54:58AM -0700, Ben Widawsky wrote:
> On Thu, Aug 29, 2013 at 05:45:14PM +0100, Chris Wilson wrote:
> > On Thu, Aug 29, 2013 at 09:29:18AM -0700, Ben Widawsky wrote:
> > > On Thu, Aug 29, 2013 at 01:34:30PM +0100, Chris Wilson wrote:
> > > > Add a tracepoint for monitoring context switching.
> > > >
> > >
> > > Sounds familiar
> > > http://lists.freedesktop.org/archives/intel-gfx/2012-June/018003.html
> >
> > Not quite what I want though. I guess what I really want is
> > inter-process context switches in addition to hw-context switches.
> >
> > But still that patch lack information that I think will be useful.
> > -Chris
> >
> > --
> > Chris Wilson, Intel Open Source Technology Centre
>
> Maybe I don't know what info you're trying to obtain. Fix the commit
> message?
Add a tracepoint for correctly monitoring context switching.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-08-29 16:58 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-29 12:34 [PATCH] drm/i915: Trace context switches Chris Wilson
2013-08-29 16:29 ` Ben Widawsky
2013-08-29 16:45 ` Chris Wilson
2013-08-29 16:54 ` Ben Widawsky
2013-08-29 16:58 ` Chris Wilson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.