rculfhash: Add initial hash population
[urcu.git] / tests / test_urcu_hash.c
CommitLineData
ab7d5fc6 1/*
cd1ae16a 2 * test_urcu_hash.c
ab7d5fc6
MD
3 *
4 * Userspace RCU library - test program
5 *
6 * Copyright February 2009 - Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 */
22
23#define _GNU_SOURCE
24#include <stdio.h>
25#include <pthread.h>
26#include <stdlib.h>
27#include <string.h>
28#include <sys/types.h>
29#include <sys/wait.h>
30#include <unistd.h>
31#include <stdio.h>
32#include <assert.h>
ab7d5fc6 33#include <sched.h>
5e28c532 34#include <errno.h>
ab7d5fc6 35
abc490a1
MD
36#ifdef __linux__
37#include <syscall.h>
38#endif
ab7d5fc6 39
6d5c0ca9
MD
40#define DEFAULT_HASH_SIZE 32
41#define DEFAULT_RAND_POOL 1000000
5e28c532 42
ab7d5fc6
MD
43/* Make this big enough to include the POWER5+ L3 cacheline size of 256B */
44#define CACHE_LINE_SIZE 4096
45
46/* hardcoded number of CPUs */
47#define NR_CPUS 16384
48
49#if defined(_syscall0)
50_syscall0(pid_t, gettid)
51#elif defined(__NR_gettid)
52static inline pid_t gettid(void)
53{
54 return syscall(__NR_gettid);
55}
56#else
57#warning "use pid as tid"
58static inline pid_t gettid(void)
59{
60 return getpid();
61}
62#endif
63
64#ifndef DYNAMIC_LINK_TEST
65#define _LGPL_SOURCE
66#else
67#define debug_yield_read()
68#endif
5567839e 69#include <urcu-qsbr.h>
abc490a1
MD
70#include <urcu/rculfhash.h>
71#include <urcu-call-rcu.h>
ab7d5fc6 72
b8e1907c
MD
73struct wr_count {
74 unsigned long update_ops;
75 unsigned long add;
3c16bf4b 76 unsigned long add_exist;
b8e1907c
MD
77 unsigned long remove;
78};
79
5e28c532
MD
80static unsigned int __thread rand_lookup;
81static unsigned long __thread nr_add;
82static unsigned long __thread nr_addexist;
83static unsigned long __thread nr_del;
84static unsigned long __thread nr_delnoent;
85static unsigned long __thread lookup_fail;
86static unsigned long __thread lookup_ok;
87
14044b37 88static struct cds_lfht *test_ht;
ab7d5fc6 89
5e28c532 90struct test_data {
ab7d5fc6 91 int a;
5e28c532 92 int b;
ab7d5fc6
MD
93};
94
95static volatile int test_go, test_stop;
96
97static unsigned long wdelay;
98
ab7d5fc6
MD
99static unsigned long duration;
100
101/* read-side C.S. duration, in loops */
102static unsigned long rduration;
103
6d5c0ca9 104static unsigned long init_hash_size = DEFAULT_HASH_SIZE;
cd1ae16a 105static unsigned long init_populate;
6d5c0ca9
MD
106static unsigned long rand_pool = DEFAULT_RAND_POOL;
107static int add_only, add_unique;
108
ab7d5fc6
MD
109static inline void loop_sleep(unsigned long l)
110{
111 while(l-- != 0)
abc490a1 112 caa_cpu_relax();
ab7d5fc6
MD
113}
114
115static int verbose_mode;
116
117#define printf_verbose(fmt, args...) \
118 do { \
119 if (verbose_mode) \
33c7c748 120 printf(fmt, ## args); \
ab7d5fc6
MD
121 } while (0)
122
123static unsigned int cpu_affinities[NR_CPUS];
124static unsigned int next_aff = 0;
125static int use_affinity = 0;
126
127pthread_mutex_t affinity_mutex = PTHREAD_MUTEX_INITIALIZER;
128
129static void set_affinity(void)
130{
131 cpu_set_t mask;
132 int cpu;
133 int ret;
134
135 if (!use_affinity)
136 return;
137
138 ret = pthread_mutex_lock(&affinity_mutex);
139 if (ret) {
140 perror("Error in pthread mutex lock");
141 exit(-1);
142 }
143 cpu = cpu_affinities[next_aff++];
144 ret = pthread_mutex_unlock(&affinity_mutex);
145 if (ret) {
146 perror("Error in pthread mutex unlock");
147 exit(-1);
148 }
149 CPU_ZERO(&mask);
150 CPU_SET(cpu, &mask);
151 sched_setaffinity(0, sizeof(mask), &mask);
152}
153
154/*
155 * returns 0 if test should end.
156 */
157static int test_duration_write(void)
158{
159 return !test_stop;
160}
161
162static int test_duration_read(void)
163{
164 return !test_stop;
165}
166
167static unsigned long long __thread nr_writes;
168static unsigned long long __thread nr_reads;
169
170static unsigned int nr_readers;
171static unsigned int nr_writers;
172
173pthread_mutex_t rcu_copy_mutex = PTHREAD_MUTEX_INITIALIZER;
174
175void rcu_copy_mutex_lock(void)
176{
177 int ret;
178 ret = pthread_mutex_lock(&rcu_copy_mutex);
179 if (ret) {
180 perror("Error in pthread mutex lock");
181 exit(-1);
182 }
183}
184
185void rcu_copy_mutex_unlock(void)
186{
187 int ret;
188
189 ret = pthread_mutex_unlock(&rcu_copy_mutex);
190 if (ret) {
191 perror("Error in pthread mutex unlock");
192 exit(-1);
193 }
194}
195
732ad076
MD
196/*
197 * Hash function
198 * Source: http://burtleburtle.net/bob/c/lookup3.c
199 * Originally Public Domain
200 */
201
202#define rot(x, k) (((x) << (k)) | ((x) >> (32 - (k))))
203
204#define mix(a, b, c) \
205do { \
206 a -= c; a ^= rot(c, 4); c += b; \
207 b -= a; b ^= rot(a, 6); a += c; \
208 c -= b; c ^= rot(b, 8); b += a; \
209 a -= c; a ^= rot(c, 16); c += b; \
210 b -= a; b ^= rot(a, 19); a += c; \
211 c -= b; c ^= rot(b, 4); b += a; \
212} while (0)
213
214#define final(a, b, c) \
215{ \
216 c ^= b; c -= rot(b, 14); \
217 a ^= c; a -= rot(c, 11); \
218 b ^= a; b -= rot(a, 25); \
219 c ^= b; c -= rot(b, 16); \
220 a ^= c; a -= rot(c, 4);\
221 b ^= a; b -= rot(a, 14); \
222 c ^= b; c -= rot(b, 24); \
223}
224
225static __attribute__((unused))
226uint32_t hash_u32(
227 const uint32_t *k, /* the key, an array of uint32_t values */
228 size_t length, /* the length of the key, in uint32_ts */
229 uint32_t initval) /* the previous hash, or an arbitrary value */
230{
231 uint32_t a, b, c;
232
233 /* Set up the internal state */
234 a = b = c = 0xdeadbeef + (((uint32_t) length) << 2) + initval;
235
236 /*----------------------------------------- handle most of the key */
237 while (length > 3) {
238 a += k[0];
239 b += k[1];
240 c += k[2];
241 mix(a, b, c);
242 length -= 3;
243 k += 3;
244 }
245
246 /*----------------------------------- handle the last 3 uint32_t's */
247 switch (length) { /* all the case statements fall through */
248 case 3: c += k[2];
249 case 2: b += k[1];
250 case 1: a += k[0];
251 final(a, b, c);
252 case 0: /* case 0: nothing left to add */
253 break;
254 }
255 /*---------------------------------------------- report the result */
256 return c;
257}
258
259static
260void hashword2(
261 const uint32_t *k, /* the key, an array of uint32_t values */
262 size_t length, /* the length of the key, in uint32_ts */
263 uint32_t *pc, /* IN: seed OUT: primary hash value */
264 uint32_t *pb) /* IN: more seed OUT: secondary hash value */
265{
266 uint32_t a, b, c;
267
268 /* Set up the internal state */
269 a = b = c = 0xdeadbeef + ((uint32_t) (length << 2)) + *pc;
270 c += *pb;
271
272 /*----------------------------------------- handle most of the key */
273 while (length > 3) {
274 a += k[0];
275 b += k[1];
276 c += k[2];
277 mix(a, b, c);
278 length -= 3;
279 k += 3;
280 }
281
282 /*----------------------------------- handle the last 3 uint32_t's */
283 switch (length) { /* all the case statements fall through */
284 case 3: c += k[2];
285 case 2: b += k[1];
286 case 1: a += k[0];
287 final(a, b, c);
288 case 0: /* case 0: nothing left to add */
289 break;
290 }
291 /*---------------------------------------------- report the result */
292 *pc = c;
293 *pb = b;
294}
295
296#if (CAA_BITS_PER_LONG == 32)
abc490a1 297static
732ad076 298unsigned long test_hash(void *_key, size_t length, unsigned long seed)
abc490a1 299{
abc490a1
MD
300 unsigned long key = (unsigned long) _key;
301 unsigned long v;
302
732ad076
MD
303 assert(length == sizeof(unsigned long));
304 return hash_u32(&v, 1, seed);
305}
306#else
307static
308unsigned long test_hash(void *_key, size_t length, unsigned long seed)
309{
310 union {
311 uint64_t v64;
312 uint32_t v32[2];
313 } v;
314 union {
315 uint64_t v64;
316 uint32_t v32[2];
317 } key;
318
319 assert(length == sizeof(unsigned long));
320 v.v64 = (uint64_t) seed;
321 key.v64 = (uint64_t) _key;
322 hashword2(key.v32, 2, &v.v32[0], &v.v32[1]);
323 return v.v64;
324}
325#endif
abc490a1 326
732ad076
MD
327static
328unsigned long test_compare(void *key1, size_t key1_len,
329 void *key2, size_t key2_len)
330{
331 if (unlikely(key1_len != key2_len))
332 return -1;
333 assert(key1_len == sizeof(unsigned long));
334 if (key1 == key2)
335 return 0;
336 else
337 return 1;
abc490a1 338}
ab7d5fc6
MD
339
340void *thr_reader(void *_count)
341{
342 unsigned long long *count = _count;
14044b37 343 struct cds_lfht_node *node;
ab7d5fc6
MD
344
345 printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
346 "reader", pthread_self(), (unsigned long)gettid());
347
348 set_affinity();
349
350 rcu_register_thread();
351
352 while (!test_go)
353 {
354 }
abc490a1 355 cmm_smp_mb();
ab7d5fc6
MD
356
357 for (;;) {
358 rcu_read_lock();
14044b37 359 node = cds_lfht_lookup(test_ht,
6d5c0ca9 360 (void *)(unsigned long)(rand_r(&rand_lookup) % rand_pool),
732ad076 361 sizeof(void *));
abc490a1 362 if (node == NULL)
5e28c532
MD
363 lookup_fail++;
364 else
365 lookup_ok++;
ab7d5fc6 366 debug_yield_read();
ab7d5fc6
MD
367 if (unlikely(rduration))
368 loop_sleep(rduration);
369 rcu_read_unlock();
370 nr_reads++;
371 if (unlikely(!test_duration_read()))
372 break;
5567839e
MD
373 if (unlikely((nr_reads & ((1 << 10) - 1)) == 0))
374 rcu_quiescent_state();
ab7d5fc6
MD
375 }
376
377 rcu_unregister_thread();
378
379 *count = nr_reads;
380 printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
381 "reader", pthread_self(), (unsigned long)gettid());
5e28c532
MD
382 printf_verbose("readid : %lx, lookupfail %lu, lookupok %lu\n",
383 pthread_self(), lookup_fail, lookup_ok);
ab7d5fc6
MD
384 return ((void*)1);
385
386}
387
abc490a1
MD
388static
389void free_node_cb(struct rcu_head *head)
390{
14044b37
MD
391 struct cds_lfht_node *node =
392 caa_container_of(head, struct cds_lfht_node, head);
abc490a1
MD
393 free(node);
394}
395
ab7d5fc6
MD
396void *thr_writer(void *_count)
397{
14044b37 398 struct cds_lfht_node *node, *ret_node;
b8e1907c 399 struct wr_count *count = _count;
5e28c532 400 int ret;
ab7d5fc6
MD
401
402 printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
403 "writer", pthread_self(), (unsigned long)gettid());
404
405 set_affinity();
406
5e28c532 407 rcu_register_thread();
5e28c532 408
ab7d5fc6
MD
409 while (!test_go)
410 {
411 }
abc490a1 412 cmm_smp_mb();
ab7d5fc6
MD
413
414 for (;;) {
6d5c0ca9 415 if (add_only || rand_r(&rand_lookup) & 1) {
14044b37 416 node = malloc(sizeof(struct cds_lfht_node));
abc490a1 417 rcu_read_lock();
14044b37 418 cds_lfht_node_init(node,
6d5c0ca9 419 (void *)(unsigned long)(rand_r(&rand_lookup) % rand_pool),
cb233752 420 sizeof(void *));
6d5c0ca9 421 if (add_unique)
14044b37 422 ret_node = cds_lfht_add_unique(test_ht, node);
6d5c0ca9 423 else
14044b37 424 cds_lfht_add(test_ht, node);
abc490a1 425 rcu_read_unlock();
6d5c0ca9 426 if (add_unique && ret_node != node) {
742aa1db 427 free(node);
3eca1b8c 428 nr_addexist++;
742aa1db 429 } else
3eca1b8c 430 nr_add++;
5e28c532
MD
431 } else {
432 /* May delete */
abc490a1 433 rcu_read_lock();
14044b37 434 node = cds_lfht_lookup(test_ht,
6d5c0ca9 435 (void *)(unsigned long)(rand_r(&rand_lookup) % rand_pool),
732ad076 436 sizeof(void *));
abc490a1 437 if (node)
14044b37 438 ret = cds_lfht_remove(test_ht, node);
5e28c532 439 else
abc490a1
MD
440 ret = -ENOENT;
441 rcu_read_unlock();
442 if (ret == 0) {
443 call_rcu(&node->head, free_node_cb);
5e28c532 444 nr_del++;
abc490a1
MD
445 } else
446 nr_delnoent++;
44395fb7 447 }
abc490a1 448#if 0
44395fb7
MD
449 //if (nr_writes % 100000 == 0) {
450 if (nr_writes % 1000 == 0) {
abc490a1 451 rcu_read_lock();
44395fb7
MD
452 if (rand_r(&rand_lookup) & 1) {
453 ht_resize(test_ht, 1);
454 } else {
455 ht_resize(test_ht, -1);
456 }
abc490a1 457 rcu_read_unlock();
5e28c532 458 }
abc490a1 459#endif //0
ab7d5fc6
MD
460 nr_writes++;
461 if (unlikely(!test_duration_write()))
462 break;
463 if (unlikely(wdelay))
464 loop_sleep(wdelay);
5567839e
MD
465 if (unlikely((nr_writes & ((1 << 10) - 1)) == 0))
466 rcu_quiescent_state();
ab7d5fc6
MD
467 }
468
5e28c532
MD
469 rcu_unregister_thread();
470
ab7d5fc6
MD
471 printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
472 "writer", pthread_self(), (unsigned long)gettid());
5e28c532
MD
473 printf_verbose("info id %lx: nr_add %lu, nr_addexist %lu, nr_del %lu, "
474 "nr_delnoent %lu\n", pthread_self(), nr_add,
475 nr_addexist, nr_del, nr_delnoent);
b8e1907c
MD
476 count->update_ops = nr_writes;
477 count->add = nr_add;
3c16bf4b 478 count->add_exist = nr_addexist;
b8e1907c 479 count->remove = nr_del;
ab7d5fc6
MD
480 return ((void*)2);
481}
482
cd1ae16a
MD
483static void populate_hash(void)
484{
485 struct cds_lfht_node *node, *ret_node;
486
487 if (!init_populate)
488 return;
489
490 while (nr_add < init_populate) {
491 node = malloc(sizeof(struct cds_lfht_node));
492 cds_lfht_node_init(node,
493 (void *)(unsigned long)(rand_r(&rand_lookup) % rand_pool),
494 sizeof(void *));
495 if (add_unique)
496 ret_node = cds_lfht_add_unique(test_ht, node);
497 else
498 cds_lfht_add(test_ht, node);
499 if (add_unique && ret_node != node) {
500 free(node);
501 nr_addexist++;
502 } else
503 nr_add++;
504 nr_writes++;
505 }
506}
507
ab7d5fc6
MD
508void show_usage(int argc, char **argv)
509{
510 printf("Usage : %s nr_readers nr_writers duration (s)", argv[0]);
511#ifdef DEBUG_YIELD
512 printf(" [-r] [-w] (yield reader and/or writer)");
513#endif
514 printf(" [-d delay] (writer period (us))");
515 printf(" [-c duration] (reader C.S. duration (in loops))");
516 printf(" [-v] (verbose output)");
517 printf(" [-a cpu#] [-a cpu#]... (affinity)");
6d5c0ca9
MD
518 printf(" [-p size] (random key value pool size)");
519 printf(" [-h size] (initial hash table size)");
520 printf(" [-u] Uniquify add.");
521 printf(" [-i] Add only (no removal).");
cd1ae16a 522 printf(" [-k nr_nodes] Number of nodes to insert initially.");
ab7d5fc6
MD
523 printf("\n");
524}
525
526int main(int argc, char **argv)
527{
528 int err;
529 pthread_t *tid_reader, *tid_writer;
530 void *tret;
b8e1907c
MD
531 unsigned long long *count_reader;
532 struct wr_count *count_writer;
533 unsigned long long tot_reads = 0, tot_writes = 0,
3c16bf4b 534 tot_add = 0, tot_add_exist = 0, tot_remove = 0;
b8e1907c 535 unsigned long count, removed;
5e28c532 536 int i, a, ret;
ab7d5fc6
MD
537
538 if (argc < 4) {
539 show_usage(argc, argv);
540 return -1;
541 }
542
543 err = sscanf(argv[1], "%u", &nr_readers);
544 if (err != 1) {
545 show_usage(argc, argv);
546 return -1;
547 }
548
549 err = sscanf(argv[2], "%u", &nr_writers);
550 if (err != 1) {
551 show_usage(argc, argv);
552 return -1;
553 }
554
555 err = sscanf(argv[3], "%lu", &duration);
556 if (err != 1) {
557 show_usage(argc, argv);
558 return -1;
559 }
560
561 for (i = 4; i < argc; i++) {
562 if (argv[i][0] != '-')
563 continue;
564 switch (argv[i][1]) {
565#ifdef DEBUG_YIELD
566 case 'r':
567 yield_active |= YIELD_READ;
568 break;
569 case 'w':
570 yield_active |= YIELD_WRITE;
571 break;
572#endif
573 case 'a':
574 if (argc < i + 2) {
575 show_usage(argc, argv);
576 return -1;
577 }
578 a = atoi(argv[++i]);
579 cpu_affinities[next_aff++] = a;
580 use_affinity = 1;
581 printf_verbose("Adding CPU %d affinity\n", a);
582 break;
583 case 'c':
584 if (argc < i + 2) {
585 show_usage(argc, argv);
586 return -1;
587 }
588 rduration = atol(argv[++i]);
589 break;
590 case 'd':
591 if (argc < i + 2) {
592 show_usage(argc, argv);
593 return -1;
594 }
595 wdelay = atol(argv[++i]);
596 break;
597 case 'v':
598 verbose_mode = 1;
599 break;
6d5c0ca9
MD
600 case 'p':
601 if (argc < i + 2) {
602 show_usage(argc, argv);
603 return -1;
604 }
605 rand_pool = atol(argv[++i]);
606 break;
607 case 'h':
608 if (argc < i + 2) {
609 show_usage(argc, argv);
610 return -1;
611 }
612 init_hash_size = atol(argv[++i]);
613 break;
614 case 'u':
615 add_unique = 1;
616 break;
617 case 'i':
618 add_only = 1;
619 break;
cd1ae16a
MD
620 case 'k':
621 init_populate = atol(argv[++i]);
622 break;
ab7d5fc6
MD
623 }
624 }
625
6d5c0ca9
MD
626 /* Check if hash size is power of 2 */
627 if (init_hash_size && init_hash_size & (init_hash_size - 1)) {
628 printf("Error: Hash table size %lu is not a power of 2.\n",
629 init_hash_size);
630 return -1;
631 }
632
ab7d5fc6
MD
633 printf_verbose("running test for %lu seconds, %u readers, %u writers.\n",
634 duration, nr_readers, nr_writers);
635 printf_verbose("Writer delay : %lu loops.\n", wdelay);
636 printf_verbose("Reader duration : %lu loops.\n", rduration);
6d5c0ca9
MD
637 printf_verbose("Random pool size : %lu.\n", rand_pool);
638 printf_verbose("Mode:%s%s.\n",
639 add_only ? " add only" : " add/remove",
640 add_unique ? " uniquify" : "");
641 printf_verbose("Initial hash table size: %lu buckets.\n", init_hash_size);
ab7d5fc6
MD
642 printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
643 "main", pthread_self(), (unsigned long)gettid());
644
ab7d5fc6
MD
645 tid_reader = malloc(sizeof(*tid_reader) * nr_readers);
646 tid_writer = malloc(sizeof(*tid_writer) * nr_writers);
647 count_reader = malloc(sizeof(*count_reader) * nr_readers);
648 count_writer = malloc(sizeof(*count_writer) * nr_writers);
14044b37 649 test_ht = cds_lfht_new(test_hash, test_compare, 0x42UL,
6d5c0ca9 650 init_hash_size, call_rcu);
cd1ae16a 651 populate_hash();
14756542
MD
652 err = create_all_cpu_call_rcu_data(0);
653 assert(!err);
654
ab7d5fc6
MD
655 next_aff = 0;
656
657 for (i = 0; i < nr_readers; i++) {
658 err = pthread_create(&tid_reader[i], NULL, thr_reader,
659 &count_reader[i]);
660 if (err != 0)
661 exit(1);
662 }
663 for (i = 0; i < nr_writers; i++) {
664 err = pthread_create(&tid_writer[i], NULL, thr_writer,
665 &count_writer[i]);
666 if (err != 0)
667 exit(1);
668 }
669
abc490a1 670 cmm_smp_mb();
ab7d5fc6
MD
671
672 test_go = 1;
673
674 sleep(duration);
675
676 test_stop = 1;
677
678 for (i = 0; i < nr_readers; i++) {
679 err = pthread_join(tid_reader[i], &tret);
680 if (err != 0)
681 exit(1);
682 tot_reads += count_reader[i];
683 }
684 for (i = 0; i < nr_writers; i++) {
685 err = pthread_join(tid_writer[i], &tret);
686 if (err != 0)
687 exit(1);
b8e1907c
MD
688 tot_writes += count_writer[i].update_ops;
689 tot_add += count_writer[i].add;
3c16bf4b 690 tot_add_exist += count_writer[i].add_exist;
b8e1907c 691 tot_remove += count_writer[i].remove;
ab7d5fc6 692 }
33c7c748
MD
693 printf("Counting nodes... ");
694 fflush(stdout);
14044b37 695 cds_lfht_count_nodes(test_ht, &count, &removed);
33c7c748 696 printf("done.\n");
b8e1907c 697 if (count || removed)
273399de
MD
698 printf("WARNING: nodes left in the hash table upon destroy: "
699 "%lu nodes + %lu logically removed.\n", count, removed);
14044b37 700 ret = cds_lfht_destroy(test_ht);
f000907d 701
33c7c748
MD
702 if (ret)
703 printf_verbose("final delete aborted\n");
704 else
705 printf_verbose("final delete success\n");
ab7d5fc6
MD
706 printf_verbose("total number of reads : %llu, writes %llu\n", tot_reads,
707 tot_writes);
708 printf("SUMMARY %-25s testdur %4lu nr_readers %3u rdur %6lu "
709 "nr_writers %3u "
6d5c0ca9 710 "wdelay %6lu rand_pool %12llu nr_reads %12llu nr_writes %12llu nr_ops %12llu "
cd1ae16a 711 "nr_add %12llu nr_add_fail %12llu nr_remove %12llu nr_leaked %12lld\n",
ab7d5fc6 712 argv[0], duration, nr_readers, rduration,
6d5c0ca9 713 nr_writers, wdelay, rand_pool, tot_reads, tot_writes,
3c16bf4b 714 tot_reads + tot_writes, tot_add, tot_add_exist, tot_remove,
cd1ae16a 715 (long long) tot_add + init_populate - tot_remove - count);
ab7d5fc6
MD
716 free(tid_reader);
717 free(tid_writer);
718 free(count_reader);
719 free(count_writer);
720 return 0;
721}
This page took 0.05267 seconds and 4 git commands to generate.