X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=init.c;h=e47e5384119b369891119b54467ed558dfa082c3;hp=53aba18899c9129986b06786d8f35c0436526de4;hb=4f37732a580d7983467ea1ba11f963da4e8cf06e;hpb=17031c6df30913608de1f66ca952ed75dd1324be;ds=sidebyside diff --git a/init.c b/init.c index 53aba188..e47e5384 100644 --- a/init.c +++ b/init.c @@ -12,6 +12,11 @@ #include #include #include +#ifdef CONFIG_VALGRIND_DEV +#include +#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;