From: Robert Bragg <robert.bragg@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 3/9] intel_gpu_top: ignore out of range ring pointers
Date: Fri, 18 Jul 2014 16:38:47 +0100 [thread overview]
Message-ID: <1405697933-30152-4-git-send-email-robert.bragg@intel.com> (raw)
In-Reply-To: <1405697933-30152-1-git-send-email-robert.bragg@intel.com>
---
tools/intel_gpu_top.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
index f60e58b..7574ef0 100644
--- a/tools/intel_gpu_top.c
+++ b/tools/intel_gpu_top.c
@@ -344,6 +344,15 @@ static void ring_sample(struct ring *ring)
ring->head = ring_read(ring, RING_HEAD) & HEAD_ADDR;
ring->tail = ring_read(ring, RING_TAIL) & TAIL_ADDR;
+ /* We sometimes read spurious, out of range pointers which
+ * we want to ignore. We treat them as idle for now... */
+ if (ring->head > ring->size || ring->tail > ring->size)
+ {
+ fprintf(stderr, "Ignoring spurious ring pointer\n");
+ ring->idle++;
+ return;
+ }
+
if (ring->tail == ring->head)
ring->idle++;
--
2.0.1
---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
next prev parent reply other threads:[~2014-07-18 15:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-18 15:38 [PATCH 0/9] intel-gpu-top improvements Robert Bragg
2014-07-18 15:38 ` [PATCH 1/9] intel_gpu_top: don't fclose NULL output Robert Bragg
2014-07-18 15:38 ` [PATCH 2/9] intel_gpu_top: aim for 2000 samples per frame Robert Bragg
2014-07-18 15:38 ` Robert Bragg [this message]
2014-07-18 15:38 ` [PATCH 4/9] intel_gpu_top: read max/current gt freq via sysfs Robert Bragg
2014-07-18 15:38 ` [PATCH 5/9] intel_reg: rename RING_LEN RING_CTL Robert Bragg
2014-07-18 15:38 ` [PATCH 6/9] intel_reg: add RING_CCID current context ID reg Robert Bragg
2014-07-18 15:38 ` [PATCH 7/9] instdone: Add human readable names for HSW Robert Bragg
2014-07-18 15:38 ` [PATCH 8/9] intel_gpu_top: account for per context statistics Robert Bragg
2014-07-18 15:38 ` [PATCH 9/9] intel_gpu_top: hide absolute counter values Robert Bragg
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=1405697933-30152-4-git-send-email-robert.bragg@intel.com \
--to=robert.bragg@intel.com \
--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