From 13b37159259a36168e43f902d6a9c4ed7d4f28c8 Mon Sep 17 00:00:00 2001 From: antirez Date: Fri, 22 Oct 2010 00:10:17 +0200 Subject: [PATCH] reports if tcmalloc is in used in INFO output --- src/Makefile | 1 + src/redis.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/Makefile b/src/Makefile index dd18b2c7..e99a18a5 100644 --- a/src/Makefile +++ b/src/Makefile @@ -15,6 +15,7 @@ endif ifeq ($(USE_TCMALLOC),yes) CCLINK+= -ltcmalloc + CCFLAGS+= -DUSE_TCMALLOC endif CCOPT= $(CFLAGS) $(CCLINK) $(ARCH) $(PROF) DEBUG?= -g -rdynamic -ggdb diff --git a/src/redis.c b/src/redis.c index f3cf100e..7749cb90 100644 --- a/src/redis.c +++ b/src/redis.c @@ -1185,6 +1185,7 @@ sds genRedisInfoString(void) { "used_memory:%zu\r\n" "used_memory_human:%s\r\n" "mem_fragmentation_ratio:%.2f\r\n" + "use_tcmalloc:%d\r\n" "changes_since_last_save:%lld\r\n" "bgsave_in_progress:%d\r\n" "last_save_time:%ld\r\n" @@ -1219,6 +1220,11 @@ sds genRedisInfoString(void) { zmalloc_used_memory(), hmem, zmalloc_get_fragmentation_ratio(), +#ifdef USE_TCMALLOC + 1, +#else + 0, +#endif server.dirty, server.bgsavechildpid != -1, server.lastsave, -- 2.47.2