diff --git a/Makefile b/Makefile index 9769453c5..44ae69404 100644 --- a/Makefile +++ b/Makefile @@ -237,6 +237,11 @@ ifdef COMPILE_WITH_UBSAN PLATFORM_CXXFLAGS += -fsanitize=undefined -DROCKSDB_UBSAN_RUN endif +ifdef ROCKSDB_VALGRIND_RUN + PLATFORM_CCFLAGS += -DROCKSDB_VALGRIND_RUN + PLATFORM_CXXFLAGS += -DROCKSDB_VALGRIND_RUN +endif + ifndef DISABLE_JEMALLOC ifdef JEMALLOC PLATFORM_CXXFLAGS += -DROCKSDB_JEMALLOC -DJEMALLOC_NO_DEMANGLE @@ -870,7 +875,7 @@ ubsan_crash_test: $(MAKE) clean valgrind_test: - DISABLE_JEMALLOC=1 $(MAKE) valgrind_check + ROCKSDB_VALGRIND_RUN=1 DISABLE_JEMALLOC=1 $(MAKE) valgrind_check valgrind_check: $(TESTS) $(MAKE) DRIVER="$(VALGRIND_VER) $(VALGRIND_OPTS)" gen_parallel_tests diff --git a/env/io_posix.cc b/env/io_posix.cc index 2bbe80fe1..b00def45f 100644 --- a/env/io_posix.cc +++ b/env/io_posix.cc @@ -865,6 +865,8 @@ uint64_t PosixWritableFile::GetFileSize() { return filesize_; } void PosixWritableFile::SetWriteLifeTimeHint(Env::WriteLifeTimeHint hint) { #ifdef OS_LINUX +// Suppress Valgrind "Unimplemented functionality" error. +#ifndef ROCKSDB_VALGRIND_RUN if (hint == write_hint_) { return; } @@ -872,6 +874,7 @@ void PosixWritableFile::SetWriteLifeTimeHint(Env::WriteLifeTimeHint hint) { write_hint_ = hint; } #endif +#endif } Status PosixWritableFile::InvalidateCache(size_t offset, size_t length) {