Commit c3a0afea authored by Leif Walsh's avatar Leif Walsh Committed by Yoni Fogel

refs #5368 unify race detection tool annotations in <toku_race_tools.h>


git-svn-id: file:///svn/toku/tokudb@48361 c7de825b-a66e-492c-adef-691d508d4ae1
parent 75379294
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include <string.h> #include <string.h>
#include <time.h> #include <time.h>
#include <stdarg.h> #include <stdarg.h>
#include <valgrind/helgrind.h> #include <toku_race_tools.h>
#include "memory.h" #include "memory.h"
#include "cachetable.h" #include "cachetable.h"
#include "rwlock.h" #include "rwlock.h"
...@@ -3021,7 +3021,7 @@ ENSURE_POD(cleaner); ...@@ -3021,7 +3021,7 @@ ENSURE_POD(cleaner);
void cleaner::init(uint32_t _cleaner_iterations, pair_list* _pl, CACHETABLE _ct) { void cleaner::init(uint32_t _cleaner_iterations, pair_list* _pl, CACHETABLE _ct) {
// default is no cleaner, for now // default is no cleaner, for now
toku_minicron_setup(&m_cleaner_cron, 0, toku_cleaner_thread, this); toku_minicron_setup(&m_cleaner_cron, 0, toku_cleaner_thread, this);
HELGRIND_VALGRIND_HG_DISABLE_CHECKING(&m_cleaner_iterations, sizeof m_cleaner_iterations); TOKU_VALGRIND_HG_DISABLE_CHECKING(&m_cleaner_iterations, sizeof m_cleaner_iterations);
m_cleaner_iterations = _cleaner_iterations; m_cleaner_iterations = _cleaner_iterations;
m_pl = _pl; m_pl = _pl;
m_ct = _ct; m_ct = _ct;
...@@ -3529,9 +3529,9 @@ static void *eviction_thread(void *evictor_v) { ...@@ -3529,9 +3529,9 @@ static void *eviction_thread(void *evictor_v) {
// and initializes all counters and condition variables. // and initializes all counters and condition variables.
// //
void evictor::init(long _size_limit, pair_list* _pl, KIBBUTZ _kibbutz, uint32_t eviction_period) { void evictor::init(long _size_limit, pair_list* _pl, KIBBUTZ _kibbutz, uint32_t eviction_period) {
HELGRIND_VALGRIND_HG_DISABLE_CHECKING(&m_ev_thread_is_running, sizeof m_ev_thread_is_running); TOKU_VALGRIND_HG_DISABLE_CHECKING(&m_ev_thread_is_running, sizeof m_ev_thread_is_running);
HELGRIND_VALGRIND_HG_DISABLE_CHECKING(&m_size_current, sizeof m_size_current); TOKU_VALGRIND_HG_DISABLE_CHECKING(&m_size_current, sizeof m_size_current);
HELGRIND_VALGRIND_HG_DISABLE_CHECKING(&m_size_evicting, sizeof m_size_evicting); TOKU_VALGRIND_HG_DISABLE_CHECKING(&m_size_evicting, sizeof m_size_evicting);
m_low_size_watermark = _size_limit; m_low_size_watermark = _size_limit;
// these values are selected kind of arbitrarily right now as // these values are selected kind of arbitrarily right now as
...@@ -4473,13 +4473,13 @@ void cachefile_list::write_unlock() { ...@@ -4473,13 +4473,13 @@ void cachefile_list::write_unlock() {
void __attribute__((__constructor__)) toku_cachetable_helgrind_ignore(void); void __attribute__((__constructor__)) toku_cachetable_helgrind_ignore(void);
void void
toku_cachetable_helgrind_ignore(void) { toku_cachetable_helgrind_ignore(void) {
HELGRIND_VALGRIND_HG_DISABLE_CHECKING(&cachetable_miss, sizeof cachetable_miss); TOKU_VALGRIND_HG_DISABLE_CHECKING(&cachetable_miss, sizeof cachetable_miss);
HELGRIND_VALGRIND_HG_DISABLE_CHECKING(&cachetable_misstime, sizeof cachetable_misstime); TOKU_VALGRIND_HG_DISABLE_CHECKING(&cachetable_misstime, sizeof cachetable_misstime);
HELGRIND_VALGRIND_HG_DISABLE_CHECKING(&cachetable_puts, sizeof cachetable_puts); TOKU_VALGRIND_HG_DISABLE_CHECKING(&cachetable_puts, sizeof cachetable_puts);
HELGRIND_VALGRIND_HG_DISABLE_CHECKING(&cachetable_prefetches, sizeof cachetable_prefetches); TOKU_VALGRIND_HG_DISABLE_CHECKING(&cachetable_prefetches, sizeof cachetable_prefetches);
HELGRIND_VALGRIND_HG_DISABLE_CHECKING(&cachetable_evictions, sizeof cachetable_evictions); TOKU_VALGRIND_HG_DISABLE_CHECKING(&cachetable_evictions, sizeof cachetable_evictions);
HELGRIND_VALGRIND_HG_DISABLE_CHECKING(&cleaner_executions, sizeof cleaner_executions); TOKU_VALGRIND_HG_DISABLE_CHECKING(&cleaner_executions, sizeof cleaner_executions);
HELGRIND_VALGRIND_HG_DISABLE_CHECKING(&ct_status, sizeof ct_status); TOKU_VALGRIND_HG_DISABLE_CHECKING(&ct_status, sizeof ct_status);
} }
#undef STATUS_VALUE #undef STATUS_VALUE
...@@ -273,13 +273,13 @@ toku_checkpoint(CHECKPOINTER cp, TOKULOGGER logger, ...@@ -273,13 +273,13 @@ toku_checkpoint(CHECKPOINTER cp, TOKULOGGER logger,
return r; return r;
} }
#include <valgrind/helgrind.h> #include <toku_race_tools.h>
void __attribute__((__constructor__)) toku_checkpoint_helgrind_ignore(void); void __attribute__((__constructor__)) toku_checkpoint_helgrind_ignore(void);
void void
toku_checkpoint_helgrind_ignore(void) { toku_checkpoint_helgrind_ignore(void) {
HELGRIND_VALGRIND_HG_DISABLE_CHECKING(&cp_status, sizeof cp_status); TOKU_VALGRIND_HG_DISABLE_CHECKING(&cp_status, sizeof cp_status);
HELGRIND_VALGRIND_HG_DISABLE_CHECKING(&locked_mo, sizeof locked_mo); TOKU_VALGRIND_HG_DISABLE_CHECKING(&locked_mo, sizeof locked_mo);
HELGRIND_VALGRIND_HG_DISABLE_CHECKING(&locked_cs, sizeof locked_cs); TOKU_VALGRIND_HG_DISABLE_CHECKING(&locked_cs, sizeof locked_cs);
} }
#undef SET_CHECKPOINT_FOOTPRINT #undef SET_CHECKPOINT_FOOTPRINT
......
...@@ -1869,11 +1869,11 @@ flush_node_on_background_thread(FT h, FTNODE parent) ...@@ -1869,11 +1869,11 @@ flush_node_on_background_thread(FT h, FTNODE parent)
} }
} }
#include <valgrind/helgrind.h> #include <toku_race_tools.h>
void __attribute__((__constructor__)) toku_ft_flusher_helgrind_ignore(void); void __attribute__((__constructor__)) toku_ft_flusher_helgrind_ignore(void);
void void
toku_ft_flusher_helgrind_ignore(void) { toku_ft_flusher_helgrind_ignore(void) {
HELGRIND_VALGRIND_HG_DISABLE_CHECKING(&ft_flusher_status, sizeof ft_flusher_status); TOKU_VALGRIND_HG_DISABLE_CHECKING(&ft_flusher_status, sizeof ft_flusher_status);
} }
#undef STATUS_VALUE #undef STATUS_VALUE
...@@ -361,12 +361,12 @@ toku_ft_hot_optimize(FT_HANDLE brt, ...@@ -361,12 +361,12 @@ toku_ft_hot_optimize(FT_HANDLE brt,
return r; return r;
} }
#include <valgrind/helgrind.h> #include <toku_race_tools.h>
void __attribute__((__constructor__)) toku_hot_helgrind_ignore(void); void __attribute__((__constructor__)) toku_hot_helgrind_ignore(void);
void void
toku_hot_helgrind_ignore(void) { toku_hot_helgrind_ignore(void) {
// incremented only while lock is held, but read by engine status asynchronously. // incremented only while lock is held, but read by engine status asynchronously.
HELGRIND_VALGRIND_HG_DISABLE_CHECKING(&hot_status, sizeof hot_status); TOKU_VALGRIND_HG_DISABLE_CHECKING(&hot_status, sizeof hot_status);
} }
......
...@@ -125,7 +125,7 @@ basement nodes, bulk fetch, and partial fetch: ...@@ -125,7 +125,7 @@ basement nodes, bulk fetch, and partial fetch:
#include "sort-tmpl.h" #include "sort-tmpl.h"
#include <ft-cachetable-wrappers.h> #include <ft-cachetable-wrappers.h>
#include <ft-flusher.h> #include <ft-flusher.h>
#include <valgrind/helgrind.h> #include <toku_race_tools.h>
#include "txn_manager.h" #include "txn_manager.h"
#include "partitioned_counter.h" #include "partitioned_counter.h"
...@@ -5617,11 +5617,11 @@ int toku_ft_strerror_r(int error, char *buf, size_t buflen) ...@@ -5617,11 +5617,11 @@ int toku_ft_strerror_r(int error, char *buf, size_t buflen)
} }
} }
#include <valgrind/helgrind.h> #include <toku_race_tools.h>
void __attribute__((__constructor__)) toku_ft_helgrind_ignore(void); void __attribute__((__constructor__)) toku_ft_helgrind_ignore(void);
void void
toku_ft_helgrind_ignore(void) { toku_ft_helgrind_ignore(void) {
HELGRIND_VALGRIND_HG_DISABLE_CHECKING(&ft_status, sizeof ft_status); TOKU_VALGRIND_HG_DISABLE_CHECKING(&ft_status, sizeof ft_status);
} }
#undef STATUS_INC #undef STATUS_INC
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it." #ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
#include <toku_portability.h> #include <toku_portability.h>
#include <valgrind/drd.h> #include <toku_race_tools.h>
#include <stdint.h> #include <stdint.h>
#include "memory.h" #include "memory.h"
#include "growable_array.h" #include "growable_array.h"
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#ident "$Id$" #ident "$Id$"
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved." #ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it." #ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
#include <valgrind/helgrind.h> #include <toku_race_tools.h>
#include <sys/types.h> #include <sys/types.h>
#include <pthread.h> #include <pthread.h>
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
#include <string.h> #include <string.h>
#include <sys/time.h> #include <sys/time.h>
#include <unistd.h> #include <unistd.h>
#include <valgrind/helgrind.h> #include <toku_race_tools.h>
#include "toku_assert.h" #include "toku_assert.h"
#include "partitioned_counter.h" #include "partitioned_counter.h"
#include "memory.h" #include "memory.h"
...@@ -97,7 +97,7 @@ static void destroy_counter (void *counterp) ...@@ -97,7 +97,7 @@ static void destroy_counter (void *counterp)
counter.next->prev = counter.prev; counter.next->prev = counter.prev;
} }
finished_counter += counter.counter; finished_counter += counter.counter;
HELGRIND_VALGRIND_HG_ENABLE_CHECKING(&counter.counter, sizeof(counter.counter)); // stop ignoring races TOKU_VALGRIND_HG_ENABLE_CHECKING(&counter.counter, sizeof(counter.counter)); // stop ignoring races
//printf("finished counter now %d\n", finished_counter); //printf("finished counter now %d\n", finished_counter);
pc_unlock(); pc_unlock();
} }
...@@ -121,7 +121,7 @@ static inline void increment (void) { ...@@ -121,7 +121,7 @@ static inline void increment (void) {
cp->counter = 0; cp->counter = 0;
cp->inited = true; cp->inited = true;
cp->myid = idcounter++; cp->myid = idcounter++;
HELGRIND_VALGRIND_HG_DISABLE_CHECKING(&counter.counter, sizeof(counter.counter)); // the counter increment is kind of racy. TOKU_VALGRIND_HG_DISABLE_CHECKING(&counter.counter, sizeof(counter.counter)); // the counter increment is kind of racy.
pc_unlock(); pc_unlock();
} }
counter.counter++; counter.counter++;
...@@ -360,7 +360,7 @@ static void do_testit2 (void) ...@@ -360,7 +360,7 @@ static void do_testit2 (void)
// A thread increments the counter, then lets us know through a spin wait, then waits until we destroy the counter. // A thread increments the counter, then lets us know through a spin wait, then waits until we destroy the counter.
{ {
pthread_t t; pthread_t t;
HELGRIND_VALGRIND_HG_DISABLE_CHECKING(&spinwait, sizeof(spinwait)); // this is a racy volatile variable. TOKU_VALGRIND_HG_DISABLE_CHECKING(&spinwait, sizeof(spinwait)); // this is a racy volatile variable.
{ {
PARTITIONED_COUNTER mypc = create_partitioned_counter(); PARTITIONED_COUNTER mypc = create_partitioned_counter();
increment_partitioned_counter(mypc, 1); // make sure that the long-lived thread also increments the partitioned counter, to test for #5321. increment_partitioned_counter(mypc, 1); // make sure that the long-lived thread also increments the partitioned counter, to test for #5321.
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include "txn.h" #include "txn.h"
#include "checkpoint.h" #include "checkpoint.h"
#include "ule.h" #include "ule.h"
#include <valgrind/helgrind.h> #include <toku_race_tools.h>
#include "rollback-apply.h" #include "rollback-apply.h"
#include "txn_manager.h" #include "txn_manager.h"
...@@ -107,7 +107,7 @@ void toku_txn_set_container_db_txn (TOKUTXN tokutxn, DB_TXN*container) { ...@@ -107,7 +107,7 @@ void toku_txn_set_container_db_txn (TOKUTXN tokutxn, DB_TXN*container) {
} }
static void invalidate_xa_xid (TOKU_XA_XID *xid) { static void invalidate_xa_xid (TOKU_XA_XID *xid) {
HELGRIND_ANNOTATE_NEW_MEMORY(xid, sizeof(*xid)); // consider it to be all invalid for valgrind TOKU_ANNOTATE_NEW_MEMORY(xid, sizeof(*xid)); // consider it to be all invalid for valgrind
xid->formatID = -1; // According to the XA spec, -1 means "invalid data" xid->formatID = -1; // According to the XA spec, -1 means "invalid data"
} }
...@@ -323,7 +323,7 @@ int toku_txn_abort_with_lsn(TOKUTXN txn, LSN oplsn, ...@@ -323,7 +323,7 @@ int toku_txn_abort_with_lsn(TOKUTXN txn, LSN oplsn,
} }
static void copy_xid (TOKU_XA_XID *dest, TOKU_XA_XID *source) { static void copy_xid (TOKU_XA_XID *dest, TOKU_XA_XID *source) {
HELGRIND_ANNOTATE_NEW_MEMORY(dest, sizeof(*dest)); TOKU_ANNOTATE_NEW_MEMORY(dest, sizeof(*dest));
dest->formatID = source->formatID; dest->formatID = source->formatID;
dest->gtrid_length = source->gtrid_length; dest->gtrid_length = source->gtrid_length;
dest->bqual_length = source->bqual_length; dest->bqual_length = source->bqual_length;
...@@ -501,11 +501,11 @@ toku_txn_is_read_only(TOKUTXN txn) { ...@@ -501,11 +501,11 @@ toku_txn_is_read_only(TOKUTXN txn) {
return false; return false;
} }
#include <valgrind/helgrind.h> #include <toku_race_tools.h>
void __attribute__((__constructor__)) toku_txn_status_helgrind_ignore(void); void __attribute__((__constructor__)) toku_txn_status_helgrind_ignore(void);
void void
toku_txn_status_helgrind_ignore(void) { toku_txn_status_helgrind_ignore(void) {
HELGRIND_VALGRIND_HG_DISABLE_CHECKING(&txn_status, sizeof txn_status); TOKU_VALGRIND_HG_DISABLE_CHECKING(&txn_status, sizeof txn_status);
} }
#undef STATUS_VALUE #undef STATUS_VALUE
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include "txn.h" #include "txn.h"
#include "checkpoint.h" #include "checkpoint.h"
#include "ule.h" #include "ule.h"
#include <valgrind/helgrind.h> #include <toku_race_tools.h>
#include "txn_manager.h" #include "txn_manager.h"
#include "omt-tmpl.h" #include "omt-tmpl.h"
#include "rollback.h" #include "rollback.h"
...@@ -614,7 +614,7 @@ void toku_txn_manager_add_prepared_txn(TXN_MANAGER txn_manager, TOKUTXN txn) { ...@@ -614,7 +614,7 @@ void toku_txn_manager_add_prepared_txn(TXN_MANAGER txn_manager, TOKUTXN txn) {
} }
static void invalidate_xa_xid (TOKU_XA_XID *xid) { static void invalidate_xa_xid (TOKU_XA_XID *xid) {
HELGRIND_ANNOTATE_NEW_MEMORY(xid, sizeof(*xid)); // consider it to be all invalid for valgrind TOKU_ANNOTATE_NEW_MEMORY(xid, sizeof(*xid)); // consider it to be all invalid for valgrind
xid->formatID = -1; // According to the XA spec, -1 means "invalid data" xid->formatID = -1; // According to the XA spec, -1 means "invalid data"
} }
......
...@@ -2310,11 +2310,11 @@ toku_le_upgrade_13_14(LEAFENTRY_13 old_leafentry, ...@@ -2310,11 +2310,11 @@ toku_le_upgrade_13_14(LEAFENTRY_13 old_leafentry,
return rval; return rval;
} }
#include <valgrind/helgrind.h> #include <toku_race_tools.h>
void __attribute__((__constructor__)) toku_ule_helgrind_ignore(void); void __attribute__((__constructor__)) toku_ule_helgrind_ignore(void);
void void
toku_ule_helgrind_ignore(void) { toku_ule_helgrind_ignore(void) {
HELGRIND_VALGRIND_HG_DISABLE_CHECKING(&le_status, sizeof le_status); TOKU_VALGRIND_HG_DISABLE_CHECKING(&le_status, sizeof le_status);
} }
#undef STATUS_VALUE #undef STATUS_VALUE
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
# include <sys/malloc.h> # include <sys/malloc.h>
#endif #endif
#include <dlfcn.h> #include <dlfcn.h>
#include <valgrind/helgrind.h> #include <toku_race_tools.h>
#include "memory.h" #include "memory.h"
#include "toku_assert.h" #include "toku_assert.h"
...@@ -147,7 +147,7 @@ void * ...@@ -147,7 +147,7 @@ void *
toku_malloc(size_t size) { toku_malloc(size_t size) {
void *p = t_malloc ? t_malloc(size) : os_malloc(size); void *p = t_malloc ? t_malloc(size) : os_malloc(size);
if (p) { if (p) {
HELGRIND_ANNOTATE_NEW_MEMORY(p, size); // see #4671 and https://bugs.kde.org/show_bug.cgi?id=297147 TOKU_ANNOTATE_NEW_MEMORY(p, size); // see #4671 and https://bugs.kde.org/show_bug.cgi?id=297147
if (toku_memory_do_stats) { if (toku_memory_do_stats) {
size_t used = my_malloc_usable_size(p); size_t used = my_malloc_usable_size(p);
__sync_add_and_fetch(&status.malloc_count, 1); __sync_add_and_fetch(&status.malloc_count, 1);
...@@ -225,7 +225,7 @@ toku_xmalloc(size_t size) { ...@@ -225,7 +225,7 @@ toku_xmalloc(size_t size) {
void *p = t_xmalloc ? t_xmalloc(size) : os_malloc(size); void *p = t_xmalloc ? t_xmalloc(size) : os_malloc(size);
if (p == NULL) // avoid function call in common case if (p == NULL) // avoid function call in common case
resource_assert(p); resource_assert(p);
HELGRIND_ANNOTATE_NEW_MEMORY(p, size); // see #4671 and https://bugs.kde.org/show_bug.cgi?id=297147 TOKU_ANNOTATE_NEW_MEMORY(p, size); // see #4671 and https://bugs.kde.org/show_bug.cgi?id=297147
if (toku_memory_do_stats) { if (toku_memory_do_stats) {
size_t used = my_malloc_usable_size(p); size_t used = my_malloc_usable_size(p);
__sync_add_and_fetch(&status.malloc_count, 1); __sync_add_and_fetch(&status.malloc_count, 1);
...@@ -316,9 +316,9 @@ toku_set_func_free(free_fun_t f) { ...@@ -316,9 +316,9 @@ toku_set_func_free(free_fun_t f) {
t_free = f; t_free = f;
} }
#include <valgrind/helgrind.h> #include <toku_race_tools.h>
void __attribute__((constructor)) toku_memory_helgrind_ignore(void); void __attribute__((constructor)) toku_memory_helgrind_ignore(void);
void void
toku_memory_helgrind_ignore(void) { toku_memory_helgrind_ignore(void) {
HELGRIND_VALGRIND_HG_DISABLE_CHECKING(&status, sizeof status); TOKU_VALGRIND_HG_DISABLE_CHECKING(&status, sizeof status);
} }
...@@ -65,7 +65,7 @@ get_waitstate(void) ...@@ -65,7 +65,7 @@ get_waitstate(void)
int r = toku_pthread_setspecific(waitstate_key, p); int r = toku_pthread_setspecific(waitstate_key, p);
assert_zero(r); assert_zero(r);
} }
waitstate = p; waitstate = static_cast<struct toku_cv_fair_rwlock_waiter_state *>(p);
return waitstate; return waitstate;
} }
......
...@@ -56,7 +56,7 @@ get_waitstate(void) ...@@ -56,7 +56,7 @@ get_waitstate(void)
int r = toku_pthread_setspecific(waitstate_key, p); int r = toku_pthread_setspecific(waitstate_key, p);
assert_zero(r); assert_zero(r);
} }
waitstate = p; waitstate = static_cast<struct toku_fair_rwlock_waiter_state *>(p);
return waitstate; return waitstate;
} }
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include <ft/ft-internal.h> #include <ft/ft-internal.h>
#include <toku_stdint.h> #include <toku_stdint.h>
#include <db.h> #include <db.h>
#include <valgrind/drd.h> #include <toku_race_tools.h>
/* TODO: Yoni should check that all asserts make sense instead of panic, /* TODO: Yoni should check that all asserts make sense instead of panic,
and all early returns make sense instead of panic, and all early returns make sense instead of panic,
...@@ -258,7 +258,7 @@ toku_ltm_create(toku_ltm** pmgr, ...@@ -258,7 +258,7 @@ toku_ltm_create(toku_ltm** pmgr,
assert(r == 0 && mgr->idlth); assert(r == 0 && mgr->idlth);
toku_mutex_init(&mgr->mutex, NULL); toku_mutex_init(&mgr->mutex, NULL);
DRD_IGNORE_VAR(mgr->status); TOKU_DRD_IGNORE_VAR(mgr->status);
r = 0; r = 0;
*pmgr = mgr; *pmgr = mgr;
cleanup: cleanup:
...@@ -296,7 +296,7 @@ toku_ltm_close(toku_ltm* mgr) { ...@@ -296,7 +296,7 @@ toku_ltm_close(toku_ltm* mgr) {
toku_lth_close(mgr->lth); toku_lth_close(mgr->lth);
toku_idlth_close(mgr->idlth); toku_idlth_close(mgr->idlth);
toku_mutex_destroy(&mgr->mutex); toku_mutex_destroy(&mgr->mutex);
DRD_STOP_IGNORING_VAR(mgr->status); TOKU_DRD_STOP_IGNORING_VAR(mgr->status);
assert(mgr->curr_locks == 0 && mgr->curr_lock_memory == 0); assert(mgr->curr_locks == 0 && mgr->curr_lock_memory == 0);
toku_free(mgr); toku_free(mgr);
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#elif defined(HAVE_SYS_MALLOC_H) #elif defined(HAVE_SYS_MALLOC_H)
# include <sys/malloc.h> # include <sys/malloc.h>
#endif #endif
#include <valgrind/drd.h> #include <toku_race_tools.h>
#include <math.h> #include <math.h>
#include "toku_random.h" #include "toku_random.h"
...@@ -1397,7 +1397,7 @@ static int run_workers( ...@@ -1397,7 +1397,7 @@ static int run_workers(
worker_extra[i].operation_lock = &rwlock; worker_extra[i].operation_lock = &rwlock;
worker_extra[i].operation_lock_mutex = &mutex; worker_extra[i].operation_lock_mutex = &mutex;
XCALLOC_N((int) NUM_OPERATION_TYPES, worker_extra[i].counters); XCALLOC_N((int) NUM_OPERATION_TYPES, worker_extra[i].counters);
DRD_IGNORE_VAR(worker_extra[i].counters); TOKU_DRD_IGNORE_VAR(worker_extra[i].counters);
{ int chk_r = toku_pthread_create(&tids[i], NULL, worker, &worker_extra[i]); CKERR(chk_r); } { int chk_r = toku_pthread_create(&tids[i], NULL, worker, &worker_extra[i]); CKERR(chk_r); }
if (verbose) if (verbose)
printf("%lu created\n", (unsigned long) tids[i]); printf("%lu created\n", (unsigned long) tids[i]);
......
...@@ -2719,9 +2719,9 @@ toku_test_get_checkpointing_user_data_status (void) { ...@@ -2719,9 +2719,9 @@ toku_test_get_checkpointing_user_data_status (void) {
#undef STATUS_VALUE #undef STATUS_VALUE
#undef PERSISTENT_UPGRADE_STATUS_VALUE #undef PERSISTENT_UPGRADE_STATUS_VALUE
#include <valgrind/helgrind.h> #include <toku_race_tools.h>
void __attribute__((constructor)) toku_ydb_helgrind_ignore(void); void __attribute__((constructor)) toku_ydb_helgrind_ignore(void);
void void
toku_ydb_helgrind_ignore(void) { toku_ydb_helgrind_ignore(void) {
HELGRIND_VALGRIND_HG_DISABLE_CHECKING(&ydb_layer_status, sizeof ydb_layer_status); TOKU_VALGRIND_HG_DISABLE_CHECKING(&ydb_layer_status, sizeof ydb_layer_status);
} }
...@@ -792,9 +792,9 @@ toku_db_cursor(DB *db, DB_TXN *txn, DBC **c, uint32_t flags) { ...@@ -792,9 +792,9 @@ toku_db_cursor(DB *db, DB_TXN *txn, DBC **c, uint32_t flags) {
#undef STATUS_VALUE #undef STATUS_VALUE
#include <valgrind/helgrind.h> #include <toku_race_tools.h>
void __attribute__((constructor)) toku_ydb_cursor_helgrind_ignore(void); void __attribute__((constructor)) toku_ydb_cursor_helgrind_ignore(void);
void void
toku_ydb_cursor_helgrind_ignore(void) { toku_ydb_cursor_helgrind_ignore(void) {
HELGRIND_VALGRIND_HG_DISABLE_CHECKING(&ydb_c_layer_status, sizeof ydb_c_layer_status); TOKU_VALGRIND_HG_DISABLE_CHECKING(&ydb_c_layer_status, sizeof ydb_c_layer_status);
} }
...@@ -1050,9 +1050,9 @@ locked_load_inames(DB_ENV * env, DB_TXN * txn, int N, DB * dbs[/*N*/], char * ne ...@@ -1050,9 +1050,9 @@ locked_load_inames(DB_ENV * env, DB_TXN * txn, int N, DB * dbs[/*N*/], char * ne
#undef STATUS_VALUE #undef STATUS_VALUE
#include <valgrind/helgrind.h> #include <toku_race_tools.h>
void __attribute__((constructor)) toku_ydb_db_helgrind_ignore(void); void __attribute__((constructor)) toku_ydb_db_helgrind_ignore(void);
void void
toku_ydb_db_helgrind_ignore(void) { toku_ydb_db_helgrind_ignore(void) {
HELGRIND_VALGRIND_HG_DISABLE_CHECKING(&ydb_db_layer_status, sizeof ydb_db_layer_status); TOKU_VALGRIND_HG_DISABLE_CHECKING(&ydb_db_layer_status, sizeof ydb_db_layer_status);
} }
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <ft/log_header.h> #include <ft/log_header.h>
#include "ydb_txn.h" #include "ydb_txn.h"
#include <lock_tree/lth.h> #include <lock_tree/lth.h>
#include <valgrind/helgrind.h> #include <toku_race_tools.h>
#include "ft/txn_manager.h" #include "ft/txn_manager.h"
static int static int
...@@ -225,7 +225,7 @@ toku_txn_xa_prepare (DB_TXN *txn, TOKU_XA_XID *xid) { ...@@ -225,7 +225,7 @@ toku_txn_xa_prepare (DB_TXN *txn, TOKU_XA_XID *xid) {
static int static int
toku_txn_prepare (DB_TXN *txn, uint8_t gid[DB_GID_SIZE]) { toku_txn_prepare (DB_TXN *txn, uint8_t gid[DB_GID_SIZE]) {
TOKU_XA_XID xid; TOKU_XA_XID xid;
HELGRIND_ANNOTATE_NEW_MEMORY(&xid, sizeof(xid)); TOKU_ANNOTATE_NEW_MEMORY(&xid, sizeof(xid));
xid.formatID=0x756b6f54; // "Toku" xid.formatID=0x756b6f54; // "Toku"
xid.gtrid_length=DB_GID_SIZE/2; // The maximum allowed gtrid length is 64. See the XA spec in source:/import/opengroup.org/C193.pdf page 20. xid.gtrid_length=DB_GID_SIZE/2; // The maximum allowed gtrid length is 64. See the XA spec in source:/import/opengroup.org/C193.pdf page 20.
xid.bqual_length=DB_GID_SIZE/2; // The maximum allowed bqual length is 64. xid.bqual_length=DB_GID_SIZE/2; // The maximum allowed bqual length is 64.
......
...@@ -898,9 +898,9 @@ toku_ydb_check_avail_fs_space(DB_ENV *env) { ...@@ -898,9 +898,9 @@ toku_ydb_check_avail_fs_space(DB_ENV *env) {
} }
#undef STATUS_VALUE #undef STATUS_VALUE
#include <valgrind/helgrind.h> #include <toku_race_tools.h>
void __attribute__((constructor)) toku_ydb_write_helgrind_ignore(void); void __attribute__((constructor)) toku_ydb_write_helgrind_ignore(void);
void void
toku_ydb_write_helgrind_ignore(void) { toku_ydb_write_helgrind_ignore(void) {
HELGRIND_VALGRIND_HG_DISABLE_CHECKING(&ydb_write_layer_status, sizeof ydb_write_layer_status); TOKU_VALGRIND_HG_DISABLE_CHECKING(&ydb_write_layer_status, sizeof ydb_write_layer_status);
} }
...@@ -122,19 +122,4 @@ void toku_memory_get_status(LOCAL_MEMORY_STATUS s); ...@@ -122,19 +122,4 @@ void toku_memory_get_status(LOCAL_MEMORY_STATUS s);
size_t toku_memory_footprint(void * p, size_t touched); size_t toku_memory_footprint(void * p, size_t touched);
#ifndef NVALGRIND
# define HELGRIND_ANNOTATE_NEW_MEMORY(p, size) ANNOTATE_NEW_MEMORY(p, size)
# define HELGRIND_VALGRIND_HG_ENABLE_CHECKING(p, size) VALGRIND_HG_ENABLE_CHECKING(p, size)
# define HELGRIND_VALGRIND_HG_DISABLE_CHECKING(p, size) VALGRIND_HG_DISABLE_CHECKING(p, size)
# define TOKU_DRD_IGNORE_VAR(v) DRD_IGNORE_VAR(v)
# define TOKU_DRD_STOP_IGNORING_VAR(v) DRD_STOP_IGNORING_VAR(v)
#else
# define HELGRIND_ANNOTATE_NEW_MEMORY(p, size) ((void) 0)
# define HELGRIND_VALGRIND_HG_ENABLE_CHECKING(p, size) ((void) 0)
# define HELGRIND_VALGRIND_HG_DISABLE_CHECKING(p, size) ((void) 0)
# define TOKU_DRD_IGNORE_VAR(v)
# define TOKU_DRD_STOP_IGNORING_VAR(v)
#endif
#endif #endif
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
#ident "$Id$"
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
#ifndef TOKU_RACE_TOOLS_H
#define TOKU_RACE_TOOLS_H
#include "config.h"
#if defined(__linux__) && !defined(NVALGRIND)
# include <valgrind/helgrind.h>
# include <valgrind/drd.h>
# define TOKU_ANNOTATE_NEW_MEMORY(p, size) ANNOTATE_NEW_MEMORY(p, size)
# define TOKU_VALGRIND_HG_ENABLE_CHECKING(p, size) VALGRIND_HG_ENABLE_CHECKING(p, size)
# define TOKU_VALGRIND_HG_DISABLE_CHECKING(p, size) VALGRIND_HG_DISABLE_CHECKING(p, size)
# define TOKU_DRD_IGNORE_VAR(v) DRD_IGNORE_VAR(v)
# define TOKU_DRD_STOP_IGNORING_VAR(v) DRD_STOP_IGNORING_VAR(v)
#else
# define TOKU_ANNOTATE_NEW_MEMORY(p, size) ((void) 0)
# define TOKU_VALGRIND_HG_ENABLE_CHECKING(p, size) ((void) 0)
# define TOKU_VALGRIND_HG_DISABLE_CHECKING(p, size) ((void) 0)
# define TOKU_DRD_IGNORE_VAR(v)
# define TOKU_DRD_STOP_IGNORING_VAR(v)
#endif
#endif // TOKU_RACE_TOOLS_H
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment