|
From: <sv...@va...> - 2008-04-04 19:10:19
|
Author: bart
Date: 2008-04-04 20:10:21 +0100 (Fri, 04 Apr 2008)
New Revision: 7843
Log:
Suppressed reports about data races during thread creation.
Modified:
trunk/exp-drd/drd_clientreq.c
trunk/exp-drd/drd_clientreq.h
trunk/exp-drd/drd_pthread_intercepts.c
Modified: trunk/exp-drd/drd_clientreq.c
===================================================================
--- trunk/exp-drd/drd_clientreq.c 2008-04-04 16:55:15 UTC (rev 7842)
+++ trunk/exp-drd/drd_clientreq.c 2008-04-04 19:10:21 UTC (rev 7843)
@@ -140,6 +140,14 @@
drd_stop_tracing_address_range(arg[1], arg[1] + arg[2]);
break;
+ case VG_USERREQ__DRD_STOP_RECORDING:
+ thread_stop_recording(drd_tid);
+ break;
+
+ case VG_USERREQ__DRD_START_RECORDING:
+ thread_start_recording(drd_tid);
+ break;
+
case VG_USERREQ__SET_PTHREADID:
thread_set_pthreadid(drd_tid, arg[1]);
break;
Modified: trunk/exp-drd/drd_clientreq.h
===================================================================
--- trunk/exp-drd/drd_clientreq.h 2008-04-04 16:55:15 UTC (rev 7842)
+++ trunk/exp-drd/drd_clientreq.h 2008-04-04 19:10:21 UTC (rev 7843)
@@ -35,6 +35,12 @@
/* To ask the drd tool to stop tracing accesses to the specified range. */
VG_USERREQ__DRD_STOP_TRACE_ADDR,
/* args: Addr, SizeT. */
+ /* Let the drd tool stop recording memory accesses in the calling thread. */
+ VG_USERREQ__DRD_STOP_RECORDING,
+ /* args: none. */
+ /* Let the drd tool start recording memory accesses in the calling thread. */
+ VG_USERREQ__DRD_START_RECORDING,
+ /* args: none. */
/* Tell the core the pthread_t of the running thread */
VG_USERREQ__SET_PTHREADID,
Modified: trunk/exp-drd/drd_pthread_intercepts.c
===================================================================
--- trunk/exp-drd/drd_pthread_intercepts.c 2008-04-04 16:55:15 UTC (rev 7842)
+++ trunk/exp-drd/drd_pthread_intercepts.c 2008-04-04 19:10:21 UTC (rev 7843)
@@ -244,6 +244,7 @@
pthread_t *thread, const pthread_attr_t *attr,
void *(*start) (void *), void *arg)
{
+ int res;
int ret;
OrigFn fn;
VgPosixThreadArgs vgargs;
@@ -270,7 +271,12 @@
pthread_cond_init(&vgargs.cond, 0);
pthread_mutex_lock(&vgargs.mutex);
#endif
+ /* Suppress NPTL-specific conflicts between creator and created thread. */
+ VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__DRD_STOP_RECORDING,
+ 0, 0, 0, 0, 0);
CALL_FN_W_WWWW(ret, fn, thread, attr, vg_thread_wrapper, &vgargs);
+ VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__DRD_START_RECORDING,
+ 0, 0, 0, 0, 0);
#if 0
pthread_cond_wait(&vgargs.cond, &vgargs.mutex);
pthread_mutex_unlock(&vgargs.mutex);
|