Gperftools Profiling fix.

Fix a bug and update gperftools compiling flags

The added flags are recommended by gperftools here:
https://github.com/gperftools/gperftools

Verified that heap profiles are saved with the following command:
HEAPPROFILE=/tmp/fdbserver fdbserver [args...]
This commit is contained in:
Jingyu Zhou 2019-04-01 14:40:39 -07:00
parent 324438cf26
commit 49fdc35e5e
3 changed files with 2 additions and 3 deletions

View File

@ -29,7 +29,7 @@ ifeq ($(PLATFORM),linux)
fdbbackup_LDFLAGS += -static-libstdc++ -static-libgcc -ldl -lpthread -lrt
# GPerfTools profiler (uncomment to use)
# fdbbackup_CFLAGS += -I/opt/gperftools/include -DUSE_GPERFTOOLS=1
# fdbbackup_CFLAGS += -I/opt/gperftools/include -DUSE_GPERFTOOLS=1 -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free
# fdbbackup_LDFLAGS += -L/opt/gperftools/lib
# fdbbackup_STATIC_LIBS += -ltcmalloc -lunwind -lprofiler
else ifeq ($(PLATFORM),osx)

View File

@ -29,7 +29,7 @@ ifeq ($(PLATFORM),linux)
fdbserver_LDFLAGS += -ldl -lpthread -lrt -static-libstdc++ -static-libgcc
# GPerfTools profiler (uncomment to use)
# fdbserver_CFLAGS += -I/opt/gperftools/include -DUSE_GPERFTOOLS=1
# fdbserver_CFLAGS += -I/opt/gperftools/include -DUSE_GPERFTOOLS=1 -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free
# fdbserver_LDFLAGS += -L/opt/gperftools/lib
# fdbserver_STATIC_LIBS += -ltcmalloc -lunwind -lprofiler
else ifeq ($(PLATFORM),osx)

View File

@ -407,7 +407,6 @@ void updateCpuProfiler(ProfilerRequest req) {
options->filter_in_thread = &filter_in_thread;
options->filter_in_thread_arg = NULL;
ProfilerStartWithOptions(path, options);
free(workingDir);
break;
}
case ProfilerRequest::Action::DISABLE: