diff options
author | Marek Olšák <marek.olsak@amd.com> | 2018-09-04 15:11:32 -0400 |
---|---|---|
committer | Marek Olšák <marek.olsak@amd.com> | 2018-11-26 17:19:20 -0500 |
commit | 1e05dffc77bf3f31bd2563c3bbb1ca87cd3a2ddc (patch) | |
tree | 766572c5d27d201cd06818afb1e0b6dc457867fb | |
parent | 7cb4fcbea610b5579e2978e0545361607eb1ceff (diff) |
drawoverhead: print results in the CSV format
for easier data processing.
-rw-r--r-- | tests/perf/common.c | 19 | ||||
-rw-r--r-- | tests/perf/common.h | 3 | ||||
-rw-r--r-- | tests/perf/drawoverhead.c | 8 |
3 files changed, 4 insertions, 26 deletions
diff --git a/tests/perf/common.c b/tests/perf/common.c index e157d82c5..791b7f943 100644 --- a/tests/perf/common.c +++ b/tests/perf/common.c @@ -96,22 +96,3 @@ perf_measure_rate(perf_rate_func f) printf("%s returning iters %u rate %f\n", __FUNCTION__, subiters, rate); return rate; } - -/* Note static buffer, can only use once per printf. - */ -const char * -perf_human_float( double d ) -{ - static char buf[80]; - - if (d > 1000000000.0) - snprintf(buf, sizeof(buf), "%.2f billion", d / 1000000000.0); - else if (d > 1000000.0) - snprintf(buf, sizeof(buf), "%.2f million", d / 1000000.0); - else if (d > 1000.0) - snprintf(buf, sizeof(buf), "%.2f thousand", d / 1000.0); - else - snprintf(buf, sizeof(buf), "%.2f", d); - - return buf; -} diff --git a/tests/perf/common.h b/tests/perf/common.h index daa0d42ab..0da3b7b5f 100644 --- a/tests/perf/common.h +++ b/tests/perf/common.h @@ -27,8 +27,5 @@ typedef void (*perf_rate_func)(unsigned count); double perf_measure_rate(perf_rate_func f); -const char * -perf_human_float( double d ); - #endif /* COMMON_H */ diff --git a/tests/perf/drawoverhead.c b/tests/perf/drawoverhead.c index 2bc04fabf..b30d7d46a 100644 --- a/tests/perf/drawoverhead.c +++ b/tests/perf/drawoverhead.c @@ -41,7 +41,6 @@ PIGLIT_GL_TEST_CONFIG_BEGIN } puts(config.supports_gl_core_version ? "Using Core profile." : "Using Compatibility profile."); - puts("Draw calls per second:"); config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_DEPTH | PIGLIT_GL_VISUAL_STENCIL; @@ -645,8 +644,8 @@ perf_run(const char *call, unsigned num_vbos, unsigned num_ubos, double rate = perf_measure_rate(f); double ratio = base_rate ? rate / base_rate : 1; - printf(" %3u: %s (%2u VBO, %u UBO, %2u %s) w/ %s change:%*s" - COLOR_CYAN "%s" COLOR_RESET " %s(%.1f%%)" COLOR_RESET "\n", + printf(" %3u, %s (%2u VBO| %u UBO| %2u %s) w/ %s change,%*s" + COLOR_CYAN "%5u" COLOR_RESET ", %s%.1f%%" COLOR_RESET "\n", test_index, call, num_vbos, num_ubos, num_textures ? num_textures : num_tbos ? num_tbos : @@ -657,7 +656,7 @@ perf_run(const char *call, unsigned num_vbos, unsigned num_ubos, num_imgbos ? "ImB" : " ", change, MAX2(36 - (int)strlen(change) - (int)strlen(call), 0), "", - perf_human_float(rate), + (unsigned)(rate / 1000), base_rate == 0 ? COLOR_RESET : ratio > 0.7 ? COLOR_GREEN : ratio > 0.4 ? COLOR_YELLOW : COLOR_RED, @@ -825,6 +824,7 @@ perf_draw_variant(const char *call, bool is_indexed) enum piglit_result piglit_display(void) { + puts(" #, Test name , Thousands draws/s, Difference vs the 1st"); perf_draw_variant("DrawElements", true); perf_draw_variant("DrawArrays", false); |