test ja-range: max len
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 13 Jun 2013 12:14:16 +0000 (08:14 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 13 Jun 2013 12:14:16 +0000 (08:14 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
tests/test_urcu_ja_range.c

index 12abcc51465b64a7124fb3e48a2150e225e145af..b0f2fe405a9121a9cbff91b05fe84fa61b58caaa 100644 (file)
@@ -71,7 +71,7 @@ DEFINE_URCU_TLS(unsigned long long, nr_reads);
 unsigned int nr_readers;
 unsigned int nr_writers;
 
-static unsigned int add_ratio = 50;
+static unsigned int add_ratio = 50, range_max_len = 0;
 static uint64_t key_mul = 1ULL;
 
 static int add_unique, add_replace;
@@ -159,6 +159,7 @@ printf("        [not -u nor -s] Add entries (supports redundant keys).\n");
        printf("        [-B] Key bits for multithread test (default: 32).\n");
        printf("        [-m factor] Key multiplication factor.\n");
        printf("        [-l] Memory leak detection.\n");
+       printf("        [-L len] Range max len.\n");
        printf("\n\n");
 }
 
@@ -295,6 +296,9 @@ void *test_ja_rw_thr_writer(void *_count)
                                start = end;
                                end = tmp;
                        }
+                       if (end - start > range_max_len) {
+                               end = start + range_max_len;
+                       }
                        rcu_read_lock();
                        ret = cds_ja_range_add(test_ja, start, end, NULL);
                        if (ret) {
@@ -594,6 +598,9 @@ int main(int argc, char **argv)
                case 'l':
                        leak_detection = 1;
                        break;
+               case 'L':
+                       range_max_len = atol(argv[++i]);
+                       break;
                }
        }
 
@@ -612,6 +619,8 @@ int main(int argc, char **argv)
                lookup_pool_offset, lookup_pool_size);
        printf_verbose("Update pool size offset %lu size %lu.\n",
                write_pool_offset, write_pool_size);
+       printf_verbose("Range max len: %lu.\n",
+               range_max_len);
        if (validate_lookup)
                printf_verbose("Validating lookups.\n");
        if (leak_detection)
This page took 0.027632 seconds and 4 git commands to generate.