From 63f43e70a9a62c9477f08bb4cf3b12c7b7ead3be Mon Sep 17 00:00:00 2001 From: pengyaozong Date: Mon, 4 Sep 2023 10:57:26 +0800 Subject: [PATCH] add LIBUV_HANDLE_BACKTRACE Signed-off-by: pengyaozong --- system/libuv/Kconfig | 10 ++++++++++ system/libuv/Make.defs | 4 ++++ system/libuv/Makefile | 1 - 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/system/libuv/Kconfig b/system/libuv/Kconfig index e0d18746a..718a7824a 100644 --- a/system/libuv/Kconfig +++ b/system/libuv/Kconfig @@ -40,6 +40,16 @@ config LIBUV_PREP_EVENT_SIZE endif +config LIBUV_HANDLE_BACKTRACE + int "the depth of libuv handle backtrace" + default 0 + ---help--- + Config the depth of backtrace for libuv handle creation by specified this + config: disable backtrace by 0 + when enabled, uv_print_all_handles & uv_print_active_handles will print + handle alloc backtrace additionally. + it's useful for libuv handle leak debugging + choice prompt "libuv utils" default LIBUV_UTILS_NONE diff --git a/system/libuv/Make.defs b/system/libuv/Make.defs index 740c5ef84..fb9419308 100644 --- a/system/libuv/Make.defs +++ b/system/libuv/Make.defs @@ -26,4 +26,8 @@ CONFIGURED_APPS += $(APPDIR)/system/libuv CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/system/libuv/libuv/include CXXFLAGS += ${INCDIR_PREFIX}$(APPDIR)/system/libuv/libuv/include +# define UV_HANDLE_BACKTRACE +CFLAGS += -DUV_HANDLE_BACKTRACE=CONFIG_LIBUV_HANDLE_BACKTRACE +CXXFLAGS += -DUV_HANDLE_BACKTRACE=CONFIG_LIBUV_HANDLE_BACKTRACE + endif diff --git a/system/libuv/Makefile b/system/libuv/Makefile index 5500c6a0d..ee56f6666 100644 --- a/system/libuv/Makefile +++ b/system/libuv/Makefile @@ -28,7 +28,6 @@ LIBUV_TARBALL = v$(LIBUV_VERSION).zip LIBUV_URL_BASE = https://github.com/libuv/libuv/archive/refs/tags LIBUV_URL = $(LIBUV_URL_BASE)/$(LIBUV_TARBALL) - $(LIBUV_TARBALL): @echo "Downloading: $(LIBUV_TARBALL)" $(Q) curl -L $(LIBUV_URL) -o $(LIBUV_TARBALL)