X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=rcuja%2Ftestpop.c;h=76dbb03f7ac86572a736a97c83c886a0a7f569da;hb=refs%2Fheads%2Furcu%2Frcuja-range;hp=0315c49951034c32e31fcbdb5679f6545a7f819b;hpb=9d9a813b3a2c2fcbcc14e82ab1391a42781f1f22;p=userspace-rcu.git diff --git a/rcuja/testpop.c b/rcuja/testpop.c index 0315c49..76dbb03 100644 --- a/rcuja/testpop.c +++ b/rcuja/testpop.c @@ -3,7 +3,7 @@ * * Userspace RCU library - RCU Judy Array population size test * - * Copyright 2012 - Mathieu Desnoyers + * Copyright 2012-2013 - Mathieu Desnoyers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -49,6 +49,8 @@ static int global_max_minsubclass_len = 0; static unsigned int subclass_len_distrib[256]; +static int verbose; + static uint8_t random_char(void) { @@ -258,6 +260,8 @@ void print_distrib(void) return; printf("Distribution:\n"); for (i = 0; i < 256; i++) { + if (!subclass_len_distrib[i]) + continue; printf("(%u, %u, %llu%%) ", i, subclass_len_distrib[i], 100 * (unsigned long long) subclass_len_distrib[i] / tot); @@ -295,6 +299,13 @@ int main(int argc, char **argv) return -1; } } + + if (argc > 3) { + if (!strcmp(argv[3], "-v")) { + verbose = 1; + } + } + printf("pool distributions: %d\n", nr_distrib); if (nr_distrib != 2 && nr_distrib != 4) { @@ -306,8 +317,10 @@ int main(int argc, char **argv) while (1) { gen_pool(); count_pool(); - //print_pool(); - //print_count(); + if (verbose) { + print_pool(); + print_count(); + } stat_count(); if (!(i % 100000ULL)) print_stat(i);