]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
When analyzing Valgrind with drd, suppress uninteresting race reports on VG_(threads...
authorBart Van Assche <bvanassche@acm.org>
Thu, 8 Mar 2012 14:59:25 +0000 (14:59 +0000)
committerBart Van Assche <bvanassche@acm.org>
Thu, 8 Mar 2012 14:59:25 +0000 (14:59 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12432

coregrind/m_main.c
coregrind/m_threadstate.c
coregrind/pub_core_threadstate.h

index f1ec4a6ab15b98b28d6e54aa4bc2210bba22a64b..7bdb5bffdc770db75dc9c008ec4412f9e1f40781 100644 (file)
@@ -2003,6 +2003,8 @@ Int valgrind_main ( Int argc, HChar **argv, HChar **envp )
       VG_(printf_xml)( "\n" );
    }
 
+   VG_(init_Threads)();
+
    //--------------------------------------------------------------
    // Initialise the scheduler (phase 1) [generates tid_main]
    //   p: none, afaics
index d2f6acab4b88f45a4368b441d2ac0a91427feb80..fb5bba9d3950e286f095050bbf7dae508eae41a0 100644 (file)
 #include "pub_core_libcsetjmp.h"    // to keep _threadstate.h happy
 #include "pub_core_threadstate.h"
 #include "pub_core_libcassert.h"
+#include "pub_tool_inner.h"
+#if defined(ENABLE_INNER_CLIENT_REQUEST)
+#include "helgrind/helgrind.h"
+#include "drd/drd.h"
+#endif
 
 /*------------------------------------------------------------*/
 /*--- Data structures.                                     ---*/
@@ -46,6 +51,15 @@ ThreadState VG_(threads)[VG_N_THREADS];
 /*--- Operations.                                          ---*/
 /*------------------------------------------------------------*/
 
+void VG_(init_Threads)(void)
+{
+   ThreadId tid;
+
+   for (tid = 1; tid < VG_N_THREADS; tid++)
+      INNER_REQUEST(ANNOTATE_BENIGN_RACE_SIZED(&VG_(threads)[tid].status,
+                                        sizeof(VG_(threads)[tid].status), ""));
+}
+
 const HChar* VG_(name_of_ThreadStatus) ( ThreadStatus status )
 {
    switch (status) {
index e49926e129d77dbc34fce8a3a432e14bd46ab9aa..4860bade888783209ea570222ecfc81d386fcf5c 100644 (file)
@@ -373,6 +373,9 @@ extern ThreadId VG_(running_tid);
 /*--- Basic operations on the thread table.                ---*/
 /*------------------------------------------------------------*/
 
+/* Initialize the m_threadstate module. */
+void VG_(init_Threads)(void);
+
 // Convert a ThreadStatus to a string.
 const HChar* VG_(name_of_ThreadStatus) ( ThreadStatus status );