From 03725466f299c85d6a5b71449eeffd3183fd4743 Mon Sep 17 00:00:00 2001 From: Maciej Dudek Date: Fri, 12 Nov 2021 23:39:00 +0100 Subject: [PATCH 1/2] Remove debug printfs from md5sum Signed-off-by: Maciej Dudek --- src/md5sum/md5.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/md5sum/md5.c b/src/md5sum/md5.c index e425f624..49bfa0a5 100644 --- a/src/md5sum/md5.c +++ b/src/md5sum/md5.c @@ -214,7 +214,7 @@ benchmark_body (int rpt, int len) } md5(msg, len); free_beebs(msg); - +#ifdef DEBUG uint8_t *p; // display result p=(uint8_t *)&h0; @@ -228,6 +228,7 @@ benchmark_body (int rpt, int len) p=(uint8_t *)&h3; printf("%2.2x%2.2x%2.2x%2.2x\n", p[0], p[1], p[2], p[3]); +#endif } return h0 + h1 + h2 + h3; From 2a934b2d29b956e6c918d5ae91da056d3c5287b3 Mon Sep 17 00:00:00 2001 From: Maciej Dudek Date: Mon, 15 Nov 2021 01:22:08 +0100 Subject: [PATCH 2/2] Remove printf permanently from benchmarks' bodies Signed-off-by: Maciej Dudek --- src/aha-mont64/mont64.c | 3 --- src/huffbench/libhuffbench.c | 2 -- src/md5sum/md5.c | 45 ------------------------------------ src/nbody/nbody.c | 14 ----------- src/nsichneu/libnsichneu.c | 9 -------- 5 files changed, 73 deletions(-) diff --git a/src/aha-mont64/mont64.c b/src/aha-mont64/mont64.c index faeccdb7..58cca0fc 100644 --- a/src/aha-mont64/mont64.c +++ b/src/aha-mont64/mont64.c @@ -186,7 +186,6 @@ xbinGCD (uint64 a, uint64 b, volatile uint64 * pu, volatile uint64 * pv) /* The invariant maintained from here on is: a = u*2*alpha - v*beta. */ -// printf("Before, a u v = %016llx %016llx %016llx\n", a, u, v); while (a > 0) { a = a >> 1; @@ -202,10 +201,8 @@ xbinGCD (uint64 a, uint64 b, volatile uint64 * pu, volatile uint64 * pv) u = ((u ^ beta) >> 1) + (u & beta); v = (v >> 1) + alpha; } -// printf("After, a u v = %016llx %016llx %016llx\n", a, u, v); } -// printf("At end, a u v = %016llx %016llx %016llx\n", a, u, v); *pu = u; *pv = v; return; diff --git a/src/huffbench/libhuffbench.c b/src/huffbench/libhuffbench.c index 26a23a5a..d6b947d6 100644 --- a/src/huffbench/libhuffbench.c +++ b/src/huffbench/libhuffbench.c @@ -338,8 +338,6 @@ compdecomp (byte * data, size_t data_len) comp[comp_len] = bout; ++comp_len; - // printf("data len = %u\n",data_len); - // printf("comp len = %u\n",comp_len); /* DECOMPRESSION diff --git a/src/md5sum/md5.c b/src/md5sum/md5.c index 49bfa0a5..a0127752 100644 --- a/src/md5sum/md5.c +++ b/src/md5sum/md5.c @@ -98,13 +98,6 @@ void md5(uint8_t *initial_msg, size_t initial_len) { // break chunk into sixteen 32-bit words w[j], 0 ≤ j ≤ 15 uint32_t *w = (uint32_t *) (msg + offset); -#ifdef DEBUG - printf("offset: %d %x\n", offset, offset); - - int j; - for(j =0; j < 64; j++) printf("%x ", ((uint8_t *) w)[j]); - puts(""); -#endif // Initialize hash value for this chunk: uint32_t a = h0; @@ -116,23 +109,6 @@ void md5(uint8_t *initial_msg, size_t initial_len) { uint32_t i; for(i = 0; i<64; i++) { -#ifdef ROUNDS - uint8_t *p; - printf("%i: ", i); - p=(uint8_t *)&a; - printf("%2.2x%2.2x%2.2x%2.2x ", p[0], p[1], p[2], p[3], a); - - p=(uint8_t *)&b; - printf("%2.2x%2.2x%2.2x%2.2x ", p[0], p[1], p[2], p[3], b); - - p=(uint8_t *)&c; - printf("%2.2x%2.2x%2.2x%2.2x ", p[0], p[1], p[2], p[3], c); - - p=(uint8_t *)&d; - printf("%2.2x%2.2x%2.2x%2.2x", p[0], p[1], p[2], p[3], d); - puts(""); -#endif - uint32_t f, g; @@ -150,15 +126,9 @@ void md5(uint8_t *initial_msg, size_t initial_len) { g = (7*i) % 16; } -#ifdef ROUNDS - printf("f=%x g=%d w[g]=%x\n", f, g, w[g]); -#endif uint32_t temp = d; d = c; c = b; -#ifdef DEBUG - printf("rotateLeft(%x + %x + %x + %x, %d)\n", a, f, k[i], w[g], r[i]); -#endif b = b + LEFTROTATE((a + f + k[i] + w[g]), r[i]); a = temp; } @@ -214,21 +184,6 @@ benchmark_body (int rpt, int len) } md5(msg, len); free_beebs(msg); -#ifdef DEBUG - uint8_t *p; - // display result - p=(uint8_t *)&h0; - printf("%2.2x%2.2x%2.2x%2.2x", p[0], p[1], p[2], p[3]); - - p=(uint8_t *)&h1; - printf("%2.2x%2.2x%2.2x%2.2x", p[0], p[1], p[2], p[3]); - - p=(uint8_t *)&h2; - printf("%2.2x%2.2x%2.2x%2.2x", p[0], p[1], p[2], p[3]); - - p=(uint8_t *)&h3; - printf("%2.2x%2.2x%2.2x%2.2x\n", p[0], p[1], p[2], p[3]); -#endif } return h0 + h1 + h2 + h3; diff --git a/src/nbody/nbody.c b/src/nbody/nbody.c index 423df9eb..a471ab26 100644 --- a/src/nbody/nbody.c +++ b/src/nbody/nbody.c @@ -188,11 +188,9 @@ benchmark_body (int rpt) { int i; offset_momentum (solar_bodies, BODIES_SIZE); - /*printf("%.9f\n", bodies_energy(solar_bodies, BODIES_SIZE)); */ tot_e = 0.0; for (i = 0; i < 100; ++i) tot_e += bodies_energy (solar_bodies, BODIES_SIZE); - /*printf("%.9f\n", bodies_energy(solar_bodies, BODIES_SIZE)); */ } /* Result is known good value for total energy. */ return double_eq_beebs(tot_e, -16.907516382852478); @@ -203,18 +201,6 @@ int verify_benchmark (int tot_e_ok) { int i, j; - /* print expected values */ - // printf("static struct body solar_bodies[] = {\n"); - // for (i=0; i