From: Tvrtko Ursulin <tursulin@ursulin.net>
To: igt-dev@lists.freedesktop.org
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Subject: [igt-dev] [PATCH i-g-t v2 2/3] tests/perf_pmu: Handle thermally throttled devices
Date: Mon, 12 Feb 2018 09:47:24 +0000 [thread overview]
Message-ID: <20180212094724.4650-1-tvrtko.ursulin@linux.intel.com> (raw)
In-Reply-To: <151807744819.28809.12247829425156020313@mail.alporthouse.com>
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Some systems cannot reach the advertised maximum frequency due throttling.
Handle them by considering a 100MHz lower limit.
v2: Use more relaxed tolerance only in the downward direction.
(Chris Wilson)
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
tests/perf_pmu.c | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
index afc7dc992681..a5224b05c7d3 100644
--- a/tests/perf_pmu.c
+++ b/tests/perf_pmu.c
@@ -120,11 +120,16 @@ static uint64_t pmu_read_multi(int fd, unsigned int num, uint64_t *val)
return buf[1];
}
+#define __assert_within_epsilon(x, ref, tol_up, tol_down) \
+ igt_assert_f((double)(x) <= (1.0 + (tol_up)) * (double)(ref) && \
+ (double)(x) >= (1.0 - (tol_down)) * (double)(ref), \
+ "'%s' != '%s' (%f not within %f%%/%f%% tolerance of %f)\n",\
+ #x, #ref, (double)(x), \
+ (tol_up) * 100.0, (tol_down) * 100.0, \
+ (double)(ref))
+
#define assert_within_epsilon(x, ref, tolerance) \
- igt_assert_f((double)(x) <= (1.0 + (tolerance)) * (double)(ref) && \
- (double)(x) >= (1.0 - (tolerance)) * (double)(ref), \
- "'%s' != '%s' (%f not within %f%% tolerance of %f)\n",\
- #x, #ref, (double)(x), (tolerance) * 100.0, (double)(ref))
+ __assert_within_epsilon(x, ref, tolerance, tolerance)
/*
* Helper for cases where we assert on time spent sleeping (directly or
@@ -1229,8 +1234,13 @@ test_frequency(int gem_fd)
min[0], min[1]);
igt_info("Max frequency: requested %.1f, actual %.1f\n",
max[0], max[1]);
+
assert_within_epsilon(min[0], min_freq, tolerance);
- assert_within_epsilon(max[0], max_freq, tolerance);
+ /*
+ * On thermally throttled devices we cannot be sure maximum frequency
+ * can be reached so use larger tolerance downards.
+ */
+ __assert_within_epsilon(max[0], max_freq, tolerance, 0.15f);
}
static bool wait_for_rc6(int fd)
--
2.14.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2018-02-12 9:47 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-08 8:01 [igt-dev] [PATCH i-g-t 1/3] tests/perf_pmu: Use perf timestamps in a few more places Tvrtko Ursulin
2018-02-08 8:01 ` [igt-dev] [PATCH i-g-t 2/3] tests/perf_pmu: Handle thermally throttled devices Tvrtko Ursulin
2018-02-08 8:10 ` Chris Wilson
2018-02-12 9:47 ` Tvrtko Ursulin [this message]
2018-02-12 10:00 ` [igt-dev] [PATCH i-g-t v2 " Chris Wilson
2018-02-12 11:35 ` [igt-dev] [PATCH i-g-t v3 " Tvrtko Ursulin
2018-02-08 8:01 ` [igt-dev] [PATCH i-g-t 3/3] tests/perf_pmu: Give sampling more time Tvrtko Ursulin
2018-02-08 8:13 ` Chris Wilson
2018-02-12 9:55 ` Tvrtko Ursulin
2018-02-12 10:02 ` Chris Wilson
2018-02-12 11:36 ` [igt-dev] [PATCH i-g-t v2 " Tvrtko Ursulin
2018-02-12 11:39 ` Chris Wilson
2018-02-08 8:09 ` [igt-dev] [PATCH i-g-t 1/3] tests/perf_pmu: Use perf timestamps in a few more places Chris Wilson
2018-02-12 9:46 ` [igt-dev] [PATCH i-g-t v2 " Tvrtko Ursulin
2018-02-12 9:57 ` Chris Wilson
2018-02-08 10:27 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/3] " Patchwork
2018-02-08 15:13 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2018-02-12 10:28 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v2,1/3] tests/perf_pmu: Use perf timestamps in a few more places (rev3) Patchwork
2018-02-12 12:02 ` [igt-dev] ✗ Fi.CI.IGT: warning " Patchwork
2018-02-12 16:44 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v2,1/3] tests/perf_pmu: Use perf timestamps in a few more places (rev5) Patchwork
2018-02-12 17:02 ` Patchwork
2018-02-12 19:00 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2018-02-12 19:40 ` Patchwork
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=20180212094724.4650-1-tvrtko.ursulin@linux.intel.com \
--to=tursulin@ursulin.net \
--cc=igt-dev@lists.freedesktop.org \
--cc=tvrtko.ursulin@intel.com \
/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