summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
17031c6)
Thread checkers like Helgrind and DRD report all concurrent
modifications of variables that are serialized by a recognized
synchronization primitive. Suppress reports about intentionally
unsynchronized accesses.
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
#include <libgen.h>
#include <math.h>
#include <assert.h>
#include <libgen.h>
#include <math.h>
#include <assert.h>
+#ifdef CONFIG_VALGRIND_DEV
+#include <valgrind/drd.h>
+#else
+#define DRD_IGNORE_VAR(x) do { } while (0)
+#endif
#include "fio.h"
#include "smalloc.h"
#include "fio.h"
#include "smalloc.h"
+ DRD_IGNORE_VAR(du->users);
memset(du, 0, sizeof(*du));
INIT_FLIST_HEAD(&du->list);
l = snprintf(du->path, sizeof(du->path), "%s/stat", path);
memset(du, 0, sizeof(*du));
INIT_FLIST_HEAD(&du->list);
l = snprintf(du->path, sizeof(du->path), "%s/stat", path);
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
+#ifdef CONFIG_VALGRIND_DEV
+#include <valgrind/drd.h>
+#else
+#define DRD_IGNORE_VAR(x) do { } while (0)
+#endif
#include "fio.h"
#include "lib/pow2.h"
#include "fio.h"
#include "lib/pow2.h"
void print_status_init(int thr_number)
{
void print_status_init(int thr_number)
{
+ DRD_IGNORE_VAR(__run_str);
__run_str[thr_number] = 'P';
update_condensed_str(__run_str, run_str);
}
__run_str[thr_number] = 'P';
update_condensed_str(__run_str, run_str);
}
+#ifdef CONFIG_VALGRIND_DEV
+#include <valgrind/drd.h>
+#else
+#define DRD_IGNORE_VAR(x) do { } while (0)
+#endif
+
#include "fio.h"
#include "smalloc.h"
#include "helper_thread.h"
#include "fio.h"
#include "smalloc.h"
#include "helper_thread.h"
hd->startup_sem = startup_sem;
hd->startup_sem = startup_sem;
+ DRD_IGNORE_VAR(helper_data);
+
ret = pthread_create(&hd->thread, NULL, helper_thread_main, hd);
if (ret) {
log_err("Can't create helper thread: %s\n", strerror(ret));
ret = pthread_create(&hd->thread, NULL, helper_thread_main, hd);
if (ret) {
log_err("Can't create helper thread: %s\n", strerror(ret));
#include <sys/types.h>
#include <sys/stat.h>
#include <dlfcn.h>
#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
#include "fio.h"
#ifndef FIO_NO_HAVE_SHM_H
*/
static int setup_thread_area(void)
{
*/
static int setup_thread_area(void)
{
#endif
memset(threads, 0, max_jobs * sizeof(struct thread_data));
#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;
fio_debug_jobp = (unsigned int *)(threads + max_jobs);
*fio_debug_jobp = -1;
fio_warned = fio_debug_jobp + 1;