[Piglit] [PATCH 2/2] drawoverhead: print test numbers

Marek Olšák maraeo at gmail.com
Wed Jun 14 21:37:10 UTC 2017


From: Marek Olšák <marek.olsak at amd.com>

and align all results to the same column
---
 tests/perf/drawoverhead.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/tests/perf/drawoverhead.c b/tests/perf/drawoverhead.c
index 9afd3d0..bedaecb 100644
--- a/tests/perf/drawoverhead.c
+++ b/tests/perf/drawoverhead.c
@@ -427,27 +427,30 @@ draw_vertex_attrib_change(unsigned count)
 #define COLOR_RED	"\033[31m"
 #define COLOR_GREEN	"\033[1;32m"
 #define COLOR_YELLOW	"\033[1;33m"
 #define COLOR_CYAN	"\033[1;36m"
 
 static double
 perf_run(const char *call, unsigned num_vbos, unsigned num_ubos,
 	 unsigned num_textures, const char *change, perf_rate_func f,
 	 double base_rate)
 {
+	static unsigned test_index;
+	test_index++;
+
 	double rate = perf_measure_rate(f);
 	double ratio = base_rate ? rate / base_rate : 1;
 
-	printf("   %s (%2u VBOs, %u UBOs, %2u Tex) w/ %s change:%*s"
+	printf(" %3u: %s (%2u VBOs, %u UBOs, %2u Tex) w/ %s change:%*s"
 	       COLOR_CYAN "%s" COLOR_RESET " %s(%.1f%%)" COLOR_RESET "\n",
-	       call, num_vbos, num_ubos, num_textures, change,
-	       MAX2(24 - (int)strlen(change), 0), "",
+	       test_index, call, num_vbos, num_ubos, num_textures, change,
+	       MAX2(36 - (int)strlen(change) - (int)strlen(call), 0), "",
 	       perf_human_float(rate),
 	       base_rate == 0 ? COLOR_RESET :
 				ratio > 0.7 ? COLOR_GREEN :
 				ratio > 0.4 ? COLOR_YELLOW : COLOR_RED,
 	       100 * ratio);
 	return rate;
 }
 
 struct enable_state_t {
 	GLenum enable;
-- 
2.7.4



More information about the Piglit mailing list