#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;
#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);
#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);
}
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);
}
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]), [
#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
-
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);
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);
RunRegisteredHere(RegisteredRunner::finishShutdown);
-#if MEM_GEN_TRACE
-
- log_trace_done();
-
-#endif
-
if (IamPrimaryProcess()) {
if (Config.pidFilename && strcmp(Config.pidFilename, "none") != 0) {
enter_suid();
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;
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;
}