Suppress uninteresting data race reports
[fio.git] / init.c
diff --git a/init.c b/init.c
index 53aba18899c9129986b06786d8f35c0436526de4..e47e5384119b369891119b54467ed558dfa082c3 100644 (file)
--- a/init.c
+++ b/init.c
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <dlfcn.h>
+#ifdef CONFIG_VALGRIND_DEV
+#include <valgrind/drd.h>
+#else
+#define DRD_IGNORE_VAR(x) do { } while (0)
+#endif
 
 #include "fio.h"
 #ifndef FIO_NO_HAVE_SHM_H
@@ -333,6 +338,8 @@ static void free_shm(void)
  */
 static int setup_thread_area(void)
 {
+       int i;
+
        if (threads)
                return 0;
 
@@ -376,6 +383,8 @@ static int setup_thread_area(void)
 #endif
 
        memset(threads, 0, max_jobs * sizeof(struct thread_data));
+       for (i = 0; i < max_jobs; i++)
+               DRD_IGNORE_VAR(threads[i]);
        fio_debug_jobp = (unsigned int *)(threads + max_jobs);
        *fio_debug_jobp = -1;
        fio_warned = fio_debug_jobp + 1;