From fc3a68d8fb6c8f87485dd670f7af81feadd66635 Mon Sep 17 00:00:00 2001 From: judeng Date: Tue, 20 Feb 2024 03:47:02 +0800 Subject: [PATCH] add -fno-omit-frame-pointer to default complication flags (#12973) Currently redis uses O3 level optimization would remove the frame pointer in the target bin. In the very old past, when gcc optimized at O1 and above levels, the frame pointer is deleted by default to improve performance. This saves the RBP registers and reduces the pop/push instructions. But it makes it difficult for us to observe the running status of the program. For example, the perf tool cannot be used effectively, especially the modern eBPF tools such as bcc/memleak. --- src/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Makefile b/src/Makefile index acdd671bd..4e7276791 100644 --- a/src/Makefile +++ b/src/Makefile @@ -25,6 +25,9 @@ ifeq ($(OPTIMIZATION),-O3) endif REDIS_LDFLAGS+=-O3 -flto endif +ifneq ($(OPTIMIZATION),-O0) + REDIS_CFLAGS+=-fno-omit-frame-pointer +endif DEPENDENCY_TARGETS=hiredis linenoise lua hdr_histogram fpconv NODEPS:=clean distclean