Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tests/intel/perf_pmu: Fix Test Assertion Failure for semaphore-busy test
@ 2024-11-26 14:09 Ravi Kumar Vodapalli
  2024-11-26 15:26 ` ✓ Xe.CI.BAT: success for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Ravi Kumar Vodapalli @ 2024-11-26 14:09 UTC (permalink / raw)
  To: igt-dev
  Cc: balasubramani.vivekanandan, matthew.d.roper, lucas.demarchi,
	gustavo.sousa, clinton.a.taylor, matthew.s.atwood,
	dnyaneshwar.bhadane, haridhar.kalvala, shekhar.chauhan,
	umesh.nerlige.ramappa, ashutosh.dixit

The tolerance limit exceeds the threshold values sometimes for test
igt@perf_pmu@semaphore-busy, bump up the limits slightly.
Also print the log in readable format in percentage instead of nanosec.

Signed-off-by: Ravi Kumar Vodapalli <ravi.kumar.vodapalli@intel.com>
---
 tests/intel/perf_pmu.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/tests/intel/perf_pmu.c b/tests/intel/perf_pmu.c
index bfa2d501a..7f43354fd 100644
--- a/tests/intel/perf_pmu.c
+++ b/tests/intel/perf_pmu.c
@@ -189,7 +189,7 @@
 
 IGT_TEST_DESCRIPTION("Test the i915 pmu perf interface");
 
-const double tolerance = 0.05f;
+const double tolerance = 0.1f;
 const unsigned long batch_duration_ns = 500e6;
 
 char *drpc;
@@ -287,10 +287,9 @@ static uint64_t pmu_read_multi(int fd, unsigned int num, uint64_t *val)
 #define __assert_within_epsilon(x, ref, tol_up, tol_down, debug_data) \
 	igt_assert_f((double)(x) <= (1.0 + (tol_up)) * (double)(ref) && \
 		     (double)(x) >= (1.0 - (tol_down)) * (double)(ref), \
-		     "'%s' != '%s' (%f not within +%.1f%%/-%.1f%% tolerance of %f)\n%s\n",\
-		     #x, #ref, (double)(x), \
-		     (tol_up) * 100.0, (tol_down) * 100.0, \
-		     (double)(ref), debug_data)
+		     "%.3f%% is not within tolerance limits of +%.1f%%/-%.1f%%\n%s\n", \
+		     (((double)((double)(x) - (double)(ref)) * 100.0) / (double)(ref)), \
+		     (tol_up) * 100.0, (tol_down) * 100.0, debug_data)
 
 #define assert_within_epsilon(x, ref, tolerance) \
 	__assert_within_epsilon(x, ref, tolerance, tolerance, no_debug_data)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-11-27  6:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-26 14:09 [PATCH] tests/intel/perf_pmu: Fix Test Assertion Failure for semaphore-busy test Ravi Kumar Vodapalli
2024-11-26 15:26 ` ✓ Xe.CI.BAT: success for " Patchwork
2024-11-26 15:40 ` ✗ i915.CI.BAT: failure " Patchwork
2024-11-26 17:16 ` ✗ Xe.CI.Full: " Patchwork
2024-11-26 21:39 ` [PATCH] " Matt Roper
2024-11-27  6:56   ` Vodapalli, Ravi Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox