From 992a8f83b7af0d5001da4129045075ea59e668b3 Mon Sep 17 00:00:00 2001 From: sdong Date: Thu, 28 Apr 2016 16:04:31 -0700 Subject: [PATCH] Not enable jemalloc status printing if USE_CLANG=1 Summary: Warning is printed out with USE_CLANG=1 when including jemalloc.h. Disable it in that case. Test Plan: Run db_bench with USE_CLANG=1 and not. Make sure they can all build and jemalloc status is printed out in the case where USE_CLANG is not set. Reviewers: andrewkr, IslamAbdelRahman Reviewed By: IslamAbdelRahman Subscribers: leveldb, andrewkr, dhruba Differential Revision: https://reviews.facebook.net/D57399 --- build_tools/fbcode_config.sh | 2 +- build_tools/fbcode_config4.8.1.sh | 2 +- db/db_impl.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build_tools/fbcode_config.sh b/build_tools/fbcode_config.sh index 32c961e28..da51278c4 100644 --- a/build_tools/fbcode_config.sh +++ b/build_tools/fbcode_config.sh @@ -61,7 +61,6 @@ CFLAGS+=" -DGFLAGS=google" # location of jemalloc JEMALLOC_INCLUDE=" -I $JEMALLOC_BASE/include/" JEMALLOC_LIB=" $JEMALLOC_BASE/lib/libjemalloc.a" -JEMALLOC=1 if test -z $PIC_BUILD; then # location of numa @@ -98,6 +97,7 @@ if [ -z "$USE_CLANG" ]; then CFLAGS+=" -B$BINUTILS/gold" CFLAGS+=" -isystem $GLIBC_INCLUDE" CFLAGS+=" -isystem $LIBGCC_INCLUDE" + JEMALLOC=1 else # clang CLANG_INCLUDE="$CLANG_LIB/clang/*/include" diff --git a/build_tools/fbcode_config4.8.1.sh b/build_tools/fbcode_config4.8.1.sh index dbda429c5..668adf92b 100644 --- a/build_tools/fbcode_config4.8.1.sh +++ b/build_tools/fbcode_config4.8.1.sh @@ -40,7 +40,6 @@ GFLAGS_LIBS=" $GFLAGS_BASE/lib/libgflags.a" # location of jemalloc JEMALLOC_INCLUDE=" -I $JEMALLOC_BASE/include" JEMALLOC_LIB="$JEMALLOC_BASE/lib/libjemalloc.a" -JEMALLOC=1 # location of numa NUMA_INCLUDE=" -I $NUMA_BASE/include/" @@ -67,6 +66,7 @@ if [ -z "$USE_CLANG" ]; then CFLAGS="-B$BINUTILS/gold -m64 -mtune=generic" CFLAGS+=" -isystem $GLIBC_INCLUDE" CFLAGS+=" -isystem $LIBGCC_INCLUDE" + JEMALLOC=1 else # clang CLANG_BIN="$CLANG_BASE/bin" diff --git a/db/db_impl.cc b/db/db_impl.cc index ff4c44721..b93166df3 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -551,7 +551,7 @@ static void GetJemallocStatus(void* mstat_arg, const char* status) { return; } - snprintf(mstat->cur, buf_size, status); + snprintf(mstat->cur, buf_size, "%s", status); mstat->cur += status_len; } #endif // ROCKSDB_JEMALLOC