Commit aca05578 authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul Committed by Yoni Fogel

Tell helgrind not to complain about the toku_checkpointing_user_status. Refs #2684. [t:2684]

git-svn-id: file:///svn/toku/tokudb@20879 c7de825b-a66e-492c-adef-691d508d4ae1
parent 7b7c3748
...@@ -2176,8 +2176,14 @@ toku_cachetable_begin_checkpoint (CACHETABLE ct, TOKULOGGER logger) { ...@@ -2176,8 +2176,14 @@ toku_cachetable_begin_checkpoint (CACHETABLE ct, TOKULOGGER logger) {
// This is used by the cachetable_race test. // This is used by the cachetable_race test.
extern int toku_checkpointing_user_data_status __attribute__((__visibility__("default"))); extern int get_toku_checkpointing_user_data_status(void) __attribute__((__visibility__("default")));
int toku_checkpointing_user_data_status = 0; static volatile int toku_checkpointing_user_data_status = 0;
static void set_toku_checkpointing_user_data_status (int v) {
toku_checkpointing_user_data_status = v;
}
int get_toku_checkpointing_user_data_status (void) {
return toku_checkpointing_user_data_status;
}
int int
toku_cachetable_end_checkpoint(CACHETABLE ct, TOKULOGGER logger, toku_cachetable_end_checkpoint(CACHETABLE ct, TOKULOGGER logger,
...@@ -2217,9 +2223,9 @@ toku_cachetable_end_checkpoint(CACHETABLE ct, TOKULOGGER logger, ...@@ -2217,9 +2223,9 @@ toku_cachetable_end_checkpoint(CACHETABLE ct, TOKULOGGER logger,
assert(ct->lsn_of_checkpoint_in_progress.lsn >= cf->most_recent_global_checkpoint_that_finished_early.lsn); assert(ct->lsn_of_checkpoint_in_progress.lsn >= cf->most_recent_global_checkpoint_that_finished_early.lsn);
cachetable_unlock(ct); cachetable_unlock(ct);
assert(cf->checkpoint_state == CS_CALLED_BEGIN_CHECKPOINT); assert(cf->checkpoint_state == CS_CALLED_BEGIN_CHECKPOINT);
toku_checkpointing_user_data_status = 1; set_toku_checkpointing_user_data_status(1);
int r = cf->checkpoint_userdata(cf, cf->fd, cf->userdata); int r = cf->checkpoint_userdata(cf, cf->fd, cf->userdata);
toku_checkpointing_user_data_status = 0; set_toku_checkpointing_user_data_status(0);
assert(r==0); assert(r==0);
cf->checkpoint_state = CS_CALLED_CHECKPOINT; cf->checkpoint_state = CS_CALLED_CHECKPOINT;
cachetable_lock(ct); cachetable_lock(ct);
......
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
toku_test_db_redirect_dictionary; toku_test_db_redirect_dictionary;
toku_test_get_latest_lsn; toku_test_get_latest_lsn;
toku_checkpointing_user_data_status; get_toku_checkpointing_user_data_status;
local: *; local: *;
}; };
......
...@@ -32,7 +32,7 @@ enum {NUM_DBS=5}; ...@@ -32,7 +32,7 @@ enum {NUM_DBS=5};
char *free_me = NULL; char *free_me = NULL;
char *env_dir = ENVDIR; // the default env_dir. char *env_dir = ENVDIR; // the default env_dir.
static void run_test(void) static void run_cachetable_race_test(void)
{ {
int r; int r;
{ {
...@@ -71,11 +71,11 @@ static void run_test(void) ...@@ -71,11 +71,11 @@ static void run_test(void)
dbs[i] = NULL; dbs[i] = NULL;
if (i==2) { if (i==2) {
extern int toku_checkpointing_user_data_status; extern int get_toku_checkpointing_user_data_status(void);
if (verbose) printf("%s:%d c=%d\n", __FILE__, __LINE__, toku_checkpointing_user_data_status); if (verbose) printf("%s:%d c=%d\n", __FILE__, __LINE__, get_toku_checkpointing_user_data_status());
while (toku_checkpointing_user_data_status==0) while (get_toku_checkpointing_user_data_status()==0)
sched_yield(); sched_yield();
if (verbose) printf("%s:%d c=%d\n", __FILE__, __LINE__, toku_checkpointing_user_data_status); if (verbose) printf("%s:%d c=%d\n", __FILE__, __LINE__, get_toku_checkpointing_user_data_status());
} }
} }
r = env->close(env, 0); CKERR(r); r = env->close(env, 0); CKERR(r);
...@@ -87,7 +87,7 @@ static void do_args(int argc, char * const argv[]); ...@@ -87,7 +87,7 @@ static void do_args(int argc, char * const argv[]);
int test_main(int argc, char * const *argv) { int test_main(int argc, char * const *argv) {
do_args(argc, argv); do_args(argc, argv);
run_test(); run_cachetable_race_test();
if (free_me) toku_free(free_me); if (free_me) toku_free(free_me);
return 0; return 0;
......
...@@ -3,3 +3,13 @@ ...@@ -3,3 +3,13 @@
Helgrind:Race Helgrind:Race
fun:mythread_wrapper fun:mythread_wrapper
} }
{
ignore_race_on_toku_checkpointing_user_data_status
Helgrind:Race
fun:set_toku_checkpointing_user_data_status.*
}
{
ignore_race_on_toku_checkpointing_user_data_status
Helgrind:Race
fun:get_toku_checkpointing_user_data_status
}
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