|
From: <sv...@va...> - 2012-03-08 14:59:35
|
bart 2012-03-08 14:59:25 +0000 (Thu, 08 Mar 2012)
New Revision: 12432
Log:
When analyzing Valgrind with drd, suppress uninteresting race reports on VG_(threads)[].status
Modified files:
trunk/coregrind/m_main.c
trunk/coregrind/m_threadstate.c
trunk/coregrind/pub_core_threadstate.h
Modified: trunk/coregrind/m_threadstate.c (+14 -0)
===================================================================
--- trunk/coregrind/m_threadstate.c 2012-03-08 14:57:55 +00:00 (rev 12431)
+++ trunk/coregrind/m_threadstate.c 2012-03-08 14:59:25 +00:00 (rev 12432)
@@ -33,6 +33,11 @@
#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 @@
/*--- 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) {
Modified: trunk/coregrind/pub_core_threadstate.h (+3 -0)
===================================================================
--- trunk/coregrind/pub_core_threadstate.h 2012-03-08 14:57:55 +00:00 (rev 12431)
+++ trunk/coregrind/pub_core_threadstate.h 2012-03-08 14:59:25 +00:00 (rev 12432)
@@ -373,6 +373,9 @@
/*--- 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 );
Modified: trunk/coregrind/m_main.c (+2 -0)
===================================================================
--- trunk/coregrind/m_main.c 2012-03-08 14:57:55 +00:00 (rev 12431)
+++ trunk/coregrind/m_main.c 2012-03-08 14:59:25 +00:00 (rev 12432)
@@ -2003,6 +2003,8 @@
VG_(printf_xml)( "\n" );
}
+ VG_(init_Threads)();
+
//--------------------------------------------------------------
// Initialise the scheduler (phase 1) [generates tid_main]
// p: none, afaics
|