From 4662f1d8cc0c85091f97ffc28f37cda7b60b4e53 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sat, 9 Aug 2014 12:58:17 +0000 Subject: [PATCH] drd: Move VG_(getenv)("DRD_VERIFY_CONFLICT_SET") git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14249 --- drd/drd_main.c | 6 +++++- drd/drd_thread.c | 8 ++------ drd/drd_thread.h | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drd/drd_main.c b/drd/drd_main.c index 1a2060ba43..10630127a1 100644 --- a/drd/drd_main.c +++ b/drd/drd_main.c @@ -44,7 +44,7 @@ #include "pub_tool_libcassert.h" // tl_assert() #include "pub_tool_libcbase.h" // VG_(strcmp) #include "pub_tool_libcprint.h" // VG_(printf) -#include "pub_tool_libcproc.h" +#include "pub_tool_libcproc.h" // VG_(getenv)() #include "pub_tool_machine.h" #include "pub_tool_mallocfree.h" // VG_(malloc)(), VG_(free)() #include "pub_tool_options.h" // command line options @@ -883,6 +883,10 @@ void drd_pre_clo_init(void) if (smi) DRD_(thread_set_segment_merge_interval)(VG_(strtoll10)(smi, NULL)); } + + if (VG_(getenv)("DRD_VERIFY_CONFLICT_SET")) + DRD_(verify_conflict_set) = True; + } diff --git a/drd/drd_thread.c b/drd/drd_thread.c index 037659ceff..5e53a53f6c 100644 --- a/drd/drd_thread.c +++ b/drd/drd_thread.c @@ -36,7 +36,6 @@ #include "pub_tool_libcassert.h" // tl_assert() #include "pub_tool_libcbase.h" // VG_(strlen)() #include "pub_tool_libcprint.h" // VG_(printf)() -#include "pub_tool_libcproc.h" // VG_(getenv)() #include "pub_tool_machine.h" #include "pub_tool_mallocfree.h" // VG_(malloc)(), VG_(free)() #include "pub_tool_options.h" // VG_(clo_backtrace_size) @@ -68,7 +67,7 @@ static ThreadId s_vg_running_tid = VG_INVALID_THREADID; DrdThreadId DRD_(g_drd_running_tid) = DRD_INVALID_THREADID; ThreadInfo DRD_(g_threadinfo)[DRD_N_THREADS]; struct bitmap* DRD_(g_conflict_set); -int DRD_(verify_conflict_set) = -1; +Bool DRD_(verify_conflict_set); static Bool s_trace_context_switches = False; static Bool s_trace_conflict_set = False; static Bool s_trace_conflict_set_bm = False; @@ -1354,10 +1353,7 @@ static Bool thread_conflict_set_up_to_date(const DrdThreadId tid) Bool result; struct bitmap* computed_conflict_set = 0; - if (DRD_(verify_conflict_set) < 0) - DRD_(verify_conflict_set) = VG_(getenv)("DRD_VERIFY_CONFLICT_SET") != 0; - - if (DRD_(verify_conflict_set) == 0) + if (!DRD_(verify_conflict_set)) return True; thread_compute_conflict_set(&computed_conflict_set, tid); diff --git a/drd/drd_thread.h b/drd/drd_thread.h index 690133bcf0..d4899653a9 100644 --- a/drd/drd_thread.h +++ b/drd/drd_thread.h @@ -116,7 +116,7 @@ extern DrdThreadId DRD_(g_drd_running_tid); extern ThreadInfo DRD_(g_threadinfo)[DRD_N_THREADS]; /** Conflict set for the currently running thread. */ extern struct bitmap* DRD_(g_conflict_set); -extern int DRD_(verify_conflict_set); +extern Bool DRD_(verify_conflict_set); /* Function declarations. */ -- 2.47.2