diff --git a/CONFIG b/CONFIG index 9771a2ed9..d947909e9 100644 --- a/CONFIG +++ b/CONFIG @@ -43,9 +43,6 @@ CONFIG_CROSS_PREFIX= # Build with debug logging. Turn off for performance testing and normal usage CONFIG_DEBUG=n -# Build with support of backtrace printing in log messages. Requires libunwind. -CONFIG_LOG_BACKTRACE=n - # Treat warnings as errors (fail the build on any warning). CONFIG_WERROR=n diff --git a/configure b/configure index efff648af..4c9772adf 100755 --- a/configure +++ b/configure @@ -24,7 +24,6 @@ function usage() echo " example: aarch64-linux-gnu" echo "" echo " --enable-debug Configure for debug builds" - echo " --enable-log-bt Enable support of backtrace printing in SPDK logs (requires libunwind)." echo " --enable-werror Treat compiler warnings as errors" echo " --enable-asan Enable address sanitizer" echo " --enable-ubsan Enable undefined behavior sanitizer" @@ -211,12 +210,6 @@ for i in "$@"; do --disable-debug) CONFIG[DEBUG]=n ;; - --enable-log-bt) - CONFIG[LOG_BACKTRACE]=y - ;; - --disable-log-bt) - CONFIG[LOG_BACKTRACE]=n - ;; --enable-asan) CONFIG[ASAN]=y ;; @@ -759,15 +752,6 @@ if [[ "${CONFIG[ISCSI_INITIATOR]}" = "y" ]]; then fi fi -if [[ "${CONFIG[LOG_BACKTRACE]}" = "y" ]]; then - if ! echo -e '#include \nint main(void) { return 0; }\n' \ - | ${BUILD_CMD[@]} -lunwind - 2>/dev/null; then - echo --enable-log-bt requires libunwind. - echo Please install then re-run this script. - exit 1 - fi -fi - if [[ "${CONFIG[ASAN]}" = "y" ]]; then if ! echo -e 'int main(void) { return 0; }\n' \ | ${BUILD_CMD[@]} -fsanitize=address - 2>/dev/null; then diff --git a/lib/event/app.c b/lib/event/app.c index ee3addd51..ad1a4ef81 100644 --- a/lib/event/app.c +++ b/lib/event/app.c @@ -47,7 +47,6 @@ #define SPDK_APP_DEFAULT_LOG_LEVEL SPDK_LOG_NOTICE #define SPDK_APP_DEFAULT_LOG_PRINT_LEVEL SPDK_LOG_INFO -#define SPDK_APP_DEFAULT_BACKTRACE_LOG_LEVEL SPDK_LOG_ERROR #define SPDK_APP_DEFAULT_NUM_TRACE_ENTRIES SPDK_DEFAULT_NUM_TRACE_ENTRIES #define SPDK_APP_DPDK_DEFAULT_MEM_SIZE -1 @@ -636,7 +635,6 @@ spdk_app_start(struct spdk_app_opts *opts, spdk_msg_fn start_fn, g_spdk_app.rc = 0; spdk_log_set_level(SPDK_APP_DEFAULT_LOG_LEVEL); - spdk_log_set_backtrace_level(SPDK_APP_DEFAULT_BACKTRACE_LOG_LEVEL); if (app_setup_env(opts) < 0) { return 1; diff --git a/lib/log/Makefile b/lib/log/Makefile index f6c03ca98..4e7c25758 100644 --- a/lib/log/Makefile +++ b/lib/log/Makefile @@ -34,14 +34,12 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../..) include $(SPDK_ROOT_DIR)/mk/spdk.common.mk -SO_VER := 2 -SO_MINOR := 1 +SO_VER := 3 +SO_MINOR := 0 +SO_SUFFIX := $(SO_VER).$(SO_MINOR) C_SRCS = log.c log_flags.c LIBNAME = log -ifeq ($(CONFIG_LOG_BACKTRACE),y) -LOCAL_SYS_LIBS += -lunwind -endif SPDK_MAP_FILE = $(abspath $(CURDIR)/spdk_log.map) diff --git a/lib/log/log.c b/lib/log/log.c index 2960bcbd9..315e13cf9 100644 --- a/lib/log/log.c +++ b/lib/log/log.c @@ -35,11 +35,6 @@ #include "spdk_internal/log.h" -#ifdef SPDK_LOG_BACKTRACE_LVL -#define UNW_LOCAL_ONLY -#include -#endif - static const char *const spdk_level_names[] = { [SPDK_LOG_ERROR] = "ERROR", [SPDK_LOG_WARN] = "WARNING", @@ -70,44 +65,6 @@ spdk_log_close(void) } } -#ifdef SPDK_LOG_BACKTRACE_LVL -static void -log_unwind_stack(FILE *fp, enum spdk_log_level level) -{ - unw_error_t err; - unw_cursor_t cursor; - unw_context_t uc; - unw_word_t ip; - unw_word_t offp; - char f_name[64]; - int frame; - - if (level > g_spdk_log_backtrace_level) { - return; - } - - unw_getcontext(&uc); - unw_init_local(&cursor, &uc); - fprintf(fp, "*%s*: === BACKTRACE START ===\n", spdk_level_names[level]); - - unw_step(&cursor); - for (frame = 1; unw_step(&cursor) > 0; frame++) { - unw_get_reg(&cursor, UNW_REG_IP, &ip); - err = unw_get_proc_name(&cursor, f_name, sizeof(f_name), &offp); - if (err || strcmp(f_name, "main") == 0) { - break; - } - - fprintf(fp, "*%s*: %3d: %*s%s() at %#lx\n", spdk_level_names[level], frame, frame - 1, "", f_name, - (unsigned long)ip); - } - fprintf(fp, "*%s*: === BACKTRACE END ===\n", spdk_level_names[level]); -} - -#else -#define log_unwind_stack(fp, lvl) -#endif - static void get_timestamp_prefix(char *buf, int buf_size) { @@ -176,7 +133,6 @@ spdk_vlog(enum spdk_log_level level, const char *file, const int line, const cha get_timestamp_prefix(timestamp, sizeof(timestamp)); if (file) { fprintf(stderr, "%s%s:%4d:%s: *%s*: %s", timestamp, file, line, func, spdk_level_names[level], buf); - log_unwind_stack(stderr, level); } else { fprintf(stderr, "%s%s", timestamp, buf); } diff --git a/lib/log/log_flags.c b/lib/log/log_flags.c index 75848b210..c767a3786 100644 --- a/lib/log/log_flags.c +++ b/lib/log/log_flags.c @@ -39,7 +39,6 @@ static TAILQ_HEAD(, spdk_log_flag) g_log_flags = TAILQ_HEAD_INITIALIZER(g_log_fl enum spdk_log_level g_spdk_log_level = SPDK_LOG_NOTICE; enum spdk_log_level g_spdk_log_print_level = SPDK_LOG_NOTICE; -enum spdk_log_level g_spdk_log_backtrace_level = SPDK_LOG_DISABLED; SPDK_LOG_REGISTER_COMPONENT("log", SPDK_LOG_LOG) @@ -71,19 +70,6 @@ spdk_log_get_print_level(void) { return g_spdk_log_print_level; } -void -spdk_log_set_backtrace_level(enum spdk_log_level level) -{ - assert(level >= SPDK_LOG_DISABLED); - assert(level <= SPDK_LOG_DEBUG); - g_spdk_log_backtrace_level = level; -} - -enum spdk_log_level -spdk_log_get_backtrace_level(void) { - return g_spdk_log_backtrace_level; -} - static struct spdk_log_flag * get_log_flag(const char *name) { diff --git a/lib/log/spdk_log.map b/lib/log/spdk_log.map index a91e931fc..84629d555 100644 --- a/lib/log/spdk_log.map +++ b/lib/log/spdk_log.map @@ -6,8 +6,6 @@ spdk_log_close; spdk_log_set_level; spdk_log_get_level; - spdk_log_set_backtrace_level; - spdk_log_get_backtrace_level; spdk_log_set_print_level; spdk_log_get_print_level; spdk_log; diff --git a/mk/spdk.common.mk b/mk/spdk.common.mk index 5f0988905..e4efb6d04 100644 --- a/mk/spdk.common.mk +++ b/mk/spdk.common.mk @@ -226,9 +226,6 @@ CXXFLAGS += $(COMMON_CFLAGS) SYS_LIBS += -lrt SYS_LIBS += -luuid SYS_LIBS += -lcrypto -ifeq ($(CONFIG_LOG_BACKTRACE),y) -SYS_LIBS += -lunwind -endif ifneq ($(CONFIG_NVME_CUSE)$(CONFIG_FUSE),nn) SYS_LIBS += -lfuse3 diff --git a/scripts/pkgdep/arch.sh b/scripts/pkgdep/arch.sh index b19d99778..32944b925 100755 --- a/scripts/pkgdep/arch.sh +++ b/scripts/pkgdep/arch.sh @@ -14,8 +14,6 @@ if [[ $INSTALL_DEV_TOOLS == "true" ]]; then # Tools for developers pacman -Sy --needed --noconfirm git astyle autopep8 \ clang sg3_utils pciutils shellcheck - # Additional (optional) dependencies for showing backtrace in logs - pacman -Sy --needed --noconfirm libunwind #fakeroot needed to instal via makepkg pacman -Sy --needed --noconfirm fakeroot su - $SUDO_USER -c "pushd /tmp; diff --git a/scripts/pkgdep/debian.sh b/scripts/pkgdep/debian.sh index be86edce2..155f6e5cd 100755 --- a/scripts/pkgdep/debian.sh +++ b/scripts/pkgdep/debian.sh @@ -26,8 +26,6 @@ if [[ $INSTALL_DEV_TOOLS == "true" ]]; then apt-get install -y git astyle pep8 lcov clang sg3-utils pciutils shellcheck # Additional python style checker not available on ubuntu 16.04 or earlier. apt-get install -y pycodestyle || true - # Additional (optional) dependencies for showing backtrace in logs - apt-get install -y libunwind-dev || true # Additional dependecies for nvmf performance test script apt-get install -y python3-paramiko install_shfmt diff --git a/scripts/pkgdep/rhel.sh b/scripts/pkgdep/rhel.sh index 9368e015f..d751cedf3 100755 --- a/scripts/pkgdep/rhel.sh +++ b/scripts/pkgdep/rhel.sh @@ -30,7 +30,7 @@ yum install -y numactl-devel nasm if [[ $INSTALL_DEV_TOOLS == "true" ]]; then # Tools for developers # Includes Fedora, CentOS 7, RHEL 7 - # Add EPEL repository for CUnit-devel and libunwind-devel + # Add EPEL repository for CUnit-devel if echo "$ID $VERSION_ID" | grep -E -q 'rhel 7|centos 7|centos 8'; then if ! rpm --quiet -q epel-release; then yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm @@ -49,8 +49,6 @@ if [[ $INSTALL_DEV_TOOLS == "true" ]]; then yum install -y python-pycodestyle lcov ShellCheck fi yum install -y git astyle sg3_utils pciutils - # Additional (optional) dependencies for showing backtrace in logs - yum install -y libunwind-devel || true install_shfmt fi if [[ $INSTALL_PMEM == "true" ]]; then diff --git a/scripts/pkgdep/sles.sh b/scripts/pkgdep/sles.sh index aefd3acdd..c5d14b67e 100755 --- a/scripts/pkgdep/sles.sh +++ b/scripts/pkgdep/sles.sh @@ -11,8 +11,6 @@ if [[ $INSTALL_DEV_TOOLS == "true" ]]; then # Tools for developers zypper install -y git-core lcov python-pycodestyle sg3_utils \ pciutils ShellCheck - # Additional (optional) dependencies for showing backtrace in logs - zypper install libunwind-devel || true install_shfmt fi if [[ $INSTALL_PMEM == "true" ]]; then diff --git a/test/common/autotest_common.sh b/test/common/autotest_common.sh index fcff2fe7a..ce376fc85 100755 --- a/test/common/autotest_common.sh +++ b/test/common/autotest_common.sh @@ -314,11 +314,6 @@ function get_config_params() { xtrace_disable config_params='--enable-debug --enable-werror' - if echo -e "#include \nint main(int argc, char *argv[]) {return 0;}\n" \ - | gcc -o /dev/null -lunwind -x c - 2> /dev/null; then - config_params+=' --enable-log-bt' - fi - # for options with dependencies but no test flag, set them here if [ -f /usr/include/infiniband/verbs.h ]; then config_params+=' --with-rdma'