diff options
Diffstat (limited to 'storage/tokudb/PerconaFT/ft/tests')
28 files changed, 317 insertions, 161 deletions
diff --git a/storage/tokudb/PerconaFT/ft/tests/cachetable-4357.cc b/storage/tokudb/PerconaFT/ft/tests/cachetable-4357.cc index 8bbda295462..0af5c8185a9 100644 --- a/storage/tokudb/PerconaFT/ft/tests/cachetable-4357.cc +++ b/storage/tokudb/PerconaFT/ft/tests/cachetable-4357.cc @@ -71,21 +71,26 @@ cachetable_test (void) { void* v1; long s1; - r = toku_cachetable_get_and_pin( - f1, - make_blocknum(1), - toku_cachetable_hash(f1, make_blocknum(1)), - &v1, - &s1, - def_write_callback(NULL), def_fetch, def_pf_req_callback, def_pf_callback, - true, - NULL - ); + r = toku_cachetable_get_and_pin(f1, + make_blocknum(1), + toku_cachetable_hash(f1, make_blocknum(1)), + &v1, + &s1, + def_write_callback(NULL), + def_fetch, + def_pf_req_callback, + def_pf_callback, + true, + NULL); toku_pthread_t pin_nonblocking_tid; - r = toku_pthread_create(&pin_nonblocking_tid, NULL, pin_nonblocking, NULL); - assert_zero(r); + r = toku_pthread_create(toku_uninstrumented, + &pin_nonblocking_tid, + nullptr, + pin_nonblocking, + nullptr); + assert_zero(r); // sleep 3 seconds - usleep(3*1024*1024); + usleep(3 * 1024 * 1024); r = toku_test_cachetable_unpin_and_remove(f1, make_blocknum(1), NULL, NULL); assert_zero(r); diff --git a/storage/tokudb/PerconaFT/ft/tests/cachetable-4365.cc b/storage/tokudb/PerconaFT/ft/tests/cachetable-4365.cc index 9c54c086f5b..7bee0b80770 100644 --- a/storage/tokudb/PerconaFT/ft/tests/cachetable-4365.cc +++ b/storage/tokudb/PerconaFT/ft/tests/cachetable-4365.cc @@ -71,15 +71,16 @@ static void *put_same_key(void *arg) { return arg; } - toku_pthread_t put_tid; -static void test_remove_key(CACHEKEY* UU(cachekey), bool UU(for_checkpoint), void* UU(extra)) { - int r = toku_pthread_create(&put_tid, NULL, put_same_key, NULL); - assert_zero(r); +static void test_remove_key(CACHEKEY *UU(cachekey), + bool UU(for_checkpoint), + void *UU(extra)) { + int r = toku_pthread_create( + toku_uninstrumented, &put_tid, nullptr, put_same_key, nullptr); + assert_zero(r); } - static void cachetable_test (void) { const int test_limit = 12; @@ -92,21 +93,26 @@ cachetable_test (void) { void* v1; long s1; - r = toku_cachetable_get_and_pin( - f1, - make_blocknum(1), - toku_cachetable_hash(f1, make_blocknum(1)), - &v1, - &s1, - def_write_callback(NULL), def_fetch, def_pf_req_callback, def_pf_callback, - true, - NULL - ); + r = toku_cachetable_get_and_pin(f1, + make_blocknum(1), + toku_cachetable_hash(f1, make_blocknum(1)), + &v1, + &s1, + def_write_callback(nullptr), + def_fetch, + def_pf_req_callback, + def_pf_callback, + true, + nullptr); toku_pthread_t pin_nonblocking_tid; - r = toku_pthread_create(&pin_nonblocking_tid, NULL, pin_nonblocking, NULL); - assert_zero(r); + r = toku_pthread_create(toku_uninstrumented, + &pin_nonblocking_tid, + nullptr, + pin_nonblocking, + nullptr); + assert_zero(r); // sleep 3 seconds - usleep(3*1024*1024); + usleep(3 * 1024 * 1024); r = toku_test_cachetable_unpin_and_remove(f1, make_blocknum(1), test_remove_key, NULL); assert_zero(r); diff --git a/storage/tokudb/PerconaFT/ft/tests/cachetable-5097.cc b/storage/tokudb/PerconaFT/ft/tests/cachetable-5097.cc index c1b6e0a94f2..5ab0df88e08 100644 --- a/storage/tokudb/PerconaFT/ft/tests/cachetable-5097.cc +++ b/storage/tokudb/PerconaFT/ft/tests/cachetable-5097.cc @@ -153,13 +153,16 @@ cachetable_test (void) { assert(r == 0); } - // at this point, we have a dirty PAIR in the cachetable associated with cachefile f1 - // launch a thread that will put another PAIR in the cachetable, and get partial eviction started + // at this point, we have a dirty PAIR in the cachetable associated with + // cachefile f1 + // launch a thread that will put another PAIR in the cachetable, and get + // partial eviction started toku_pthread_t tid; - r = toku_pthread_create(&tid, NULL, f2_pin, NULL); + r = toku_pthread_create( + toku_uninstrumented, &tid, nullptr, f2_pin, nullptr); assert_zero(r); - usleep(2*1024*1024); + usleep(2 * 1024 * 1024); check_flush = true; toku_cachefile_close(&f1, false, ZERO_LSN); if (enable_partial_eviction) diff --git a/storage/tokudb/PerconaFT/ft/tests/cachetable-5978-2.cc b/storage/tokudb/PerconaFT/ft/tests/cachetable-5978-2.cc index b462d76eeee..0b5110ddd99 100644 --- a/storage/tokudb/PerconaFT/ft/tests/cachetable-5978-2.cc +++ b/storage/tokudb/PerconaFT/ft/tests/cachetable-5978-2.cc @@ -114,14 +114,14 @@ unpin_two (void* UU(v)) { ); assert_zero(r); - // at this point, we have p1 pinned, want to start a thread to do an unpin_and_remove - // on p1 - r = toku_pthread_create( - &unpin_and_remove_tid, - NULL, - unpin_and_remove_one, - NULL - ); + // at this point, we have p1 pinned, want to start a thread to do an + // unpin_and_remove + // on p1 + r = toku_pthread_create(toku_uninstrumented, + &unpin_and_remove_tid, + nullptr, + unpin_and_remove_one, + nullptr); assert_zero(r); // sleep to give a chance for the unpin_and_remove to get going usleep(512*1024); @@ -173,9 +173,9 @@ cachetable_test (void) { r = toku_cachetable_get_and_pin(f1, make_blocknum(2), 2, &v1, &s1, wc, fetch_two, def_pf_req_callback, def_pf_callback, true, NULL); assert_zero(r); - toku_pthread_t tid1; - r = toku_pthread_create(&tid1, NULL, repin_one, NULL); + r = toku_pthread_create( + toku_uninstrumented, &tid1, nullptr, repin_one, nullptr); assert_zero(r); void *ret; diff --git a/storage/tokudb/PerconaFT/ft/tests/cachetable-5978.cc b/storage/tokudb/PerconaFT/ft/tests/cachetable-5978.cc index ee68ab3ef0b..a4ff6c33e6a 100644 --- a/storage/tokudb/PerconaFT/ft/tests/cachetable-5978.cc +++ b/storage/tokudb/PerconaFT/ft/tests/cachetable-5978.cc @@ -199,9 +199,11 @@ cachetable_test (void) { toku_pthread_t tid1; toku_pthread_t tid2; - r = toku_pthread_create(&tid1, NULL, repin_one, NULL); + r = toku_pthread_create( + toku_uninstrumented, &tid1, nullptr, repin_one, nullptr); assert_zero(r); - r = toku_pthread_create(&tid2, NULL, repin_two, NULL); + r = toku_pthread_create( + toku_uninstrumented, &tid2, nullptr, repin_two, nullptr); assert_zero(r); // unpin 1 and 2 so tid1 and tid2 can make progress diff --git a/storage/tokudb/PerconaFT/ft/tests/cachetable-checkpoint-pending.cc b/storage/tokudb/PerconaFT/ft/tests/cachetable-checkpoint-pending.cc index 3dd3a15e2de..5e87fed740d 100644 --- a/storage/tokudb/PerconaFT/ft/tests/cachetable-checkpoint-pending.cc +++ b/storage/tokudb/PerconaFT/ft/tests/cachetable-checkpoint-pending.cc @@ -158,14 +158,24 @@ static void checkpoint_pending(void) { // the checkpoint should cause n writes, but since n <= the cachetable size, // all items should be kept in the cachetable - n_flush = n_write_me = n_keep_me = n_fetch = 0; expect_value = 42; - //printf("E42\n"); + n_flush = n_write_me = n_keep_me = n_fetch = 0; + expect_value = 42; + // printf("E42\n"); toku_pthread_t checkpoint_thread, update_thread; - r = toku_pthread_create(&checkpoint_thread, NULL, do_checkpoint, NULL); assert(r==0); - r = toku_pthread_create(&update_thread, NULL, do_update, NULL); assert(r==0); - r = toku_pthread_join(checkpoint_thread, 0); assert(r==0); - r = toku_pthread_join(update_thread, 0); assert(r==0); - + r = toku_pthread_create(toku_uninstrumented, + &checkpoint_thread, + nullptr, + do_checkpoint, + nullptr); + assert(r == 0); + r = toku_pthread_create( + toku_uninstrumented, &update_thread, nullptr, do_update, nullptr); + assert(r == 0); + r = toku_pthread_join(checkpoint_thread, 0); + assert(r == 0); + r = toku_pthread_join(update_thread, 0); + assert(r == 0); + assert(n_flush == N && n_write_me == N && n_keep_me == N); // after the checkpoint, all of the items should be 43 diff --git a/storage/tokudb/PerconaFT/ft/tests/cachetable-cleaner-thread-attrs-accumulate.cc b/storage/tokudb/PerconaFT/ft/tests/cachetable-cleaner-thread-attrs-accumulate.cc index c1e7b373e83..dd6c674af24 100644 --- a/storage/tokudb/PerconaFT/ft/tests/cachetable-cleaner-thread-attrs-accumulate.cc +++ b/storage/tokudb/PerconaFT/ft/tests/cachetable-cleaner-thread-attrs-accumulate.cc @@ -91,7 +91,7 @@ run_test (void) { const int test_limit = 1000; int r; CACHETABLE ct; - toku_mutex_init(&attr_mutex, NULL); + toku_mutex_init(toku_uninstrumented, &attr_mutex, nullptr); toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr); const char *fname1 = TOKU_TEST_FILENAME; diff --git a/storage/tokudb/PerconaFT/ft/tests/cachetable-clone-checkpoint.cc b/storage/tokudb/PerconaFT/ft/tests/cachetable-clone-checkpoint.cc index 50bd20f492e..99d595b1ff1 100644 --- a/storage/tokudb/PerconaFT/ft/tests/cachetable-clone-checkpoint.cc +++ b/storage/tokudb/PerconaFT/ft/tests/cachetable-clone-checkpoint.cc @@ -112,14 +112,17 @@ cachetable_test (void) { CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct); toku_cachetable_begin_checkpoint(cp, NULL); - clone_flush_started = false; clone_flush_completed = false; toku_pthread_t checkpoint_tid; - r = toku_pthread_create(&checkpoint_tid, NULL, run_end_checkpoint, NULL); - assert_zero(r); + r = toku_pthread_create(toku_uninstrumented, + &checkpoint_tid, + nullptr, + run_end_checkpoint, + nullptr); + assert_zero(r); - usleep(1*1024*1024); + usleep(1 * 1024 * 1024); r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL); assert_zero(r); diff --git a/storage/tokudb/PerconaFT/ft/tests/cachetable-pin-checkpoint.cc b/storage/tokudb/PerconaFT/ft/tests/cachetable-pin-checkpoint.cc index 8a270af0566..65b02aebaec 100644 --- a/storage/tokudb/PerconaFT/ft/tests/cachetable-pin-checkpoint.cc +++ b/storage/tokudb/PerconaFT/ft/tests/cachetable-pin-checkpoint.cc @@ -386,19 +386,28 @@ cachetable_test (void) { run_test = true; for (int i = 0; i < NUM_MOVER_THREADS; i++) { - r = toku_pthread_create(&read_random_tid[i], NULL, read_random_numbers, NULL); + r = toku_pthread_create(toku_uninstrumented, + &read_random_tid[i], + nullptr, + read_random_numbers, + nullptr); assert_zero(r); } for (int i = 0; i < NUM_MOVER_THREADS; i++) { - r = toku_pthread_create(&move_tid[i], NULL, move_numbers, NULL); + r = toku_pthread_create(toku_uninstrumented, + &move_tid[i], + nullptr, + move_numbers, + nullptr); assert_zero(r); } - r = toku_pthread_create(&checkpoint_tid, NULL, checkpoints, NULL); - assert_zero(r); - r = toku_pthread_create(&time_tid, NULL, test_time, NULL); + r = toku_pthread_create( + toku_uninstrumented, &checkpoint_tid, nullptr, checkpoints, nullptr); + assert_zero(r); + r = toku_pthread_create( + toku_uninstrumented, &time_tid, nullptr, test_time, nullptr); assert_zero(r); - void *ret; r = toku_pthread_join(time_tid, &ret); assert_zero(r); diff --git a/storage/tokudb/PerconaFT/ft/tests/cachetable-put-checkpoint.cc b/storage/tokudb/PerconaFT/ft/tests/cachetable-put-checkpoint.cc index afc95471116..4cf1678449b 100644 --- a/storage/tokudb/PerconaFT/ft/tests/cachetable-put-checkpoint.cc +++ b/storage/tokudb/PerconaFT/ft/tests/cachetable-put-checkpoint.cc @@ -518,19 +518,28 @@ cachetable_test (void) { run_test = true; for (int i = 0; i < NUM_MOVER_THREADS; i++) { - r = toku_pthread_create(&move_tid[i], NULL, move_numbers, NULL); + r = toku_pthread_create(toku_uninstrumented, + &move_tid[i], + nullptr, + move_numbers, + nullptr); assert_zero(r); } for (int i = 0; i < NUM_MOVER_THREADS; i++) { - r = toku_pthread_create(&merge_and_split_tid[i], NULL, merge_and_split, NULL); + r = toku_pthread_create(toku_uninstrumented, + &merge_and_split_tid[i], + nullptr, + merge_and_split, + nullptr); assert_zero(r); } - r = toku_pthread_create(&checkpoint_tid, NULL, checkpoints, NULL); - assert_zero(r); - r = toku_pthread_create(&time_tid, NULL, test_time, NULL); + r = toku_pthread_create( + toku_uninstrumented, &checkpoint_tid, nullptr, checkpoints, nullptr); + assert_zero(r); + r = toku_pthread_create( + toku_uninstrumented, &time_tid, nullptr, test_time, nullptr); assert_zero(r); - void *ret; r = toku_pthread_join(time_tid, &ret); assert_zero(r); diff --git a/storage/tokudb/PerconaFT/ft/tests/cachetable-rwlock-test.cc b/storage/tokudb/PerconaFT/ft/tests/cachetable-rwlock-test.cc index 9a62f99e1fa..6d8bc28026c 100644 --- a/storage/tokudb/PerconaFT/ft/tests/cachetable-rwlock-test.cc +++ b/storage/tokudb/PerconaFT/ft/tests/cachetable-rwlock-test.cc @@ -40,24 +40,22 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. // test create and destroy -static void -test_create_destroy (void) { - struct rwlock the_rwlock, *rwlock = &the_rwlock; +static void test_create_destroy(void) { + struct st_rwlock the_rwlock, *rwlock = &the_rwlock; - rwlock_init(rwlock); + rwlock_init(toku_uninstrumented, rwlock); rwlock_destroy(rwlock); } // test read lock and unlock with no writers -static void -test_simple_read_lock (int n) { - struct rwlock the_rwlock, *rwlock = &the_rwlock; +static void test_simple_read_lock(int n) { + struct st_rwlock the_rwlock, *rwlock = &the_rwlock; - rwlock_init(rwlock); + rwlock_init(toku_uninstrumented, rwlock); assert(rwlock_readers(rwlock) == 0); int i; - for (i=1; i<=n; i++) { + for (i = 1; i <= n; i++) { rwlock_read_lock(rwlock, 0); assert(rwlock_readers(rwlock) == i); assert(rwlock_users(rwlock) == i); @@ -72,11 +70,10 @@ test_simple_read_lock (int n) { // test write lock and unlock with no readers -static void -test_simple_write_lock (void) { - struct rwlock the_rwlock, *rwlock = &the_rwlock; +static void test_simple_write_lock(void) { + struct st_rwlock the_rwlock, *rwlock = &the_rwlock; - rwlock_init(rwlock); + rwlock_init(toku_uninstrumented, rwlock); assert(rwlock_users(rwlock) == 0); rwlock_write_lock(rwlock, 0); assert(rwlock_writers(rwlock) == 1); @@ -88,19 +85,17 @@ test_simple_write_lock (void) { struct rw_event { int e; - struct rwlock the_rwlock; + struct st_rwlock the_rwlock; toku_mutex_t mutex; }; -static void -rw_event_init (struct rw_event *rwe) { +static void rw_event_init(struct rw_event *rwe) { rwe->e = 0; - rwlock_init(&rwe->the_rwlock); - toku_mutex_init(&rwe->mutex, 0); + rwlock_init(toku_uninstrumented, &rwe->the_rwlock); + toku_mutex_init(toku_uninstrumented, &rwe->mutex, nullptr); } -static void -rw_event_destroy (struct rw_event *rwe) { +static void rw_event_destroy(struct rw_event *rwe) { rwlock_destroy(&rwe->the_rwlock); toku_mutex_destroy(&rwe->mutex); } @@ -138,10 +133,12 @@ test_writer_priority (void) { toku_mutex_unlock(&rwe->mutex); toku_pthread_t tid; - r = toku_pthread_create(&tid, 0, test_writer_priority_thread, rwe); + r = toku_pthread_create( + toku_uninstrumented, &tid, 0, test_writer_priority_thread, rwe); sleep(1); toku_mutex_lock(&rwe->mutex); - rwe->e++; assert(rwe->e == 2); + rwe->e++; + assert(rwe->e == 2); toku_mutex_unlock(&rwe->mutex); sleep(1); @@ -196,10 +193,12 @@ test_single_writer (void) { toku_mutex_unlock(&rwe->mutex); toku_pthread_t tid; - r = toku_pthread_create(&tid, 0, test_single_writer_thread, rwe); + r = toku_pthread_create( + toku_uninstrumented, &tid, 0, test_single_writer_thread, rwe); sleep(1); toku_mutex_lock(&rwe->mutex); - rwe->e++; assert(rwe->e == 2); + rwe->e++; + assert(rwe->e == 2); assert(rwlock_writers(&rwe->the_rwlock) == 1); assert(rwlock_users(&rwe->the_rwlock) == 2); rwlock_write_unlock(&rwe->the_rwlock); diff --git a/storage/tokudb/PerconaFT/ft/tests/cachetable-simple-read-pin-nonblocking.cc b/storage/tokudb/PerconaFT/ft/tests/cachetable-simple-read-pin-nonblocking.cc index 8fd8828737a..ebe05e50883 100644 --- a/storage/tokudb/PerconaFT/ft/tests/cachetable-simple-read-pin-nonblocking.cc +++ b/storage/tokudb/PerconaFT/ft/tests/cachetable-simple-read-pin-nonblocking.cc @@ -111,9 +111,20 @@ run_test (void) { toku_pthread_t fetch_tid; fetch_called = false; - r = toku_pthread_create(&fetch_tid, NULL, run_expensive_fetch, NULL); + r = toku_pthread_create( + toku_uninstrumented, &fetch_tid, nullptr, run_expensive_fetch, nullptr); sleep(1); - r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, sleep_fetch, def_pf_req_callback, def_pf_callback, false, NULL); + r = toku_cachetable_get_and_pin(f1, + make_blocknum(1), + 1, + &v1, + &s1, + wc, + sleep_fetch, + def_pf_req_callback, + def_pf_callback, + false, + NULL); assert_zero(r); assert(fetch_called); r = toku_test_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_CLEAN, make_pair_attr(8)); @@ -133,9 +144,20 @@ run_test (void) { toku_pthread_t pf_tid; pf_called = false; - r = toku_pthread_create(&pf_tid, NULL, run_expensive_pf, NULL); + r = toku_pthread_create( + toku_uninstrumented, &pf_tid, nullptr, run_expensive_pf, nullptr); sleep(1); - r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, sleep_fetch, def_pf_req_callback, def_pf_callback, false, NULL); + r = toku_cachetable_get_and_pin(f1, + make_blocknum(1), + 1, + &v1, + &s1, + wc, + sleep_fetch, + def_pf_req_callback, + def_pf_callback, + false, + NULL); assert_zero(r); assert(pf_called); r = toku_test_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_CLEAN, make_pair_attr(8)); diff --git a/storage/tokudb/PerconaFT/ft/tests/cachetable-simple-read-pin.cc b/storage/tokudb/PerconaFT/ft/tests/cachetable-simple-read-pin.cc index 63ca871a459..dd5d59df002 100644 --- a/storage/tokudb/PerconaFT/ft/tests/cachetable-simple-read-pin.cc +++ b/storage/tokudb/PerconaFT/ft/tests/cachetable-simple-read-pin.cc @@ -117,9 +117,20 @@ run_test (void) { toku_pthread_t fetch_tid; fetch_called = false; - r = toku_pthread_create(&fetch_tid, NULL, run_expensive_fetch, NULL); + r = toku_pthread_create( + toku_uninstrumented, &fetch_tid, nullptr, run_expensive_fetch, nullptr); sleep(1); - r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, sleep_fetch, def_pf_req_callback, def_pf_callback, false, NULL); + r = toku_cachetable_get_and_pin(f1, + make_blocknum(1), + 1, + &v1, + &s1, + wc, + sleep_fetch, + def_pf_req_callback, + def_pf_callback, + false, + NULL); assert_zero(r); assert(fetch_called); r = toku_test_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_CLEAN, make_pair_attr(8)); @@ -141,9 +152,20 @@ run_test (void) { toku_pthread_t pf_tid; pf_called = false; - r = toku_pthread_create(&pf_tid, NULL, run_expensive_pf, NULL); + r = toku_pthread_create( + toku_uninstrumented, &pf_tid, nullptr, run_expensive_pf, nullptr); sleep(1); - r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, sleep_fetch, def_pf_req_callback, def_pf_callback, false, NULL); + r = toku_cachetable_get_and_pin(f1, + make_blocknum(1), + 1, + &v1, + &s1, + wc, + sleep_fetch, + def_pf_req_callback, + def_pf_callback, + false, + NULL); assert_zero(r); assert(pf_called); r = toku_test_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_CLEAN, make_pair_attr(8)); diff --git a/storage/tokudb/PerconaFT/ft/tests/cachetable-test.cc b/storage/tokudb/PerconaFT/ft/tests/cachetable-test.cc index e4bb5fb0aea..64f688c470d 100644 --- a/storage/tokudb/PerconaFT/ft/tests/cachetable-test.cc +++ b/storage/tokudb/PerconaFT/ft/tests/cachetable-test.cc @@ -42,15 +42,13 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. // global data, especially between the test thread and the cachetable // writeback threads -toku_mutex_t test_mutex; +toku_mutex_t test_mutex; static inline void test_mutex_init(void) { - toku_mutex_init(&test_mutex, 0); + toku_mutex_init(toku_uninstrumented, &test_mutex, nullptr); } -static inline void test_mutex_destroy(void) { - toku_mutex_destroy(&test_mutex); -} +static inline void test_mutex_destroy(void) { toku_mutex_destroy(&test_mutex); } static inline void test_mutex_lock(void) { toku_mutex_lock(&test_mutex); diff --git a/storage/tokudb/PerconaFT/ft/tests/cachetable-unpin-remove-and-checkpoint.cc b/storage/tokudb/PerconaFT/ft/tests/cachetable-unpin-remove-and-checkpoint.cc index 11baa36e51b..0e44bf10349 100644 --- a/storage/tokudb/PerconaFT/ft/tests/cachetable-unpin-remove-and-checkpoint.cc +++ b/storage/tokudb/PerconaFT/ft/tests/cachetable-unpin-remove-and-checkpoint.cc @@ -86,11 +86,22 @@ run_test (void) { // now this should mark the pair for checkpoint CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct); toku_cachetable_begin_checkpoint(cp, NULL); - r = toku_cachetable_get_and_pin(f1, make_blocknum(1), toku_cachetable_hash(f1, make_blocknum(1)), &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL); + r = toku_cachetable_get_and_pin(f1, + make_blocknum(1), + toku_cachetable_hash(f1, make_blocknum(1)), + &v1, + &s1, + wc, + def_fetch, + def_pf_req_callback, + def_pf_callback, + true, + NULL); toku_pthread_t mytid; - r = toku_pthread_create(&mytid, NULL, run_end_chkpt, NULL); - assert(r==0); + r = toku_pthread_create( + toku_uninstrumented, &mytid, nullptr, run_end_chkpt, nullptr); + assert(r == 0); // give checkpoint thread a chance to start waiting on lock sleep(1); diff --git a/storage/tokudb/PerconaFT/ft/tests/ftloader-test-extractor-errors.cc b/storage/tokudb/PerconaFT/ft/tests/ftloader-test-extractor-errors.cc index 872b674c784..4bff52ceb1b 100644 --- a/storage/tokudb/PerconaFT/ft/tests/ftloader-test-extractor-errors.cc +++ b/storage/tokudb/PerconaFT/ft/tests/ftloader-test-extractor-errors.cc @@ -141,7 +141,7 @@ static void test_extractor(int nrows, int nrowsets, bool expect_fail, const char // setup error injection toku_set_func_malloc(my_malloc); toku_set_func_realloc(my_realloc); - ft_loader_set_os_fwrite(bad_fwrite); + toku_set_func_fwrite(bad_fwrite); toku_set_func_write(bad_write); toku_set_func_pwrite(bad_pwrite); ft_loader_set_poll_function(&loader->poll_callback, loader_poll_callback, NULL); @@ -157,7 +157,7 @@ static void test_extractor(int nrows, int nrowsets, bool expect_fail, const char toku_set_func_malloc(NULL); toku_set_func_realloc(NULL); - ft_loader_set_os_fwrite(NULL); + toku_set_func_fwrite(nullptr); toku_set_func_write(NULL); toku_set_func_pwrite(NULL); diff --git a/storage/tokudb/PerconaFT/ft/tests/ftloader-test-merge-files-dbufio.cc b/storage/tokudb/PerconaFT/ft/tests/ftloader-test-merge-files-dbufio.cc index d1aeff198ff..0b121316738 100644 --- a/storage/tokudb/PerconaFT/ft/tests/ftloader-test-merge-files-dbufio.cc +++ b/storage/tokudb/PerconaFT/ft/tests/ftloader-test-merge-files-dbufio.cc @@ -393,13 +393,17 @@ static void test (const char *directory, bool is_error) { toku_pthread_t consumer; struct consumer_thunk cthunk = {q, 0}; { - int r = toku_pthread_create(&consumer, NULL, consumer_thread, (void*)&cthunk); - assert(r==0); + int r = toku_pthread_create(toku_uninstrumented, + &consumer, + nullptr, + consumer_thread, + static_cast<void *>(&cthunk)); + assert(r == 0); } toku_set_func_malloc_only(my_malloc); toku_set_func_realloc_only(my_realloc); - ft_loader_set_os_fwrite(bad_fwrite); + toku_set_func_fwrite(bad_fwrite); toku_set_func_write(bad_write); toku_set_func_pwrite(bad_pwrite); toku_set_func_fdopen(bad_fdopen); @@ -427,7 +431,7 @@ static void test (const char *directory, bool is_error) { toku_set_func_malloc(NULL); toku_set_func_realloc(NULL); - ft_loader_set_os_fwrite(NULL); + toku_set_func_fwrite(nullptr); toku_set_func_write(NULL); toku_set_func_pwrite(NULL); toku_set_func_fdopen(NULL); diff --git a/storage/tokudb/PerconaFT/ft/tests/ftloader-test-writer-errors.cc b/storage/tokudb/PerconaFT/ft/tests/ftloader-test-writer-errors.cc index 0784ca87a26..e4423319518 100644 --- a/storage/tokudb/PerconaFT/ft/tests/ftloader-test-writer-errors.cc +++ b/storage/tokudb/PerconaFT/ft/tests/ftloader-test-writer-errors.cc @@ -154,7 +154,7 @@ static int write_dbfile (char *tf_template, int n, char *output_name, bool expec toku_set_func_malloc_only(my_malloc); toku_set_func_realloc_only(my_realloc); - ft_loader_set_os_fwrite(bad_fwrite); + toku_set_func_fwrite(bad_fwrite); toku_set_func_write(bad_write); toku_set_func_pwrite(bad_pwrite); ft_loader_set_error_function(&bl.error_callback, NULL, NULL); @@ -164,7 +164,7 @@ static int write_dbfile (char *tf_template, int n, char *output_name, bool expec toku_set_func_malloc_only(NULL); toku_set_func_realloc_only(NULL); - ft_loader_set_os_fwrite(NULL); + toku_set_func_fwrite(nullptr); toku_set_func_write(NULL); toku_set_func_pwrite(NULL); diff --git a/storage/tokudb/PerconaFT/ft/tests/log-test4.cc b/storage/tokudb/PerconaFT/ft/tests/log-test4.cc index a31181deb30..e0bbedb95bf 100644 --- a/storage/tokudb/PerconaFT/ft/tests/log-test4.cc +++ b/storage/tokudb/PerconaFT/ft/tests/log-test4.cc @@ -63,11 +63,14 @@ test_main (int argc __attribute__((__unused__)), r = toku_logger_close(&logger); assert(r == 0); { - toku_struct_stat statbuf; - sprintf(logname, "%s/log000000000000.tokulog%d", TOKU_TEST_FILENAME, TOKU_LOG_VERSION); - r = toku_stat(logname, &statbuf); - assert(r==0); - assert(statbuf.st_size==12+5); + toku_struct_stat statbuf; + sprintf(logname, + "%s/log000000000000.tokulog%d", + TOKU_TEST_FILENAME, + TOKU_LOG_VERSION); + r = toku_stat(logname, &statbuf, toku_uninstrumented); + assert(r == 0); + assert(statbuf.st_size == 12 + 5); } toku_os_recursive_delete(TOKU_TEST_FILENAME); return 0; diff --git a/storage/tokudb/PerconaFT/ft/tests/log-test5.cc b/storage/tokudb/PerconaFT/ft/tests/log-test5.cc index d4e31af22dc..fed9467a4ae 100644 --- a/storage/tokudb/PerconaFT/ft/tests/log-test5.cc +++ b/storage/tokudb/PerconaFT/ft/tests/log-test5.cc @@ -81,14 +81,14 @@ test_main (int argc __attribute__((__unused__)), struct dirent *dirent; while ((dirent=readdir(dir))) { if (strncmp(dirent->d_name, "log", 3)!=0) continue; - char fname[TOKU_PATH_MAX+1]; - toku_path_join(fname, 2, TOKU_TEST_FILENAME, dirent->d_name); - toku_struct_stat statbuf; - r = toku_stat(fname, &statbuf); - assert(r==0); - assert(statbuf.st_size<=LSIZE+10); - } - r = closedir(dir); + char fname[TOKU_PATH_MAX + 1]; + toku_path_join(fname, 2, TOKU_TEST_FILENAME, dirent->d_name); + toku_struct_stat statbuf; + r = toku_stat(fname, &statbuf, toku_uninstrumented); + assert(r == 0); + assert(statbuf.st_size <= LSIZE + 10); + } + r = closedir(dir); assert(r==0); } toku_os_recursive_delete(TOKU_TEST_FILENAME); diff --git a/storage/tokudb/PerconaFT/ft/tests/log-test6.cc b/storage/tokudb/PerconaFT/ft/tests/log-test6.cc index 4d17488c57c..0e8b94566df 100644 --- a/storage/tokudb/PerconaFT/ft/tests/log-test6.cc +++ b/storage/tokudb/PerconaFT/ft/tests/log-test6.cc @@ -86,11 +86,14 @@ test_main (int argc __attribute__((__unused__)), { char logname[PATH_MAX]; - toku_struct_stat statbuf; - sprintf(logname, "%s/log000000000000.tokulog%d", TOKU_TEST_FILENAME, TOKU_LOG_VERSION); - r = toku_stat(logname, &statbuf); - assert(r==0); - assert(statbuf.st_size<=LSIZE); + toku_struct_stat statbuf; + sprintf(logname, + "%s/log000000000000.tokulog%d", + TOKU_TEST_FILENAME, + TOKU_LOG_VERSION); + r = toku_stat(logname, &statbuf, toku_uninstrumented); + assert(r == 0); + assert(statbuf.st_size <= LSIZE); } toku_os_recursive_delete(TOKU_TEST_FILENAME); return 0; diff --git a/storage/tokudb/PerconaFT/ft/tests/recovery-bad-last-entry.cc b/storage/tokudb/PerconaFT/ft/tests/recovery-bad-last-entry.cc index 431ee4b5e50..a3c934d1f4b 100644 --- a/storage/tokudb/PerconaFT/ft/tests/recovery-bad-last-entry.cc +++ b/storage/tokudb/PerconaFT/ft/tests/recovery-bad-last-entry.cc @@ -83,11 +83,16 @@ run_test(void) { r = toku_dup2(devnul, fileno(stderr)); assert(r==fileno(stderr)); r = close(devnul); assert(r==0); - char fname[TOKU_PATH_MAX+1]; - sprintf(fname, "%s/%s%d", TOKU_TEST_FILENAME, "log000000000000.tokulog", TOKU_LOG_VERSION); - - r = toku_stat(fname, &st); assert(r==0); - if ( st.st_size - trim > magic_begin_end_checkpoint_sz ) { + char fname[TOKU_PATH_MAX + 1]; + sprintf(fname, + "%s/%s%d", + TOKU_TEST_FILENAME, + "log000000000000.tokulog", + TOKU_LOG_VERSION); + + r = toku_stat(fname, &st, toku_uninstrumented); + assert(r == 0); + if (st.st_size - trim > magic_begin_end_checkpoint_sz) { r = truncate(fname, st.st_size - trim); CKERR(r); } diff --git a/storage/tokudb/PerconaFT/ft/tests/test-bjm.cc b/storage/tokudb/PerconaFT/ft/tests/test-bjm.cc index 97e00c42b95..6afe5b9f7c4 100644 --- a/storage/tokudb/PerconaFT/ft/tests/test-bjm.cc +++ b/storage/tokudb/PerconaFT/ft/tests/test-bjm.cc @@ -71,12 +71,16 @@ static void bjm_test(void) { bjm_reset(bjm); r = bjm_add_background_job(bjm); - assert_zero(r); - toku_pthread_t tid; - r = toku_pthread_create(&tid, NULL, finish_bjm, NULL); assert_zero(r); - usleep(2*1024*1024); - // should return non-zero because tid is waiting + toku_pthread_t tid; + r = toku_pthread_create(toku_uninstrumented, + &tid, + nullptr, + finish_bjm, + nullptr); + assert_zero(r); + usleep(2 * 1024 * 1024); + // should return non-zero because tid is waiting // for background jobs to finish r = bjm_add_background_job(bjm); assert(r != 0); diff --git a/storage/tokudb/PerconaFT/ft/tests/test-checkpoint-during-flush.cc b/storage/tokudb/PerconaFT/ft/tests/test-checkpoint-during-flush.cc index 3e5d9bba817..06a26614885 100644 --- a/storage/tokudb/PerconaFT/ft/tests/test-checkpoint-during-flush.cc +++ b/storage/tokudb/PerconaFT/ft/tests/test-checkpoint-during-flush.cc @@ -113,10 +113,14 @@ static void flusher_callback(int state, void* extra) { if ((state == flt_flush_before_child_pin && !after_child_pin) || (state == ft_flush_aflter_child_pin && after_child_pin)) { checkpoint_called = true; - int r = toku_pthread_create(&checkpoint_tid, NULL, do_checkpoint, NULL); + int r = toku_pthread_create(toku_uninstrumented, + &checkpoint_tid, + nullptr, + do_checkpoint, + nullptr); assert_zero(r); while (!checkpoint_callback_called) { - usleep(1*1024*1024); + usleep(1 * 1024 * 1024); } } } diff --git a/storage/tokudb/PerconaFT/ft/tests/test-checkpoint-during-merge.cc b/storage/tokudb/PerconaFT/ft/tests/test-checkpoint-during-merge.cc index cb316127ef7..1029dfef320 100644 --- a/storage/tokudb/PerconaFT/ft/tests/test-checkpoint-during-merge.cc +++ b/storage/tokudb/PerconaFT/ft/tests/test-checkpoint-during-merge.cc @@ -103,10 +103,14 @@ static void flusher_callback(int state, void* extra) { } if (state == desired_state) { checkpoint_called = true; - int r = toku_pthread_create(&checkpoint_tid, NULL, do_checkpoint, NULL); + int r = toku_pthread_create(toku_uninstrumented, + &checkpoint_tid, + nullptr, + do_checkpoint, + nullptr); assert_zero(r); while (!checkpoint_callback_called) { - usleep(1*1024*1024); + usleep(1 * 1024 * 1024); } } } diff --git a/storage/tokudb/PerconaFT/ft/tests/test-checkpoint-during-rebalance.cc b/storage/tokudb/PerconaFT/ft/tests/test-checkpoint-during-rebalance.cc index 5f8485ac4ec..208ebe3ca31 100644 --- a/storage/tokudb/PerconaFT/ft/tests/test-checkpoint-during-rebalance.cc +++ b/storage/tokudb/PerconaFT/ft/tests/test-checkpoint-during-rebalance.cc @@ -103,10 +103,14 @@ static void flusher_callback(int state, void* extra) { } if (state == desired_state) { checkpoint_called = true; - int r = toku_pthread_create(&checkpoint_tid, NULL, do_checkpoint, NULL); + int r = toku_pthread_create(toku_uninstrumented, + &checkpoint_tid, + nullptr, + do_checkpoint, + nullptr); assert_zero(r); while (!checkpoint_callback_called) { - usleep(1*1024*1024); + usleep(1 * 1024 * 1024); } } } diff --git a/storage/tokudb/PerconaFT/ft/tests/test-checkpoint-during-split.cc b/storage/tokudb/PerconaFT/ft/tests/test-checkpoint-during-split.cc index 70c3ba22a0c..2b29de409b1 100644 --- a/storage/tokudb/PerconaFT/ft/tests/test-checkpoint-during-split.cc +++ b/storage/tokudb/PerconaFT/ft/tests/test-checkpoint-during-split.cc @@ -113,10 +113,14 @@ static void flusher_callback(int state, void* extra) { if ((state == flt_flush_before_split && !after_split) || (state == flt_flush_during_split && after_split)) { checkpoint_called = true; - int r = toku_pthread_create(&checkpoint_tid, NULL, do_checkpoint, NULL); + int r = toku_pthread_create(toku_uninstrumented, + &checkpoint_tid, + nullptr, + do_checkpoint, + nullptr); assert_zero(r); while (!checkpoint_callback_called) { - usleep(1*1024*1024); + usleep(1 * 1024 * 1024); } } } diff --git a/storage/tokudb/PerconaFT/ft/tests/test3681.cc b/storage/tokudb/PerconaFT/ft/tests/test3681.cc index e5e24a88246..9e4a46e8dfe 100644 --- a/storage/tokudb/PerconaFT/ft/tests/test3681.cc +++ b/storage/tokudb/PerconaFT/ft/tests/test3681.cc @@ -91,13 +91,35 @@ static void *startb (void *n) { return NULL; } -static void test3681 (void) { +static void test3681(void) { setup(); - toku_pthread_t a,b; - { int r; r = toku_pthread_create(&a, NULL, starta, NULL); assert(r==0); } - { int r; r = toku_pthread_create(&b, NULL, startb, NULL); assert(r==0); } - { int r; void *v; r = toku_pthread_join(a, &v); assert(r==0); assert(v==NULL); } - { int r; void *v; r = toku_pthread_join(b, &v); assert(r==0); assert(v==NULL); } + toku_pthread_t a, b; + { + int r; + r = toku_pthread_create( + toku_uninstrumented, &a, nullptr, starta, nullptr); + assert(r == 0); + } + { + int r; + r = toku_pthread_create( + toku_uninstrumented, &b, nullptr, startb, nullptr); + assert(r == 0); + } + { + int r; + void *v; + r = toku_pthread_join(a, &v); + assert(r == 0); + assert(v == NULL); + } + { + int r; + void *v; + r = toku_pthread_join(b, &v); + assert(r == 0); + assert(v == NULL); + } finish(); } |