[2/2] drawoverhead: print test numbers

Submitted by Marek Olšák on June 14, 2017, 9:37 p.m.

Details

Message ID 1497476230-12592-2-git-send-email-maraeo@gmail.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Piglit

Not browsing as part of any series.

Commit Message

Marek Olšák June 14, 2017, 9:37 p.m.
From: Marek Olšák <marek.olsak@amd.com>

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

Patch hide | download patch | download mbox

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;