]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Removed MEM_GEN_TRACE
authorFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 17 Mar 2014 11:18:01 +0000 (12:18 +0100)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 17 Mar 2014 11:18:01 +0000 (12:18 +0100)
compat/xalloc.cc
configure.ac
lib/malloc_trace.cc
src/main.cc
src/tools.cc

index 6265b3f711f34b9919cd94f73c771eeaf6e8ed9e..bfde416116360841a680ca3efc99b97d2e3e69d0 100644 (file)
@@ -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);
 }
index 28e20ec0cf91e4eb16bdd1362e4014fca6f960cd..92bceaf84fb356e416d35dd2dd74c2d769081739 100644 (file)
@@ -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]), [
index cecb77176054aa6a35f92e506a688663c9390b0c..a5011053e814d549cffb81402a67c69a6f860033 100644 (file)
 #include <malloc.h>
 #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
-
index 287d3e07fdcf3bf074d49fa0c7b8e3db3511fe3c..61240d112d6156bf546db939733c840a3b5affb4 100644 (file)
@@ -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();
index 5f9ec9b86a9c9f3eef2033978c73f9c8ebedc414..85957a2eb49aad3f9fb57236133f0ac9011773f7 100644 (file)
@@ -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;
     }