When analyzing Valgrind with drd, suppress uninteresting race reports on VG_(threads)[].status

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12432
This commit is contained in:
Bart Van Assche 2012-03-08 14:59:25 +00:00
parent 0d812117a5
commit 4e36be3285
3 changed files with 19 additions and 0 deletions

View 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

View File

@ -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 @@ 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) {

View 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 );