@ -33,10 +33,12 @@
# include <unordered_map>
# include <unordered_map>
# include "db/db_impl.h"
# include "db/db_impl.h"
# include "db/malloc_stats.h"
# include "db/version_set.h"
# include "db/version_set.h"
# include "hdfs/env_hdfs.h"
# include "hdfs/env_hdfs.h"
# include "monitoring/histogram.h"
# include "monitoring/histogram.h"
# include "monitoring/statistics.h"
# include "monitoring/statistics.h"
# include "options/cf_options.h"
# include "port/port.h"
# include "port/port.h"
# include "port/stack_trace.h"
# include "port/stack_trace.h"
# include "rocksdb/cache.h"
# include "rocksdb/cache.h"
@ -45,7 +47,6 @@
# include "rocksdb/filter_policy.h"
# include "rocksdb/filter_policy.h"
# include "rocksdb/memtablerep.h"
# include "rocksdb/memtablerep.h"
# include "rocksdb/options.h"
# include "rocksdb/options.h"
# include "options/cf_options.h"
# include "rocksdb/perf_context.h"
# include "rocksdb/perf_context.h"
# include "rocksdb/persistent_cache.h"
# include "rocksdb/persistent_cache.h"
# include "rocksdb/rate_limiter.h"
# include "rocksdb/rate_limiter.h"
@ -1038,6 +1039,9 @@ DEFINE_bool(dump_malloc_stats, true, "Dump malloc stats in LOG ");
DEFINE_uint64 ( stats_dump_period_sec , rocksdb : : Options ( ) . stats_dump_period_sec ,
DEFINE_uint64 ( stats_dump_period_sec , rocksdb : : Options ( ) . stats_dump_period_sec ,
" Gap between printing stats to log in seconds " ) ;
" Gap between printing stats to log in seconds " ) ;
DEFINE_bool ( print_malloc_stats , false ,
" Print malloc stats to stdout after benchmarks finish. " ) ;
enum RepFactory {
enum RepFactory {
kSkipList ,
kSkipList ,
kPrefixHash ,
kPrefixHash ,
@ -5804,6 +5808,13 @@ int db_bench_tool(int argc, char** argv) {
rocksdb : : Benchmark benchmark ;
rocksdb : : Benchmark benchmark ;
benchmark . Run ( ) ;
benchmark . Run ( ) ;
if ( FLAGS_print_malloc_stats ) {
std : : string stats_string ;
rocksdb : : DumpMallocStats ( & stats_string ) ;
fprintf ( stdout , " Malloc stats: \n %s \n " , stats_string . c_str ( ) ) ;
}
return 0 ;
return 0 ;
}
}
} // namespace rocksdb
} // namespace rocksdb