All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	Arjan van de Ven <arjan@linux.intel.com>,
	DRI Development <dri-devel@lists.freedesktop.org>
Subject: [PATCH] drm/i915: add a tracepoint for gpu frequency changes
Date: Thu, 30 Aug 2012 13:26:48 +0200	[thread overview]
Message-ID: <1346326008-11186-1-git-send-email-daniel.vetter@ffwll.ch> (raw)

We've had and still have too many issues where the gpu turbot doesn't
quite to what it's supposed to do (or what we want it to do).

Adding a tracepoint to track when the desired gpu frequence changes
should help a lot in characterizing and understanding problematic
workloads.

Also, this should be fairly interesting for power tuning (and
especially noticing when the gpu is stuck in high frequencies, as has
happened in the past) and hence for integration into powertop and
similar tools.

Cc: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/i915_trace.h |   15 +++++++++++++++
 drivers/gpu/drm/i915/intel_pm.c   |    2 ++
 2 files changed, 17 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_trace.h b/drivers/gpu/drm/i915/i915_trace.h
index 3c4093d..8134421 100644
--- a/drivers/gpu/drm/i915/i915_trace.h
+++ b/drivers/gpu/drm/i915/i915_trace.h
@@ -430,6 +430,21 @@ TRACE_EVENT(i915_reg_rw,
 		(u32)(__entry->val >> 32))
 );
 
+TRACE_EVENT(intel_gpu_freq_change,
+	    TP_PROTO(u32 freq),
+	    TP_ARGS(freq),
+
+	    TP_STRUCT__entry(
+			     __field(u32, freq)
+			     ),
+
+	    TP_fast_assign(
+			   __entry->freq = freq;
+			   ),
+
+	    TP_printk("new_freq=%u", __entry->freq)
+);
+
 #endif /* _I915_TRACE_H_ */
 
 /* This part must be outside protection */
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index ebe3498..194a72f 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -2343,6 +2343,8 @@ void gen6_set_rps(struct drm_device *dev, u8 val)
 	I915_WRITE(GEN6_RP_INTERRUPT_LIMITS, limits);
 
 	dev_priv->rps.cur_delay = val;
+
+	trace_intel_gpu_freq_change(val * 50);
 }
 
 static void gen6_disable_rps(struct drm_device *dev)
-- 
1.7.10.4

             reply	other threads:[~2012-08-30 11:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-30 11:26 Daniel Vetter [this message]
2012-08-30 13:34 ` [Intel-gfx] [PATCH] drm/i915: add a tracepoint for gpu frequency changes Chris Wilson
2012-08-31  9:07   ` Daniel Vetter
2012-08-30 13:51 ` Paul Menzel
2012-09-01 18:26 ` [Intel-gfx] " Ben Widawsky
2012-09-01 18:28   ` Arjan van de Ven
2012-09-01 18:35     ` Ben Widawsky
2012-09-01 19:14       ` Daniel Vetter
2012-09-02  1:36         ` Ben Widawsky
2012-09-02  2:44           ` Arjan van de Ven
2012-09-02  3:05             ` Ben Widawsky
2012-09-02  3:06               ` [Intel-gfx] " Arjan van de Ven
2012-09-02  3:11                 ` Ben Widawsky
2012-09-03  7:56             ` Daniel Vetter
2012-09-03  7:53           ` Daniel Vetter
2012-09-01 19:22       ` [Intel-gfx] " Chris Wilson
2012-09-02  1:16         ` Ben Widawsky
2012-09-02  7:41           ` Chris Wilson

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=1346326008-11186-1-git-send-email-daniel.vetter@ffwll.ch \
    --to=daniel.vetter@ffwll.ch \
    --cc=arjan@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --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 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.