diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2017-10-17 11:19:38 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2017-10-17 14:23:33 +0100 |
commit | 62616c672a623b635141473133674321a4acbdc5 (patch) | |
tree | 2084030295e26aef27c87f44c3937305375313d7 | |
parent | 22fdae38cbad3794a315bfd8d9fd833eba4a35dc (diff) |
igt/pm_rc6_residency: Allow some leeway on the upper %% bound
As we use rounding when converting from hw clocks to time, we may report
a residency greater than wallclock (by a small margin), so allow us to
overshoot by 5% (just due to our inaccuracy).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Sagar Arun Kamble <sagar.a.kamble@intel.com>
-rw-r--r-- | tests/pm_rc6_residency.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/pm_rc6_residency.c b/tests/pm_rc6_residency.c index 7c87302d..ad05cca4 100644 --- a/tests/pm_rc6_residency.c +++ b/tests/pm_rc6_residency.c @@ -79,9 +79,9 @@ static void residency_accuracy(unsigned int diff, ratio = (double)diff / duration; - igt_info("Residency in %s or deeper state: %u ms (sleep duration %u ms) (ratio to expected duration: %.02f)\n", - name_of_rc6_residency, diff, duration, ratio); - igt_assert_f(ratio > 0.9 && ratio <= 1, + igt_info("Residency in %s or deeper state: %u ms (sleep duration %u ms) (%.1f%% of expected duration)\n", + name_of_rc6_residency, diff, duration, 100*ratio); + igt_assert_f(ratio > 0.9 && ratio < 1.05, "Sysfs RC6 residency counter is inaccurate.\n"); } |