From: Francesco Chemolli Date: Mon, 17 Mar 2014 11:18:01 +0000 (+0100) Subject: Removed MEM_GEN_TRACE X-Git-Tag: SQUID_3_5_0_1~327^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b005403744308d3ed83d709a3688e03c08965dbe;p=thirdparty%2Fsquid.git Removed MEM_GEN_TRACE --- diff --git a/compat/xalloc.cc b/compat/xalloc.cc index 6265b3f711..bfde416116 100644 --- a/compat/xalloc.cc +++ b/compat/xalloc.cc @@ -89,10 +89,6 @@ xcalloc(size_t n, size_t sz) #if XMALLOC_STATISTICS malloc_stat(sz * n); #endif -#if MEM_GEN_TRACE - if (tracefp) - fprintf(tracefp, "c:%u:%u:%p\n", (unsigned int) n, (unsigned int) sz, p); -#endif PROF_stop(xcalloc); return p; @@ -124,10 +120,6 @@ xmalloc(size_t sz) #if XMALLOC_STATISTICS malloc_stat(sz); #endif -#if MEM_GEN_TRACE - if (tracefp) - fprintf(tracefp, "m:%d:%p\n", sz, p); -#endif PROF_stop(xmalloc); return (p); @@ -160,10 +152,7 @@ xrealloc(void *s, size_t sz) #if XMALLOC_STATISTICS malloc_stat(sz); #endif -#if MEM_GEN_TRACE - if (tracefp) /* new ptr, old ptr, new size */ - fprintf(tracefp, "r:%p:%p:%d\n", p, s, sz); -#endif + PROF_stop(xrealloc); return (p); } @@ -177,10 +166,5 @@ free_const(const void *s_const) PROF_start(free); free(s); PROF_stop(free); - -#if MEM_GEN_TRACE - if (tracefp) - fprintf(tracefp, "f:%p\n", s); -#endif PROF_stop(free_const); } diff --git a/configure.ac b/configure.ac index 28e20ec0cf..92bceaf84f 100644 --- a/configure.ac +++ b/configure.ac @@ -1053,18 +1053,6 @@ else fi AC_SUBST(ADAPTATION_LIBS) - -dnl This is a developer only option. Developers know how to set defines -dnl -dnl AC_ARG_ENABLE(mem-gen-trace, -dnl [ --enable-mem-gen-trace Do trace of memory stuff], -dnl [ if test "$enableval" = "yes" ; then -dnl AC_MSG_NOTICE([Memory trace (to file) enabled]) -dnl AC_DEFINE(MEM_GEN_TRACE,1,[Define for log file trace of mem alloc/free]) -dnl fi -dnl ]) - - test "x$squid_host_os" = "xmingw" && enable_wccp=no AC_ARG_ENABLE(wccp, AS_HELP_STRING([--disable-wccp],[Disable Web Cache Coordination Protocol]), [ diff --git a/lib/malloc_trace.cc b/lib/malloc_trace.cc index cecb771760..a5011053e8 100644 --- a/lib/malloc_trace.cc +++ b/lib/malloc_trace.cc @@ -50,27 +50,3 @@ #include #endif -#if MEM_GEN_TRACE - -static FILE *tracefp = NULL; - -void -log_trace_init(char *fn) -{ - tracefp = fopen(fn, "a+"); - - if (!tracefp) { - perror("log_trace_init"); - exit(1); - } -} - -void -log_trace_done() -{ - fclose(tracefp); - tracefp = NULL; -} - -#endif - diff --git a/src/main.cc b/src/main.cc index 287d3e07fd..61240d112d 100644 --- a/src/main.cc +++ b/src/main.cc @@ -189,10 +189,6 @@ static void serverConnectionsOpen(void); static void serverConnectionsClose(void); static void watch_child(char **); static void setEffectiveUser(void); -#if MEM_GEN_TRACE -void log_trace_done(); -void log_trace_init(char *); -#endif static void SquidShutdown(void); static void mainSetCwd(void); static int checkRunningPid(void); @@ -1001,12 +997,6 @@ mainInitialize(void) fd_open(fileno(debug_log), FD_LOG, Debug::cache_log); -#if MEM_GEN_TRACE - - log_trace_init("/tmp/squid.alloc"); - -#endif - debugs(1, DBG_CRITICAL, "Starting Squid Cache version " << version_string << " for " << CONFIG_HOST_TYPE << "..."); debugs(1, DBG_CRITICAL, "Service Name: " << service_name); @@ -1923,12 +1913,6 @@ SquidShutdown() RunRegisteredHere(RegisteredRunner::finishShutdown); -#if MEM_GEN_TRACE - - log_trace_done(); - -#endif - if (IamPrimaryProcess()) { if (Config.pidFilename && strcmp(Config.pidFilename, "none") != 0) { enter_suid(); diff --git a/src/tools.cc b/src/tools.cc index 5f9ec9b86a..85957a2eb4 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -82,10 +82,6 @@ and report the trace back to squid-bugs@squid-cache.org.\n\ Thanks!\n" static void mail_warranty(void); -#if MEM_GEN_TRACE -void log_trace_done(); -void log_trace_init(char *); -#endif static void restoreCapabilities(int keep); int DebugSignal = -1; @@ -463,22 +459,10 @@ sigusr2_handle(int sig) DebugSignal = sig; if (state == 0) { -#if !MEM_GEN_TRACE Debug::parseOptions("ALL,7"); -#else - - log_trace_done(); -#endif - state = 1; } else { -#if !MEM_GEN_TRACE Debug::parseOptions(Debug::debugOptions); -#else - - log_trace_init("/tmp/squid.alloc"); -#endif - state = 0; }