From 925250f42fa73292243d6f47b644fcdf777546b9 Mon Sep 17 00:00:00 2001 From: Yanqin Jin Date: Mon, 21 Oct 2019 19:38:42 -0700 Subject: [PATCH] Include db_stress_tool in rocksdb tools lib (#5950) Summary: include db_stress_tool in rocksdb tools lib Test Plan (on devserver): ``` $make db_stress $./db_stress $make all && make check ``` Pull Request resolved: https://github.com/facebook/rocksdb/pull/5950 Differential Revision: D18044399 Pulled By: riversand963 fbshipit-source-id: 895585abbbdfd8b954965921dba4b1400b7af1b1 --- Makefile | 13 +++++++++++-- TARGETS | 28 +++++++++++++++++++++++----- buckifier/buckify_rocksdb.py | 7 +++++++ src.mk | 4 ++++ 4 files changed, 45 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 725a45dec4..9d0ffab515 100644 --- a/Makefile +++ b/Makefile @@ -439,6 +439,8 @@ BENCHTOOLOBJECTS = $(BENCH_LIB_SOURCES:.cc=.o) $(LIBOBJECTS) $(TESTUTIL) ANALYZETOOLOBJECTS = $(ANALYZER_LIB_SOURCES:.cc=.o) +STRESSTOOLOBJECTS = $(STRESS_LIB_SOURCES:.cc=.o) $(LIBOBJECTS) $(TESTUTIL) + EXPOBJECTS = $(LIBOBJECTS) $(TESTUTIL) TESTS = \ @@ -662,6 +664,7 @@ endif endif LIBRARY = ${LIBNAME}.a TOOLS_LIBRARY = ${LIBNAME}_tools.a +STRESS_LIBRARY = ${LIBNAME}_stress.a ROCKSDB_MAJOR = $(shell egrep "ROCKSDB_MAJOR.[0-9]" include/rocksdb/version.h | cut -d ' ' -f 3) ROCKSDB_MINOR = $(shell egrep "ROCKSDB_MINOR.[0-9]" include/rocksdb/version.h | cut -d ' ' -f 3) @@ -751,6 +754,8 @@ static_lib: $(LIBRARY) shared_lib: $(SHARED) +stress_lib: $(STRESS_LIBRARY) + tools: $(TOOLS) tools_lib: $(TOOLS_LIBRARY) @@ -1135,6 +1140,10 @@ $(TOOLS_LIBRARY): $(BENCH_LIB_SOURCES:.cc=.o) $(TOOL_LIB_SOURCES:.cc=.o) $(LIB_S $(AM_V_AR)rm -f $@ $(AM_V_at)$(AR) $(ARFLAGS) $@ $^ +$(STRESS_LIBRARY): $(LIB_SOURCES:.cc=.o) $(TESTUTIL) $(ANALYZER_LIB_SOURCES:.cc=.o) $(STRESS_LIB_SOURCES:.cc=.o) + $(AM_V_AR)rm -f $@ + $(AM_V_at)$(AR) $(ARFLAGS) $@ $^ + librocksdb_env_basic_test.a: env/env_basic_test.o $(LIBOBJECTS) $(TESTHARNESS) $(AM_V_AR)rm -f $@ $(AM_V_at)$(AR) $(ARFLAGS) $@ $^ @@ -1165,7 +1174,7 @@ memtablerep_bench: memtable/memtablerep_bench.o $(LIBOBJECTS) $(TESTUTIL) filter_bench: util/filter_bench.o $(LIBOBJECTS) $(TESTUTIL) $(AM_LINK) -db_stress: tools/db_stress_tool.o tools/db_stress.o $(LIBOBJECTS) $(TESTUTIL) +db_stress: tools/db_stress.o $(STRESSTOOLOBJECTS) $(AM_LINK) write_stress: tools/write_stress.o $(LIBOBJECTS) $(TESTUTIL) @@ -2038,7 +2047,7 @@ endif # Source files dependencies detection # --------------------------------------------------------------------------- -all_sources = $(LIB_SOURCES) $(MAIN_SOURCES) $(MOCK_LIB_SOURCES) $(TOOL_LIB_SOURCES) $(BENCH_LIB_SOURCES) $(TEST_LIB_SOURCES) $(ANALYZER_LIB_SOURCES) +all_sources = $(LIB_SOURCES) $(MAIN_SOURCES) $(MOCK_LIB_SOURCES) $(TOOL_LIB_SOURCES) $(BENCH_LIB_SOURCES) $(TEST_LIB_SOURCES) $(ANALYZER_LIB_SOURCES) $(STRESS_LIB_SOURCES) DEPFILES = $(all_sources:.cc=.cc.d) # Add proper dependency support so changing a .h file forces a .cc file to diff --git a/TARGETS b/TARGETS index 0d175656f7..1934f17645 100644 --- a/TARGETS +++ b/TARGETS @@ -392,6 +392,24 @@ cpp_library( external_deps = ROCKSDB_EXTERNAL_DEPS, ) +cpp_library( + name = "rocksdb_stress_lib", + srcs = [ + "test_util/testutil.cc", + "tools/block_cache_analyzer/block_cache_trace_analyzer.cc", + "tools/db_stress_tool.cc", + "tools/trace_analyzer_tool.cc", + ], + auto_headers = AutoHeaders.RECURSIVE_GLOB, + arch_preprocessor_flags = ROCKSDB_ARCH_PREPROCESSOR_FLAGS, + compiler_flags = ROCKSDB_COMPILER_FLAGS, + os_deps = ROCKSDB_OS_DEPS, + os_preprocessor_flags = ROCKSDB_OS_PREPROCESSOR_FLAGS, + preprocessor_flags = ROCKSDB_PREPROCESSOR_FLAGS, + deps = [":rocksdb_lib"], + external_deps = ROCKSDB_EXTERNAL_DEPS, +) + cpp_library( name = "env_basic_test_lib", srcs = ["env/env_basic_test.cc"], @@ -758,15 +776,15 @@ ROCKS_TESTS = [ [], ], [ - "db_merge_operator_test", - "db/db_merge_operator_test.cc", - "parallel", + "db_merge_operand_test", + "db/db_merge_operand_test.cc", + "serial", [], [], ], [ - "db_merge_operand_test", - "db/db_merge_operand_test.cc", + "db_merge_operator_test", + "db/db_merge_operator_test.cc", "parallel", [], [], diff --git a/buckifier/buckify_rocksdb.py b/buckifier/buckify_rocksdb.py index fc59cf5830..3b814f3271 100644 --- a/buckifier/buckify_rocksdb.py +++ b/buckifier/buckify_rocksdb.py @@ -169,6 +169,13 @@ def generate_targets(repo_path, deps_map): src_mk.get("ANALYZER_LIB_SOURCES", []) + ["test_util/testutil.cc"], [":rocksdb_lib"]) + # rocksdb_stress_lib + TARGETS.add_library( + "rocksdb_stress_lib", + src_mk.get("ANALYZER_LIB_SOURCES", []) + + src_mk.get('STRESS_LIB_SOURCES', []) + + ["test_util/testutil.cc"], + [":rocksdb_lib"]) print("Extra dependencies:\n{0}".format(str(deps_map))) # test for every test we found in the Makefile diff --git a/src.mk b/src.mk index 8cce00207f..560f062023 100644 --- a/src.mk +++ b/src.mk @@ -265,6 +265,9 @@ MOCK_LIB_SOURCES = \ BENCH_LIB_SOURCES = \ tools/db_bench_tool.cc \ +STRESS_LIB_SOURCES = \ + tools/db_stress_tool.cc \ + TEST_LIB_SOURCES = \ db/db_test_util.cc \ test_util/testharness.cc \ @@ -396,6 +399,7 @@ MAIN_SOURCES = \ tools/db_bench.cc \ tools/db_bench_tool_test.cc \ tools/db_sanity_test.cc \ + tools/db_stress.cc \ tools/ldb_cmd_test.cc \ tools/reduce_levels_test.cc \ tools/sst_dump_test.cc \