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.
This commit is contained in:
judeng 2024-02-20 03:47:02 +08:00 committed by GitHub
parent 6df42df291
commit fc3a68d8fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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