diff --git a/CMakeLists.txt b/CMakeLists.txt index e00c68f8df73760b8631be79e35340731b7de899..99ae724a8c292c2163740a6a26beb7f64a1a1ef5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -258,9 +258,6 @@ if (IS_DIRECTORY ${PROJECT_SOURCE_DIR}/doc/sphinx) option(ENABLE_DOC "Enable building of documentation" OFF) endif () -option(ENABLE_TRACE "Enable debug trace of tarantool_box execution to -a file specified in TARANTOOL_TRACE environment variable" ON) - ## ## Third-Party libraries @@ -425,7 +422,7 @@ endif() # tarantool info summary (used in server version output) # set(TARANTOOL_OPTIONS "-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") -set(TARANTOOL_OPTIONS "${TARANTOOL_OPTIONS} -DENABLE_TRACE=${ENABLE_TRACE} -DENABLE_BACKTRACE=${ENABLE_BACKTRACE}") +set(TARANTOOL_OPTIONS "${TARANTOOL_OPTIONS} -DENABLE_BACKTRACE=${ENABLE_BACKTRACE}") set(TARANTOOL_BUILD "${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}-${CMAKE_BUILD_TYPE}") set(TARANTOOL_C_COMPILER ${CMAKE_C_COMPILER}) set(TARANTOOL_CXX_COMPILER ${CMAKE_CXX_COMPILER}) @@ -443,7 +440,7 @@ message (STATUS "") set(PREFIX ${CMAKE_INSTALL_PREFIX}) set(options VERSION BUILD C_COMPILER CXX_COMPILER C_FLAGS CXX_FLAGS PREFIX ENABLE_SSE2 ENABLE_AVX - ENABLE_GCOV ENABLE_GPROF ENABLE_VALGRIND ENABLE_TRACE + ENABLE_GCOV ENABLE_GPROF ENABLE_VALGRIND ENABLE_BACKTRACE ENABLE_DOC ENABLE_DIST diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 26b555a85f93d6ebf6877bb33668a09be4a40633..a10327c23d82b07d22de7b9f501594f0d5738be3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -149,10 +149,6 @@ if (NOT TARGET_OS_DEBIAN_FREEBSD) endif() endif() -if (ENABLE_TRACE) - set (server_sources ${server_sources} trace.c) -endif() - set_source_files_compile_flags(${server_sources}) add_library(server STATIC ${server_sources}) target_link_libraries(server core bit) diff --git a/src/trace.c b/src/trace.c deleted file mode 100644 index b9d24b3cef0256cc4b02116248a152b9adc97365..0000000000000000000000000000000000000000 --- a/src/trace.c +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2010-2015, Tarantool AUTHORS, please see AUTHORS file. - * - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * - * 1. Redistributions of source code must retain the above - * copyright notice, this list of conditions and the - * following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * <COPYRIGHT HOLDER> OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <sys/types.h> -#include <unistd.h> - -#include "main.h" - -static int level = 0; -static FILE *trace_fd = NULL; - -void __attribute__ ((no_instrument_function, constructor)) trace_init(void) -{ - char *trace = getenv("TARANTOOL_TRACE"); - - if (trace == NULL) - return; - - if (strncmp(trace, "stderr", 6) == 0) - trace_fd = stderr; - else - trace_fd = fopen(trace, "w+"); -} - -void __attribute__ ((no_instrument_function)) __cyg_profile_func_enter(void *f, void - *callsite - __attribute__ ((unused))) -{ - if (unlikely(trace_fd != NULL)) - fprintf(trace_fd, "%i %*c%p\n", getpid(), level++, 'E', f); -} - -void __attribute__ ((no_instrument_function)) __cyg_profile_func_exit(void *f, void - *callsite - __attribute__ ((unused))) -{ - if (unlikely(trace_fd != NULL)) - fprintf(trace_fd, "%i %*c%p\n", getpid(), --level, 'X', f); -} diff --git a/src/trivia/config.h.cmake b/src/trivia/config.h.cmake index 1d4d3618a2afc86914cc7a2b270e88197dde722a..688e1cb66eeeabff687a23d52973732d4d677535 100644 --- a/src/trivia/config.h.cmake +++ b/src/trivia/config.h.cmake @@ -50,11 +50,6 @@ * Defined if gcov instrumentation should be enabled. */ #cmakedefine ENABLE_GCOV 1 -/* - * Defined if configured with ENABLE_TRACE (debug trace into - * a file specified by TARANTOOL_TRACE environment variable. - */ -#cmakedefine ENABLE_TRACE 1 /* * Defined if configured with ENABLE_BACKTRACE ('show fiber' * showing fiber call stack.