]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Remove CPU profiler mechanism (#931)
authorAmos Jeffries <yadij@users.noreply.github.com>
Thu, 11 Nov 2021 21:38:31 +0000 (21:38 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Fri, 12 Nov 2021 08:44:00 +0000 (08:44 +0000)
The old CPU profiler has not been updated in many years. As a result,
the statistics provided are deceptively incomplete and not sufficient
for their intended purpose of profiling Squids CPU usage. External tools
such as oprofile do a better job despite their differences and some
limitations.

48 files changed:
acinclude/os-deps.m4
compat/xalloc.cc
configure.ac
doc/release-notes/release-6.sgml
lib/Makefile.am
lib/hash.cc
lib/profiler/Makefile.am [deleted file]
lib/profiler/Profiler.cc [deleted file]
lib/profiler/Profiler.h [deleted file]
lib/profiler/get_tick.h [deleted file]
lib/profiler/xprof_type.h [deleted file]
scripts/source-maintenance.sh
squid.dox
src/Common.am
src/HttpHeader.cc
src/Makefile.am
src/MemBuf.cc
src/MemObject.cc
src/ProfStats.cc [deleted file]
src/String.cc
src/acl/Acl.cc
src/acl/Checklist.cc
src/client_side.cc
src/client_side_request.cc
src/comm.cc
src/comm/ModDevPoll.cc
src/comm/ModEpoll.cc
src/comm/ModPoll.cc
src/comm/TcpAcceptor.cc
src/comm/Write.cc
src/esi/Esi.cc
src/esi/Expression.cc
src/event.cc
src/fd.cc
src/fs_io.cc
src/http.cc
src/http/Message.cc
src/http/one/RequestParser.cc
src/http/one/ResponseParser.cc
src/main.cc
src/mime_header.cc
src/servers/Http1Server.cc
src/stmem.cc
src/store.cc
src/store/Controller.cc
src/store/Disks.cc
src/store_client.cc
src/wordlist.h

index 0baf42bc3bd6255cece0530d6001f3f0b7781747..3b2e702c6c9fdb161a1129668c37707fda52b6fd 100644 (file)
@@ -785,33 +785,6 @@ AC_DEFUN([SQUID_CHECK_SETRESUID_WORKS],[
   )
 ])
 
-dnl check that we have functional CPU clock access for the profiler
-dnl sets squid_cv_profiler_works to "yes" or "no"
-
-AC_DEFUN([SQUID_CHECK_FUNCTIONAL_CPU_PROFILER],[
-  AC_CACHE_CHECK([for operational CPU clock access], 
-                 squid_cv_cpu_profiler_works,
-    AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
-#include <ctime>
-#if defined(__GNUC__) && ( defined(__i386) || defined(__i386__) )
-// okay
-#elif defined(__GNUC__) && ( defined(__x86_64) || defined(__x86_64__) )
-// okay
-#elif defined(__GNUC__) && defined(__alpha)
-// okay
-#elif defined(_M_IX86) && defined(_MSC_VER) /* x86 platform on Microsoft C Compiler ONLY */
-// okay
-#elif defined(HAVE_CLOCK_GETTIME_NSEC_NP) && defined(CLOCK_MONOTONIC_RAW)
-// okay
-#else
-#error This CPU is unsupported. No profiling available here.
-#endif
-  ]])],[
-  squid_cv_cpu_profiler_works=yes],[
-  squid_cv_cpu_profiler_works=no])
-  )
-])
-
 dnl check whether recv takes a char* or void* as a second argument
 AC_DEFUN([SQUID_CHECK_RECV_ARG_TYPE],[
   AC_CACHE_CHECK([whether recv takes a pointer to void or char as second argument],
index 0fa94f9f79915bdd6a92cf08ef82e492ad6dd488..e94caaf4c3ef0a924dfdc2686822985147c3befb 100644 (file)
@@ -8,7 +8,6 @@
 
 #include "squid.h"
 #include "compat/xalloc.h"
-#include "profiler/Profiler.h"
 
 #if XMALLOC_STATISTICS
 #define XMS_DBG_MAXSIZE   (1024*1024)
@@ -71,17 +70,13 @@ malloc_statistics(void (*func) (int, int, int, void *), void *data)
 void *
 xcalloc(size_t n, size_t sz)
 {
-    PROF_start(xcalloc);
-
     if (n < 1)
         n = 1;
 
     if (sz < 1)
         sz = 1;
 
-    PROF_start(calloc);
     void *p = calloc(n, sz);
-    PROF_stop(calloc);
 
     if (p == NULL) {
         if (failure_notify) {
@@ -98,21 +93,16 @@ xcalloc(size_t n, size_t sz)
     malloc_stat(sz * n);
 #endif
 
-    PROF_stop(xcalloc);
     return p;
 }
 
 void *
 xmalloc(size_t sz)
 {
-    PROF_start(xmalloc);
-
     if (sz < 1)
         sz = 1;
 
-    PROF_start(malloc);
     void *p = malloc(sz);
-    PROF_stop(malloc);
 
     if (p == NULL) {
         if (failure_notify) {
@@ -129,21 +119,16 @@ xmalloc(size_t sz)
     malloc_stat(sz);
 #endif
 
-    PROF_stop(xmalloc);
     return (p);
 }
 
 void *
 xrealloc(void *s, size_t sz)
 {
-    PROF_start(xrealloc);
-
     if (sz < 1)
         sz = 1;
 
-    PROF_start(realloc);
     void *p= realloc(s, sz);
-    PROF_stop(realloc);
 
     if (p == NULL) {
         if (failure_notify) {
@@ -161,7 +146,6 @@ xrealloc(void *s, size_t sz)
     malloc_stat(sz);
 #endif
 
-    PROF_stop(xrealloc);
     return (p);
 }
 
@@ -170,10 +154,6 @@ free_const(const void *s_const)
 {
     void *s = const_cast<void *>(s_const);
 
-    PROF_start(free_const);
-    PROF_start(free);
     free(s);
-    PROF_stop(free);
-    PROF_stop(free_const);
 }
 
index 97114ae64e240b1011e2638b9e6a2420b7d88d99..59e0775e9df29c477319a30ad89835961bb5e0df 100644 (file)
@@ -2636,36 +2636,6 @@ SQUID_DEFINE_BOOL(PRINT_STACK_TRACE,${enable_stacktraces:=no},
                       [Print stack traces on fatal errors])
 AC_MSG_NOTICE([Automatically print stack trace on fatal errors: $enable_stacktraces])
 
-
-# CPU Profiling options handling
-AC_ARG_ENABLE(cpu-profiling,
-  AS_HELP_STRING([--enable-cpu-profiling],
-                 [Enable instrumentation to try and understand how CPU power 
-                 is spent by squid, by enabling specific probes in selected
-                 functions.
-                 New probes can only be added by modifying the source code.
-                 It is meant to help developers in optimizing performance
-                 of Squid internal functions.
-                 If you are not developer you should not enable this, 
-                 as it slows squid down somewhat.
-                 See lib/Profiler.c for more details.]), [
-SQUID_YESNO([$enableval],
-            [unrecognized argument to --enable-cpu-profiling: $enableval])
-])
-# Default OFF. This is a debug feature. Only check and enable if forced ON.
-if test "x$enable_cpu_profiling" = "xyes"; then
-  AC_CHECK_FUNCS(clock_gettime_nsec_np)
-  SQUID_CHECK_FUNCTIONAL_CPU_PROFILER
-  if test "x$squid_cv_cpu_profiler_works" = "xno"; then
-    AC_MSG_ERROR([CPU profiling will not be functional in this build.])
-  fi
-fi
-SQUID_DEFINE_BOOL(USE_XPROF_STATS,${enable_cpu_profiling:=no},
-                      [Define to enable CPU profiling within Squid])
-AM_CONDITIONAL(ENABLE_XPROF_STATS,
-               test "x$enable_cpu_profiling" = "xyes")
-AC_MSG_NOTICE([CPU profiling enabled: $enable_cpu_profiling])
-
 # Enable X-Accelerator-Vary for Vary support within an accelerator setup
 AC_ARG_ENABLE(x-accelerator-vary,
   AS_HELP_STRING([--enable-x-accelerator-vary],
@@ -3673,7 +3643,6 @@ AC_CONFIG_FILES([
        lib/libTrie/Makefile
        lib/libTrie/test/Makefile
        lib/ntlmauth/Makefile
-       lib/profiler/Makefile
        lib/rfcnb/Makefile
        lib/smblib/Makefile
        lib/snmplib/Makefile
index 6eda43731d0a65d342fe5eb9c1c993253a333b53..25b1bd2a4708ac41e9433969217f807df453d88b 100644 (file)
@@ -119,7 +119,9 @@ This section gives an account of those changes in three categories:
 <sect1>Removed options<label id="removedoptions">
 <p>
 <descrip>
-       <p>There have been no options changed.
+       <tag>--enable-cpu-profiling</tag>
+       <p>This feature has been unreliable for many years. Other tools such as
+          oprofile provide better tracking and should be used instead.
 
 </descrip>
 
index cc392be4c0adb981cf97ae29c899be66c58ce361..d622354e5ce1a442c812509aec8a84383d1f60c5 100644 (file)
@@ -7,7 +7,7 @@
 
 include $(top_srcdir)/src/Common.am
 
-DIST_SUBDIRS = ntlmauth profiler rfcnb smblib libTrie snmplib
+DIST_SUBDIRS = ntlmauth rfcnb smblib libTrie snmplib
 SUBDIRS=
 EXTRA_DIST=
 
@@ -17,9 +17,6 @@ endif
 if ENABLE_SNMP
 SUBDIRS += snmplib
 endif
-if ENABLE_XPROF_STATS
-SUBDIRS += profiler
-endif
 
 install: all
 install-strip: all
index 64c2a70ac7a9f10b72a38111679046903b36e0ea..4c8e51c45bc72a2b9892ae206b023983f11f93d7 100644 (file)
@@ -10,7 +10,6 @@
 
 #include "squid.h"
 #include "hash.h"
-#include "profiler/Profiler.h"
 
 #include <cassert>
 #include <cmath>
@@ -147,17 +146,14 @@ hash_link *
 hash_lookup(hash_table * hid, const void *k)
 {
     int b;
-    PROF_start(hash_lookup);
     assert(k != NULL);
     b = hid->hash(k, hid->size);
     for (hash_link *walker = hid->buckets[b]; walker != NULL; walker = walker->next) {
         if ((hid->cmp) (k, walker->key) == 0) {
-            PROF_stop(hash_lookup);
             return (walker);
         }
         assert(walker != walker->next);
     }
-    PROF_stop(hash_lookup);
     return NULL;
 }
 
diff --git a/lib/profiler/Makefile.am b/lib/profiler/Makefile.am
deleted file mode 100644 (file)
index bb14e79..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-## Copyright (C) 1996-2021 The Squid Software Foundation and contributors
-##
-## Squid software is distributed under GPLv2+ license and includes
-## contributions from numerous individuals and organizations.
-## Please see the COPYING and CONTRIBUTORS files for details.
-##
-
-include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
-
-XPROFSRC= \
-       get_tick.h \
-       Profiler.cc \
-       Profiler.h \
-       xprof_type.h
-
-if ENABLE_XPROF_STATS
-libprofiler_la_SOURCES = $(XPROFSRC)
-noinst_LTLIBRARIES = libprofiler.la
-else
-EXTRA_DIST = $(XPROFSRC)
-endif
diff --git a/lib/profiler/Profiler.cc b/lib/profiler/Profiler.cc
deleted file mode 100644 (file)
index e00afaa..0000000
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
- *
- * Squid software is distributed under GPLv2+ license and includes
- * contributions from numerous individuals and organizations.
- * Please see the COPYING and CONTRIBUTORS files for details.
- */
-
-/* DEBUG: section 81    CPU Profiling Routines */
-
-/**
- * CPU Profiling implementation.
- *
- * \par
- *  This library implements the Probes needed to gather stats.
- *  See src/ProfStats.c which implements historical recording and
- *  presentation in CacheMgr.cgi.
- *
- * \par
- *  For timing we prefer on-CPU ops that retrieve cpu ticks counter.
- *  For Intel, this is "rdtsc", which is 64-bit counter that virtually
- *  never wraps. For alpha, this is "rpcc" which is 32-bit counter and
- *  wraps every few seconds. Currently, no handling of wrapping counters
- *  is implemented. Other CPU's are also not covered. Potentially all
- *  modern CPU's has similar counters.
- *
- * Usage.
- *  Insert macro PROF_state(probename) in strategic places in code.
- *    PROF_start(probename);
- *     ...  section of code measured ...
- *    PROF_stop(probename);
- *
- *   probename must be added to the xprof_type.h enum list
- *   with prepended "XPROF_" string.
- *
- * \section description Description.
- * \par PROF
- *  gathers stats per probename into structures. It indexes these
- *  structures by enum type index in an array.
- *
- * \par PROF
- *  records best, best, average and worst values for delta time,
- *  also, if UNACCED is defined, it measures "empty" time during which
- *  no probes are in measuring state. This allows to see time "unaccounted"
- *  for. If OVERHEAD is defined, additional calculations are made at every
- *  probe to measure approximate overhead of the probe code itself.
- *
- * \par
- *  Probe data is stored in linked-list, so the more probes you define,
- *  the more overhead is added to find the deepest nested probe. To reduce
- *  average overhead, linked list is manipulated each time PR_start is
- *  called, so that probe just started is moved 1 position up in linkedlist.
- *  This way frequently used probes are moved closer to the head of list,
- *  reducing average overhead.
- *  Note that all overhead is on the scale of one hundred of CPU clock
- *  ticks, which on the scale of submicroseconds. Yet, to optimise really
- *  fast and frequent sections of code, we want to reduce this overhead
- *  to absolute minimum possible.
- *
- * \par
- *  For actual measurements, probe overhead cancels out mostly. Still,
- *  do not take the measured times as facts, they should be viewed in
- *  relative comparison to overall CPU time and on the same platform.
- *
- * \par
- *  Every 1 second, Event within squid is called that parses gathered
- *  statistics of every probe, and accumulates that into historical
- *  structures for last 1,5,30 secs, 1,5,30 mins, and 1,5 and 24 hours.
- *  Each second active probe stats are reset, and only historical data
- *  is presented in cachemgr output.
- *
- * \section reading Reading stats.
- * \par
- *  "Worst case" may be misleading. Anything can happen at any section
- *  of code that could delay reaching to probe stop. For eg. system may
- *  need to service interrupt routine, task switch could occur, or page
- *  fault needs to be handled. In this sense, this is quite meaningless
- *  metric. "Best case" shows fastest completion of probe section, and
- *  is also somewhat useless, unless you know that amount of work is
- *  constant. Best metric to watch is "average time" and total cumulated
- *  time in given timeframe, which really show percentage of time spent
- *  in given section of code, and its average completion time. This data
- *  could be used to detect bottlenecks within squid and optimise them.
- *
- * \par
- *  TOTALS are quite off reality. Its there just to summarise cumulative
- *  times and percent column. Percent values over 100% shows that there
- *  have been some probes nested into each other.
- *
- */
-
-#include "squid.h"
-#include "profiler/Profiler.h"
-
-#if USE_XPROF_STATS
-
-#include <cassert>
-#if HAVE_GNUMALLLOC_H
-#include <gnumalloc.h>
-#elif HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-/* Exported Data */
-TimersArray *xprof_Timers = NULL;
-
-/* Private stuff */
-
-/* new stuff */
-#define MAXSTACKDEPTH   512
-
-struct _callstack_entry {
-    int timer;      /* index into timers array */
-    const char *name;
-    hrtime_t start, stop, accum;
-};
-
-struct _callstack_entry cstack[MAXSTACKDEPTH];
-int cstack_head = 0;
-
-#if defined(_MSC_VER) /* Microsoft C Compiler ONLY */
-static __inline void
-#else
-static inline void
-#endif
-xprof_update(xprof_stats_data * head)
-{
-    if (head->delta < head->best)
-        head->best = head->delta;
-    if (head->worst < head->delta)
-        head->worst = head->delta;
-    head->summ += head->delta;
-    ++head->count;
-}
-
-static xprof_stats_data *xp_UNACCOUNTED;
-static int xprof_inited = 0;
-
-static void
-xprof_InitLib(void)
-{
-    if (xprof_inited)
-        return;
-
-    xprof_Timers = static_cast<TimersArray *>(calloc(XPROF_LAST + 2, sizeof(xprof_stats_node)));
-
-    xprof_Timers[XPROF_PROF_UNACCOUNTED]->name = "PROF_UNACCOUNTED";
-    xprof_Timers[XPROF_PROF_UNACCOUNTED]->accu.start = get_tick();
-    xp_UNACCOUNTED = &xprof_Timers[XPROF_PROF_UNACCOUNTED]->accu;
-    cstack_head = 0;
-    xprof_inited = 1;
-}
-
-void
-xprof_start(xprof_type type, const char *timer)
-{
-    hrtime_t tt = get_tick();
-    if (!xprof_inited)
-        xprof_InitLib();
-
-    /* If nested, stop current stack frame */
-    if (cstack_head > 0) {
-        cstack[cstack_head - 1].accum += get_tick() - cstack[cstack_head - 1].start;
-        cstack[cstack_head - 1].start = -1;
-    }
-
-    /* Are we at the first level? If so; stop the unaccounted timer */
-    if (cstack_head == 0) {
-        assert(xp_UNACCOUNTED->start != -1);
-        xp_UNACCOUNTED->delta = tt - xp_UNACCOUNTED->start;
-        xp_UNACCOUNTED->start = -1;
-        xprof_update(xp_UNACCOUNTED);
-    }
-
-    /* Allocate new stack frame */
-    cstack[cstack_head].start = tt;
-    cstack[cstack_head].stop = -1;
-    cstack[cstack_head].accum = 0;
-    cstack[cstack_head].timer = type;
-    cstack[cstack_head].name = timer;
-    ++cstack_head;
-    assert(cstack_head < MAXSTACKDEPTH);
-
-}
-
-void
-xprof_stop(xprof_type type, const char *timer)
-{
-    hrtime_t tt = get_tick();
-    assert(cstack_head > 0);
-    --cstack_head;
-    assert(cstack[cstack_head].timer == type);
-
-    /* Record timer details */
-    cstack[cstack_head].accum += tt - cstack[cstack_head].start;
-    xprof_Timers[type]->accu.delta = cstack[cstack_head].accum;
-    xprof_Timers[type]->name = timer;
-
-    /* Update */
-    xprof_update(&xprof_Timers[type]->accu);
-
-    /* Restart previous timer if we're not at the top level */
-    if (cstack_head > 0) {
-        cstack[cstack_head - 1].start = tt;
-        cstack[cstack_head - 1].stop = 0;
-        return;
-    }
-    /* Get here? We're at the top level; unaccounted */
-    xp_UNACCOUNTED->start = tt;
-}
-
-#endif /* USE_XPROF_STATS */
-
diff --git a/lib/profiler/Profiler.h b/lib/profiler/Profiler.h
deleted file mode 100644 (file)
index 2d11d36..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
- *
- * Squid software is distributed under GPLv2+ license and includes
- * contributions from numerous individuals and organizations.
- * Please see the COPYING and CONTRIBUTORS files for details.
- */
-
-#ifndef _PROFILER_H_
-#define _PROFILER_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// NP: CPU support for get_tick() determines whether we can profile.
-//     always include get_tick.h first since it may undefine USE_XPROF_STATS
-
-#include "profiler/get_tick.h"
-#include "profiler/xprof_type.h"
-
-#if !USE_XPROF_STATS
-
-#define PROF_start(probename) ((void)0)
-#define PROF_stop(probename) ((void)0)
-
-#else /* USE_XPROF_STATS */
-
-#define XP_NOBEST (hrtime_t)-1
-
-typedef struct _xprof_stats_node xprof_stats_node;
-
-typedef struct _xprof_stats_data xprof_stats_data;
-
-struct _xprof_stats_data {
-    hrtime_t start;
-    hrtime_t stop;
-    hrtime_t delta;
-    hrtime_t best;
-    hrtime_t worst;
-    hrtime_t count;
-    hrtime_t accum;
-    int64_t summ;
-};
-
-struct _xprof_stats_node {
-    const char *name;
-    xprof_stats_data accu;
-    xprof_stats_data hist;
-};
-
-typedef xprof_stats_node TimersArray[1];
-
-/* public Data */
-extern TimersArray *xprof_Timers;
-
-/* Exported functions */
-extern void xprof_start(xprof_type type, const char *timer);
-extern void xprof_stop(xprof_type type, const char *timer);
-extern void xprof_event(void *data);
-
-#define PROF_start(probename) xprof_start(XPROF_##probename, #probename)
-#define PROF_stop(probename) xprof_stop(XPROF_##probename, #probename)
-
-#endif /* USE_XPROF_STATS */
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* _PROFILING_H_ */
-
diff --git a/lib/profiler/get_tick.h b/lib/profiler/get_tick.h
deleted file mode 100644 (file)
index 25b193e..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
- *
- * Squid software is distributed under GPLv2+ license and includes
- * contributions from numerous individuals and organizations.
- * Please see the COPYING and CONTRIBUTORS files for details.
- */
-
-#ifndef _PROFILER_GET_TICK_H_
-#define _PROFILER_GET_TICK_H_
-
-#if USE_XPROF_STATS
-#include <ctime>
-
-/*
- * Ensure that any changes here are synchronised with SQUID_CHECK_FUNCTIONAL_CPU_PROFILER
- */
-
-#if !_SQUID_SOLARIS_
-typedef int64_t  hrtime_t;
-#endif
-
-#if defined(__GNUC__) && ( defined(__i386) || defined(__i386__) )
-static inline hrtime_t
-get_tick(void)
-{
-    hrtime_t regs;
-
-    asm volatile ("rdtsc":"=A" (regs));
-    return regs;
-    /* We need return value, we rely on CC to optimise out needless subf calls */
-    /* Note that "rdtsc" is relatively slow OP and stalls the CPU pipes, so use it wisely */
-}
-
-#elif defined(__GNUC__) && ( defined(__x86_64) || defined(__x86_64__) )
-static inline hrtime_t
-get_tick(void)
-{
-    uint32_t lo, hi;
-    // Based on an example in Wikipedia
-    /* We cannot use "=A", since this would use %rax on x86_64 */
-    asm volatile ("rdtsc" : "=a" (lo), "=d" (hi));
-    return (hrtime_t)hi << 32 | lo;
-}
-
-#elif defined(__GNUC__) && defined(__alpha)
-static inline hrtime_t
-get_tick(void)
-{
-    hrtime_t regs;
-
-    asm volatile ("rpcc %0" : "=r" (regs));
-    return regs;
-}
-
-#elif defined(_M_IX86) && defined(_MSC_VER) /* x86 platform on Microsoft C Compiler ONLY */
-static __inline hrtime_t
-get_tick(void)
-{
-    hrtime_t regs;
-
-    __asm {
-        cpuid
-        rdtsc
-        mov eax,DWORD PTR regs[0]
-        mov edx,DWORD PTR regs[4]
-    }
-    return regs;
-}
-
-#elif defined(HAVE_CLOCK_GETTIME_NSEC_NP) && defined(CLOCK_MONOTONIC_RAW)
-
-static inline hrtime_t
-get_tick()
-{
-    return clock_gettime_nsec_np(CLOCK_MONOTONIC_RAW);
-}
-
-#else
-/* This CPU is unsupported. Short-circuit, no profiling here */
-// #error for configure tests to prevent library construction
-#error This CPU is unsupported. No profiling available here.
-#endif
-
-#endif /* USE_XPROF_STATS */
-#endif /* _PROFILING_H_ */
-
diff --git a/lib/profiler/xprof_type.h b/lib/profiler/xprof_type.h
deleted file mode 100644 (file)
index 519264a..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
- *
- * Squid software is distributed under GPLv2+ license and includes
- * contributions from numerous individuals and organizations.
- * Please see the COPYING and CONTRIBUTORS files for details.
- */
-
-#ifndef _PROFILER_XPROF_TYPE_H_
-#define _PROFILER_XPROF_TYPE_H_
-/* AUTO-GENERATED FILE */
-#if USE_XPROF_STATS
-typedef enum {
-    XPROF_PROF_UNACCOUNTED,
-    XPROF_aclCheckFast,
-    XPROF_ACL_matches,
-    XPROF_calloc,
-    XPROF_clientSocketRecipient,
-    XPROF_comm_accept,
-    XPROF_comm_check_incoming,
-    XPROF_comm_close,
-    XPROF_comm_connect_addr,
-    XPROF_comm_handle_ready_fd,
-    XPROF_commHandleWrite,
-    XPROF_comm_open,
-    XPROF_comm_poll_normal,
-    XPROF_comm_poll_prep_pfds,
-    XPROF_comm_read_handler,
-    XPROF_comm_udp_sendto,
-    XPROF_comm_write_handler,
-    XPROF_diskHandleRead,
-    XPROF_diskHandleWrite,
-    XPROF_esiExpressionEval,
-    XPROF_esiParsing,
-    XPROF_esiProcessing,
-    XPROF_eventRun,
-    XPROF_file_close,
-    XPROF_file_open,
-    XPROF_file_read,
-    XPROF_file_write,
-    XPROF_free,
-    XPROF_free_const,
-    XPROF_hash_lookup,
-    XPROF_headersEnd,
-    XPROF_HttpHeaderClean,
-    XPROF_HttpHeader_getCc,
-    XPROF_HttpHeaderParse,
-    XPROF_HttpMsg_httpMsgParseStep,
-    XPROF_HttpParserParseReplyLine,
-    XPROF_HttpParserParseReqLine,
-    XPROF_httpRequestFree,
-    XPROF_HttpServer_parseOneRequest,
-    XPROF_httpStart,
-    XPROF_HttpStateData_processReplyBody,
-    XPROF_HttpStateData_processReplyHeader,
-    XPROF_InvokeHandlers,
-    XPROF_malloc,
-    XPROF_MemBuf_append,
-    XPROF_MemBuf_consume,
-    XPROF_MemBuf_consumeWhitespace,
-    XPROF_MemBuf_grow,
-    XPROF_mem_hdr_write,
-    XPROF_MemObject_write,
-    XPROF_PROF_OVERHEAD,
-    XPROF_read,
-    XPROF_realloc,
-    XPROF_recv,
-    XPROF_send,
-    XPROF_SignalEngine_checkEvents,
-    XPROF_storeClient_kickReads,
-    XPROF_storeDirCallback,
-    XPROF_StoreEntry_write,
-    XPROF_storeGetMemSpace,
-    XPROF_storeMaintainSwapSpace,
-    XPROF_storeRelease,
-    XPROF_StringAllocAndFill,
-    XPROF_StringAppend,
-    XPROF_StringClean,
-    XPROF_StringInitBuf,
-    XPROF_StringReset,
-    XPROF_write,
-    XPROF_xcalloc,
-    XPROF_xmalloc,
-    XPROF_xrealloc,
-    XPROF_LAST
-} xprof_type;
-#endif
-#endif
-
index ef6d2b23b65c045ec8687093627d0cea2dca0128..45d5fbba11e9cbebc945805bac45906e05740553 100755 (executable)
@@ -462,24 +462,6 @@ done
     run_ processDebugMessages || return
 }
 
-# Build XPROF types file from current sources
-(
-cat scripts/boilerplate.h
-echo "#ifndef _PROFILER_XPROF_TYPE_H_"
-echo "#define _PROFILER_XPROF_TYPE_H_"
-echo "/* AUTO-GENERATED FILE */"
-echo "#if USE_XPROF_STATS"
-echo "typedef enum {"
-echo "    XPROF_PROF_UNACCOUNTED,"
-grep -R -h "PROF_start.*" ./* | grep -v probename | sed -e 's/ //g; s/PROF_start(/    XPROF_/; s/);/,/;' | sort -u
-echo "    XPROF_LAST"
-echo "} xprof_type;"
-echo "#endif"
-echo "#endif"
-echo ""
-) >lib/profiler/list
-mv lib/profiler/list lib/profiler/xprof_type.h
-
 printAmFile ()
 {
     sed -e 's%\ \*%##%; s%/\*%##%; s%##/%##%' < scripts/boilerplate.h
index 9a8ad430c7ab5fc41eb7e19e262bcda6acafc0b8..e455e40dec70ae63197208cf8ccd39459d293de4 100644 (file)
--- a/squid.dox
+++ b/squid.dox
@@ -2110,7 +2110,6 @@ PREDEFINED             = __cplusplus \
                          USE_WCCP \
                          USE_WCCPv2 \
                          USE_WIN32_SERVICE \
-                         USE_XPROF_STATS \
                          WITH_VALGRIND \
                          X_ACCELERATOR_VARY
 
index a27138281d2b92f2945745cbc4a820dab21bb3b4..cb4a5915731c69a1de1d4eec81e97090f9684613 100644 (file)
@@ -68,13 +68,6 @@ endif
 ## XXX: Do we really need this? Does auto-dependency tracking work?
 $(OBJS): $(top_srcdir)/include/version.h $(top_builddir)/include/autoconf.h
 
-## Internal profiler is used even by some of the compat library stuff.
-if ENABLE_XPROF_STATS
-LIBPROFILER = $(top_builddir)/lib/profiler/libprofiler.la
-else
-LIBPROFILER=
-endif
-
 ## Because compatibility is almost universal. And the link order is important.
 COMPAT_LIB = $(top_builddir)/compat/libcompatsquid.la $(LIBPROFILER)
 
index 6508f89aa40554051e5031d018d5f6328f2a1d2e..eb8c998980a6648fe622b04105ae073c1f3e7603 100644 (file)
@@ -24,7 +24,6 @@
 #include "MemBuf.h"
 #include "mgr/Registration.h"
 #include "mime_header.h"
-#include "profiler/Profiler.h"
 #include "rfc1123.h"
 #include "sbuf/StringConvert.h"
 #include "SquidConfig.h"
@@ -193,8 +192,6 @@ HttpHeader::clean()
     assert(owner > hoNone && owner < hoEnd);
     debugs(55, 7, "cleaning hdr: " << this << " owner: " << owner);
 
-    PROF_start(HttpHeaderClean);
-
     if (owner <= hoReply) {
         /*
          * An unfortunate bug.  The entries array is initialized
@@ -231,7 +228,6 @@ HttpHeader::clean()
     len = 0;
     conflictingContentLength_ = false;
     teUnsupported_ = false;
-    PROF_stop(HttpHeaderClean);
 }
 
 /* append entries (also see httpHeaderUpdate) */
@@ -384,8 +380,6 @@ HttpHeader::parse(const char *header_start, size_t hdrLen, Http::ContentLengthIn
     const char *header_end = header_start + hdrLen; // XXX: remove
     int warnOnError = (Config.onoff.relaxed_header_parser <= 0 ? DBG_IMPORTANT : 2);
 
-    PROF_start(HttpHeaderParse);
-
     assert(header_start && header_end);
     debugs(55, 7, "parsing hdr: (" << this << ")" << std::endl << getStringPrefix(header_start, hdrLen));
     ++ HttpHeaderStats[owner].parsedCount;
@@ -394,7 +388,6 @@ HttpHeader::parse(const char *header_start, size_t hdrLen, Http::ContentLengthIn
     if ((nulpos = (char*)memchr(header_start, '\0', hdrLen))) {
         debugs(55, DBG_IMPORTANT, "WARNING: HTTP header contains NULL characters {" <<
                getStringPrefix(header_start, nulpos-header_start) << "}\nNULL\n{" << getStringPrefix(nulpos+1, hdrLen-(nulpos-header_start)-1));
-        PROF_stop(HttpHeaderParse);
         clean();
         return 0;
     }
@@ -414,7 +407,6 @@ HttpHeader::parse(const char *header_start, size_t hdrLen, Http::ContentLengthIn
 
             if (!field_ptr) {
                 // missing <LF>
-                PROF_stop(HttpHeaderParse);
                 clean();
                 return 0;
             }
@@ -436,7 +428,6 @@ HttpHeader::parse(const char *header_start, size_t hdrLen, Http::ContentLengthIn
                         debugs(55, DBG_IMPORTANT, "SECURITY WARNING: Rejecting HTTP request with a CR+ "
                                "header field to prevent request smuggling attacks: {" <<
                                getStringPrefix(header_start, hdrLen) << "}");
-                        PROF_stop(HttpHeaderParse);
                         clean();
                         return 0;
                     }
@@ -457,7 +448,6 @@ HttpHeader::parse(const char *header_start, size_t hdrLen, Http::ContentLengthIn
                         ++p;
                     }
                 } else {
-                    PROF_stop(HttpHeaderParse);
                     clean();
                     return 0;
                 }
@@ -466,7 +456,6 @@ HttpHeader::parse(const char *header_start, size_t hdrLen, Http::ContentLengthIn
             if (this_line + 1 == field_end && this_line > field_start) {
                 debugs(55, warnOnError, "WARNING: Blank continuation line in HTTP header {" <<
                        getStringPrefix(header_start, hdrLen) << "}");
-                PROF_stop(HttpHeaderParse);
                 clean();
                 return 0;
             }
@@ -476,7 +465,6 @@ HttpHeader::parse(const char *header_start, size_t hdrLen, Http::ContentLengthIn
             if (field_ptr < header_end) {
                 debugs(55, warnOnError, "WARNING: unparsable HTTP header field near {" <<
                        getStringPrefix(field_start, hdrLen-(field_start-header_start)) << "}");
-                PROF_stop(HttpHeaderParse);
                 clean();
                 return 0;
             }
@@ -490,7 +478,6 @@ HttpHeader::parse(const char *header_start, size_t hdrLen, Http::ContentLengthIn
                    getStringPrefix(field_start, field_end-field_start) << "}");
             debugs(55, warnOnError, " in {" << getStringPrefix(header_start, hdrLen) << "}");
 
-            PROF_stop(HttpHeaderParse);
             clean();
             return 0;
         }
@@ -501,7 +488,6 @@ HttpHeader::parse(const char *header_start, size_t hdrLen, Http::ContentLengthIn
                 if (!hasBareCr) // already warned about bare CRs
                     debugs(55, warnOnError, "WARNING: obs-fold in framing-sensitive " << e->name << ": " << e->value);
                 delete e;
-                PROF_stop(HttpHeaderParse);
                 clean();
                 return 0;
             }
@@ -513,7 +499,6 @@ HttpHeader::parse(const char *header_start, size_t hdrLen, Http::ContentLengthIn
             if (Config.onoff.relaxed_header_parser)
                 continue; // clen has printed any necessary warnings
 
-            PROF_stop(HttpHeaderParse);
             clean();
             return 0;
         }
@@ -574,7 +559,6 @@ HttpHeader::parse(const char *header_start, size_t hdrLen, Http::ContentLengthIn
         }
     }
 
-    PROF_stop(HttpHeaderParse);
     return 1;           /* even if no fields where found, it is a valid header */
 }
 
@@ -1239,7 +1223,6 @@ HttpHeader::getCc() const
 {
     if (!CBIT_TEST(mask, Http::HdrType::CACHE_CONTROL))
         return NULL;
-    PROF_start(HttpHeader_getCc);
 
     String s;
     getList(Http::HdrType::CACHE_CONTROL, &s);
@@ -1258,8 +1241,6 @@ HttpHeader::getCc() const
 
     httpHeaderNoteParsedEntry(Http::HdrType::CACHE_CONTROL, s, !cc);
 
-    PROF_stop(HttpHeader_getCc);
-
     return cc;
 }
 
index e4c618c1c4ede62e5065761192f343bb1072684e..d9f3a08b9e52f063878b7811ff90f252436012d3 100644 (file)
@@ -124,12 +124,6 @@ else
 DELAY_POOL_SOURCE =
 endif
 
-if ENABLE_XPROF_STATS
-XPROF_STATS_SOURCE = ProfStats.cc
-else
-XPROF_STATS_SOURCE =
-endif
-
 if ENABLE_HTCP
 HTCPSOURCE = htcp.cc htcp.h
 endif
@@ -220,7 +214,6 @@ squid_SOURCES = \
        $(UNLINKDSOURCE) \
        $(WIN32_SOURCE) \
        $(WINSVC_SOURCE) \
-       $(XPROF_STATS_SOURCE) \
        AccessLogEntry.cc \
        AccessLogEntry.h \
        AsyncEngine.cc \
@@ -494,7 +487,6 @@ EXTRA_squid_SOURCES = \
        $(WIN32_ALL_SOURCE) \
        $(all_AUTHMODULES) \
        ConfigOption.h \
-       ProfStats.cc \
        htcp.cc \
        htcp.h \
        ipc.cc \
index b570af6443c5232e4bef7a1c6295ce0067b2a28d..570eb97192dc62f55e6bf2ced01ec051f3994b47 100644 (file)
@@ -74,7 +74,6 @@
 #include "squid.h"
 #include "mem/forward.h"
 #include "MemBuf.h"
-#include "profiler/Profiler.h"
 
 /* local constants */
 
@@ -174,7 +173,6 @@ void MemBuf::consume(mb_size_t shiftSize)
     assert(0 <= shiftSize && shiftSize <= cSize);
     assert(!stolen); /* not frozen */
 
-    PROF_start(MemBuf_consume);
     if (shiftSize > 0) {
         if (shiftSize < cSize)
             memmove(buf, buf + shiftSize, cSize - shiftSize);
@@ -183,13 +181,11 @@ void MemBuf::consume(mb_size_t shiftSize)
 
         terminate();
     }
-    PROF_stop(MemBuf_consume);
 }
 
 /// removes all whitespace prefix bytes and "packs" by moving content left
 void MemBuf::consumeWhitespacePrefix()
 {
-    PROF_start(MemBuf_consumeWhitespace);
     if (contentSize() > 0) {
         const char *end = buf + contentSize();
         const char *p = buf;
@@ -197,7 +193,6 @@ void MemBuf::consumeWhitespacePrefix()
         if (p-buf > 0)
             consume(p-buf);
     }
-    PROF_stop(MemBuf_consumeWhitespace);
 }
 
 // removes last tailSize bytes
@@ -219,7 +214,6 @@ void MemBuf::append(const char *newContent, int sz)
     assert(buf || (0==capacity && 0==size));
     assert(!stolen); /* not frozen */
 
-    PROF_start(MemBuf_append);
     if (sz > 0) {
         if (size + sz + 1 > capacity)
             grow(size + sz + 1);
@@ -228,7 +222,6 @@ void MemBuf::append(const char *newContent, int sz)
         memcpy(space(), newContent, sz);
         appended(sz);
     }
-    PROF_stop(MemBuf_append);
 }
 
 /// updates content size after external append
@@ -332,8 +325,6 @@ MemBuf::grow(mb_size_t min_cap)
     assert(!stolen);
     assert(capacity < min_cap);
 
-    PROF_start(MemBuf_grow);
-
     /* determine next capacity */
 
     if (min_cap > 64 * 1024) {
@@ -359,7 +350,6 @@ MemBuf::grow(mb_size_t min_cap)
 
     /* done */
     capacity = (mb_size_t) buf_cap;
-    PROF_stop(MemBuf_grow);
 }
 
 /* Reports */
index 24d7b473001cee1fdb9fbc3e75b4e0c6d4f4073c..717b514ce489115a9e371eb42f22d10ac5c75cf1 100644 (file)
@@ -15,7 +15,6 @@
 #include "HttpReply.h"
 #include "MemBuf.h"
 #include "MemObject.h"
-#include "profiler/Profiler.h"
 #include "SquidConfig.h"
 #include "Store.h"
 #include "StoreClient.h"
@@ -138,7 +137,6 @@ MemObject::replaceBaseReply(const HttpReplyPointer &r)
 void
 MemObject::write(const StoreIOBuffer &writeBuffer)
 {
-    PROF_start(MemObject_write);
     debugs(19, 6, "memWrite: offset " << writeBuffer.offset << " len " << writeBuffer.length);
 
     /* We don't separate out mime headers yet, so ensure that the first
@@ -147,7 +145,6 @@ MemObject::write(const StoreIOBuffer &writeBuffer)
     assert (data_hdr.endOffset() || writeBuffer.offset == 0);
 
     assert (data_hdr.write (writeBuffer));
-    PROF_stop(MemObject_write);
 }
 
 void
diff --git a/src/ProfStats.cc b/src/ProfStats.cc
deleted file mode 100644 (file)
index 103780c..0000000
+++ /dev/null
@@ -1,310 +0,0 @@
-/*
- * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
- *
- * Squid software is distributed under GPLv2+ license and includes
- * contributions from numerous individuals and organizations.
- * Please see the COPYING and CONTRIBUTORS files for details.
- */
-
-/* DEBUG: section 81    CPU Profiling Routines */
-
-#include "squid.h"
-
-#if USE_XPROF_STATS
-
-#include "event.h"
-#include "mgr/Registration.h"
-#include "profiler/Profiler.h"
-#include "SquidMath.h"
-#include "Store.h"
-
-/* Private stuff */
-
-#define MAX_SORTLIST 200
-
-static hrtime_t xprof_delta = 0;
-static hrtime_t xprof_start_t = 0;
-static hrtime_t xprof_verystart = 0;
-static hrtime_t xprof_average_delta = 0;
-static int xprof_events = 0;
-static int xprof_inited = 0;
-static xprof_stats_data Totals;
-
-static TimersArray *xprof_stats_avg1sec = NULL;
-static TimersArray *xprof_stats_avg5sec = NULL;
-static TimersArray *xprof_stats_avg30sec = NULL;
-static TimersArray *xprof_stats_avg1min = NULL;
-static TimersArray *xprof_stats_avg5min = NULL;
-static TimersArray *xprof_stats_avg30min = NULL;
-static TimersArray *xprof_stats_avg1hour = NULL;
-static TimersArray *xprof_stats_avg5hour = NULL;
-static TimersArray *xprof_stats_avg24hour = NULL;
-
-static xprof_stats_node *sortlist[XPROF_LAST + 2];
-static void xprof_summary(StoreEntry * sentry);
-
-static void
-xprof_reset(xprof_stats_data * head)
-{
-    head->summ = 0;
-    head->count = 0;
-    head->delta = 0;
-    head->best = XP_NOBEST;
-    head->worst = 0;
-    head->start = 0;
-    head->stop = 0;
-}
-
-static void
-xprof_move(xprof_stats_data * head, xprof_stats_data * hist)
-{
-    memcpy(hist, head, sizeof(xprof_stats_data));
-}
-
-static int
-xprof_comp(const void *A, const void *B)
-{
-    const xprof_stats_node *ii = *(static_cast<const xprof_stats_node * const *>(A));
-    const xprof_stats_node *jj = *(static_cast<const xprof_stats_node * const *>(B));
-
-    if (ii->hist.summ < jj->hist.summ)
-        return (1);
-
-    if (ii->hist.summ > jj->hist.summ)
-        return (-1);
-
-    return (0);
-}
-
-static void
-xprof_sorthist(TimersArray * xprof_list)
-{
-    for (int i = 0; i < XPROF_LAST; ++i) {
-        sortlist[i] = xprof_list[i];
-    }
-
-    qsort(&sortlist[XPROF_PROF_UNACCOUNTED+1], XPROF_LAST - XPROF_PROF_UNACCOUNTED+1, sizeof(xprof_stats_node *), xprof_comp);
-}
-
-static double time_frame;
-
-static void
-xprof_show_item(StoreEntry * sentry, const char *name, xprof_stats_data * hist)
-{
-    storeAppendPrintf(sentry,
-                      "%s\t %" PRIu64 "\t %" PRIu64 "\t %" PRIu64 "\t %" PRIu64 "\t %" PRIu64 "\t %.2f\t %6.3f\t\n",
-                      name,
-                      hist->count,
-                      hist->summ,
-                      (hist->best != XP_NOBEST ? hist->best : 0),
-                      hist->count ? hist->summ / hist->count : 0,
-                      hist->worst,
-                      hist->count / time_frame,
-                      Math::doublePercent((double) hist->summ, (double) hist->delta));
-}
-
-static void
-xprof_summary_item(StoreEntry * sentry, char const *descr, TimersArray * list)
-{
-    int i;
-    xprof_stats_node **hist;
-    xprof_stats_data *show;
-    xprof_reset(&Totals);
-    xprof_sorthist(list);
-    hist = &sortlist[0];
-
-    show = &hist[0]->hist;
-
-    if (!hist[0]->hist.delta)
-        show = &hist[0]->accu;
-
-    time_frame = (double) show->delta / (double) xprof_average_delta;
-
-    storeAppendPrintf(sentry, "\n%s:", descr);
-
-    storeAppendPrintf(sentry, " (Cumulated time: %" PRIu64 ", %.2f sec)\n",
-                      show->delta,
-                      time_frame
-                     );
-
-    storeAppendPrintf(sentry,
-                      "Probe Name\t  Events\t cumulated time \t best case \t average \t worst case\t Rate / sec \t %% in int\n");
-
-    for (i = 0; i < XPROF_LAST; ++i) {
-        if (!hist[i]->name)
-            continue;
-
-        show = &hist[i]->hist;
-
-        if (!show->count)
-            continue;
-
-        xprof_show_item(sentry, hist[i]->name, show);
-
-        Totals.count += show->count;
-
-        Totals.summ += show->summ;
-
-        Totals.best += (show->best != XP_NOBEST ? show->best : 0);
-
-        Totals.worst += show->worst;
-
-        Totals.delta = (show->delta > Totals.delta ? show->delta : Totals.delta);
-    }
-
-    xprof_show_item(sentry, "TOTALS", &Totals);
-}
-
-static void
-xprof_average(TimersArray ** list, int secs)
-{
-    int i;
-    TimersArray *head = xprof_Timers;
-    TimersArray *hist;
-    hrtime_t now;
-    hrtime_t keep;
-    int doavg = (xprof_events % secs);
-
-    if (!*list)
-        *list = (TimersArray *)xcalloc(XPROF_LAST, sizeof(xprof_stats_node));
-
-    hist = *list;
-
-    now = get_tick();
-
-    for (i = 0; i < XPROF_LAST; ++i) {
-        hist[i]->name = head[i]->name;
-        hist[i]->accu.summ += head[i]->accu.summ;
-        hist[i]->accu.count += head[i]->accu.count; /* accumulate multisec */
-
-        if (!hist[i]->accu.best)
-            hist[i]->accu.best = head[i]->accu.best;
-
-        if (hist[i]->accu.best > head[i]->accu.best)
-            hist[i]->accu.best = head[i]->accu.best;
-
-        if (hist[i]->accu.worst < head[i]->accu.worst)
-            hist[i]->accu.worst = head[i]->accu.worst;
-
-        hist[i]->accu.delta += xprof_delta;
-
-        if (!doavg) {
-            /* we have X seconds accumulated */
-            xprof_move(&hist[i]->accu, &hist[i]->hist);
-            xprof_reset(&hist[i]->accu);
-
-            hist[i]->accu.start = now;
-        }
-
-        /* reset 0sec counters */
-        if (secs == 1) {
-            keep = head[i]->accu.start;
-            xprof_move(&head[i]->accu, &head[i]->hist);
-            xprof_reset(&head[i]->accu);
-            hist[i]->accu.delta = 0;
-            head[i]->accu.start = keep;
-        }
-    }
-}
-
-void
-xprof_summary(StoreEntry * sentry)
-{
-    hrtime_t now = get_tick();
-
-    storeAppendPrintf(sentry, "CPU Profiling Statistics:\n");
-    storeAppendPrintf(sentry,
-                      "  (CPU times are in arbitrary units, most probably in CPU clock ticks)\n");
-    storeAppendPrintf(sentry,
-                      "Probe Name\t Event Count\t last Interval \t Avg Interval \t since squid start \t (since system boot) \n");
-    storeAppendPrintf(sentry, "Total\t %lu\t %" PRIu64 " \t %" PRIu64 " \t %" PRIu64 " \t %" PRIu64 "\n",
-                      (long unsigned) xprof_events,
-                      xprof_delta,
-                      xprof_average_delta,
-                      now - xprof_verystart,
-                      now);
-
-    xprof_summary_item(sentry, "Last 1 sec averages", xprof_stats_avg1sec);
-    xprof_summary_item(sentry, "Last 5 sec averages", xprof_stats_avg5sec);
-    xprof_summary_item(sentry, "Last 30 sec averages", xprof_stats_avg30sec);
-    xprof_summary_item(sentry, "Last 1 min averages", xprof_stats_avg1min);
-    xprof_summary_item(sentry, "Last 5 min averages", xprof_stats_avg5min);
-    xprof_summary_item(sentry, "Last 30 min averages", xprof_stats_avg30min);
-    xprof_summary_item(sentry, "Last 1 hour averages", xprof_stats_avg1hour);
-    xprof_summary_item(sentry, "Last 5 hour averages", xprof_stats_avg5hour);
-    xprof_summary_item(sentry, "Last 24 hour averages", xprof_stats_avg24hour);
-}
-
-static inline void
-xprof_chk_overhead(int samples)
-{
-    while (samples--) {
-        PROF_start(PROF_OVERHEAD);
-        PROF_stop(PROF_OVERHEAD);
-    }
-}
-
-static void
-xprofRegisterWithCacheManager(void)
-{
-    Mgr::RegisterAction("cpu_profile", "CPU Profiling Stats", xprof_summary, 0, 1);
-}
-
-static hrtime_t now;
-
-// TODO: this gets called once per event. Make it only happen when enabling xprof.
-static void
-xprof_Init(void)
-{
-    if (xprof_inited)
-        return;
-
-    xprof_delta = xprof_verystart = xprof_start_t = now;
-
-    xprof_inited = 1;
-
-    xprofRegisterWithCacheManager(); //moved here so it's not double-init'ed
-}
-
-void
-xprof_event(void *data)
-{
-    now = get_tick();
-    xprof_Init();
-    xprof_delta = now - xprof_start_t;
-    xprof_start_t = now;
-    ++xprof_events;
-
-    if (!xprof_average_delta)
-        xprof_average_delta = xprof_delta;
-
-    if (xprof_average_delta > (xprof_delta >> 1))
-        xprof_average_delta = xprof_average_delta - (xprof_average_delta >> 8) + (xprof_delta >> 8);
-
-    xprof_chk_overhead(2);
-
-    xprof_average(&xprof_stats_avg24hour, 24 * 3600);
-
-    xprof_average(&xprof_stats_avg5hour, 5 * 3600);
-
-    xprof_average(&xprof_stats_avg1hour, 3600);
-
-    xprof_average(&xprof_stats_avg30min, 1800);
-
-    xprof_average(&xprof_stats_avg5min, 300);
-
-    xprof_average(&xprof_stats_avg1min, 60);
-
-    xprof_average(&xprof_stats_avg30sec, 30);
-
-    xprof_average(&xprof_stats_avg5sec, 5);
-
-    xprof_average(&xprof_stats_avg1sec, 1);
-
-    xprof_chk_overhead(30);
-
-    eventAdd("cpuProfiling", xprof_event, NULL, 1.0, 1);
-}
-
-#endif /* USE_XPROF_STATS */
-
index 4d5a30d874f462ecd401c911728879c8e8da7b86..f3805d374c66f51af9224dcbe434b802776dde8a 100644 (file)
@@ -11,7 +11,6 @@
 #include "squid.h"
 #include "base/TextException.h"
 #include "mgr/Registration.h"
-#include "profiler/Profiler.h"
 #include "Store.h"
 
 #include <climits>
 void
 String::allocBuffer(String::size_type sz)
 {
-    PROF_start(StringInitBuf);
     assert (undefined());
     char *newBuffer = (char*)memAllocString(sz, &sz);
     setBuffer(newBuffer, sz);
-    PROF_stop(StringInitBuf);
 }
 
 // low-level buffer assignment
@@ -102,13 +99,11 @@ String::assign(const char *str, int len)
 void
 String::allocAndFill(const char *str, int len)
 {
-    PROF_start(StringAllocAndFill);
     assert(str);
     allocBuffer(len + 1);
     len_ = len;
     memcpy(buf_, str, len);
     buf_[len] = '\0';
-    PROF_stop(StringAllocAndFill);
 }
 
 String::String(String const &old) : size_(0), len_(0), buf_(NULL)
@@ -124,8 +119,6 @@ String::String(String const &old) : size_(0), len_(0), buf_(NULL)
 void
 String::clean()
 {
-    PROF_start(StringClean);
-
     /* TODO if mempools has already closed this will FAIL!! */
     if (defined())
         memFreeString(size_, buf_);
@@ -135,7 +128,6 @@ String::clean()
     size_ = 0;
 
     buf_ = NULL;
-    PROF_stop(StringClean);
 }
 
 String::~String()
@@ -150,11 +142,9 @@ String::~String()
 void
 String::reset(char const *str)
 {
-    PROF_start(StringReset);
     clean(); // TODO: optimize to avoid cleaning the buffer if we can reuse it
     if (str)
         allocAndFill(str, strlen(str));
-    PROF_stop(StringReset);
 }
 
 void
@@ -162,7 +152,6 @@ String::append( char const *str, int len)
 {
     assert(str && len >= 0);
 
-    PROF_start(StringAppend);
     if (len_ + len + 1 /*'\0'*/ < size_) {
         xstrncpy(buf_+len_, str, len+1);
         len_ += len;
@@ -183,7 +172,6 @@ String::append( char const *str, int len)
 
         absorb(snew);
     }
-    PROF_stop(StringAppend);
 }
 
 void
index 8adafb59c05c071a76168cf0cc9cf9a1d7955160..9566397ffb03ff9c6ce0facb3cd6991de2c755aa 100644 (file)
@@ -19,7 +19,6 @@
 #include "Debug.h"
 #include "fatal.h"
 #include "globals.h"
-#include "profiler/Profiler.h"
 #include "sbuf/List.h"
 #include "sbuf/Stream.h"
 #include "SquidConfig.h"
@@ -120,7 +119,6 @@ bool ACL::valid () const
 bool
 ACL::matches(ACLChecklist *checklist) const
 {
-    PROF_start(ACL_matches);
     debugs(28, 5, "checking " << name);
 
     // XXX: AclMatchedName does not contain a matched ACL name when the acl
@@ -149,7 +147,6 @@ ACL::matches(ACLChecklist *checklist) const
 
     const char *extra = checklist->asyncInProgress() ? " async" : "";
     debugs(28, 3, "checked: " << name << " = " << result << extra);
-    PROF_stop(ACL_matches);
     return result == 1; // true for match; false for everything else
 }
 
index 2d38f40b2ea5d0cb8ffe044e7035d0be51061c3a..3a3862374de528fa803202d9f60bd437f2dcd992 100644 (file)
@@ -12,7 +12,6 @@
 #include "acl/Checklist.h"
 #include "acl/Tree.h"
 #include "Debug.h"
-#include "profiler/Profiler.h"
 
 #include <algorithm>
 
@@ -307,8 +306,6 @@ ACLChecklist::matchAndFinish()
 Acl::Answer const &
 ACLChecklist::fastCheck(const Acl::Tree * list)
 {
-    PROF_start(aclCheckFast);
-
     preCheck("fast ACLs");
     asyncCaller_ = false;
 
@@ -325,7 +322,6 @@ ACLChecklist::fastCheck(const Acl::Tree * list)
 
     changeAcl(savedList);
     occupied_ = false;
-    PROF_stop(aclCheckFast);
     return currentAnswer();
 }
 
@@ -335,8 +331,6 @@ ACLChecklist::fastCheck(const Acl::Tree * list)
 Acl::Answer const &
 ACLChecklist::fastCheck()
 {
-    PROF_start(aclCheckFast);
-
     preCheck("fast rules");
     asyncCaller_ = false;
 
@@ -349,7 +343,6 @@ ACLChecklist::fastCheck()
         if (finished()) {
             cbdataReferenceDone(acl);
             occupied_ = false;
-            PROF_stop(aclCheckFast);
             return currentAnswer();
         }
 
@@ -360,7 +353,6 @@ ACLChecklist::fastCheck()
     calcImplicitAnswer();
     cbdataReferenceDone(acl);
     occupied_ = false;
-    PROF_stop(aclCheckFast);
 
     return currentAnswer();
 }
index 5c5c809f4585f0f3aad8d494bb3b758964f12294..797712793f7d3ba5845a60c6025d42040c5c5681 100644 (file)
 #include "MemObject.h"
 #include "mime_header.h"
 #include "parser/Tokenizer.h"
-#include "profiler/Profiler.h"
 #include "proxyp/Header.h"
 #include "proxyp/Parser.h"
 #include "sbuf/Stream.h"
@@ -823,7 +822,6 @@ clientSocketRecipient(clientStreamNode * node, ClientHttpRequest * http,
 
     /* Test preconditions */
     assert(node != NULL);
-    PROF_start(clientSocketRecipient);
     /* TODO: handle this rather than asserting
      * - it should only ever happen if we cause an abort and
      * the callback chain loops back to here, so we can simply return.
@@ -843,8 +841,6 @@ clientSocketRecipient(clientStreamNode * node, ClientHttpRequest * http,
         context->deferRecipientForLater(node, rep, receivedData);
     else
         http->getConn()->handleReply(rep, receivedData);
-
-    PROF_stop(clientSocketRecipient);
 }
 
 /**
index ae498388416cf928f3a221cacc0c8af83153315c..47dd7ac594ff379cdcb21d099d047bf71cb6a841 100644 (file)
@@ -48,7 +48,6 @@
 #include "log/access_log.h"
 #include "MemObject.h"
 #include "Parsing.h"
-#include "profiler/Profiler.h"
 #include "proxyp/Header.h"
 #include "redirect.h"
 #include "rfc1738.h"
@@ -269,7 +268,6 @@ checkFailureRatio(err_type etype, hier_code hcode)
 ClientHttpRequest::~ClientHttpRequest()
 {
     debugs(33, 3, "httpRequestFree: " << uri);
-    PROF_start(httpRequestFree);
 
     // Even though freeResources() below may destroy the request,
     // we no longer set request->body_pipe to NULL here
@@ -305,8 +303,6 @@ ClientHttpRequest::~ClientHttpRequest()
 
     /* moving to the next connection is handled by the context free */
     dlinkDelete(&active, &ClientActiveRequests);
-
-    PROF_stop(httpRequestFree);
 }
 
 /**
@@ -1528,7 +1524,6 @@ ClientHttpRequest::processRequest()
 void
 ClientHttpRequest::httpStart()
 {
-    PROF_start(httpStart);
     // XXX: Re-initializes rather than updates. Should not be needed at all.
     updateLoggingTags(LOG_TAG_NONE);
     debugs(85, 4, loggingTags().c_str() << " for '" << uri << "'");
@@ -1538,7 +1533,6 @@ ClientHttpRequest::httpStart()
     /* Use the Stream Luke */
     clientStreamNode *node = (clientStreamNode *)client_stream.tail->data;
     clientStreamRead(node, this, node->readBuffer);
-    PROF_stop(httpStart);
 }
 
 #if USE_OPENSSL
index 8b7f0147b0c341c33a2c4571833414ec2c378baa..84bea17d0c97779598498300cab77d2e7f28c29a 100644 (file)
@@ -30,7 +30,6 @@
 #include "ip/QosConfig.h"
 #include "ip/tools.h"
 #include "pconn.h"
-#include "profiler/Profiler.h"
 #include "sbuf/SBuf.h"
 #include "sbuf/Stream.h"
 #include "SquidConfig.h"
@@ -339,7 +338,6 @@ comm_openex(int sock_type,
     int new_socket;
     struct addrinfo *AI = NULL;
 
-    PROF_start(comm_open);
     /* Create socket for accepting new connections. */
     ++ statCounter.syscalls.sock.sockets;
 
@@ -381,7 +379,6 @@ comm_openex(int sock_type,
 
         Ip::Address::FreeAddr(AI);
 
-        PROF_stop(comm_open);
         errno = xerrno; // restore for caller
         return -1;
     }
@@ -406,8 +403,6 @@ comm_openex(int sock_type,
 
     Ip::Address::FreeAddr(AI);
 
-    PROF_stop(comm_open);
-
     // XXX transition only. prevent conn from closing the new FD on function exit.
     conn->fd = -1;
     errno = xerrno; // restore for caller
@@ -613,7 +608,6 @@ comm_connect_addr(int sock, const Ip::Address &address)
     int err = 0;
     socklen_t errlen;
     struct addrinfo *AI = NULL;
-    PROF_start(comm_connect_addr);
 
     assert(address.port() != 0);
 
@@ -706,8 +700,6 @@ comm_connect_addr(int sock, const Ip::Address &address)
 
     Ip::Address::FreeAddr(AI);
 
-    PROF_stop(comm_connect_addr);
-
     errno = xerrno;
     if (xerrno == 0 || xerrno == EISCONN)
         status = Comm::OK;
@@ -844,8 +836,6 @@ _comm_close(int fd, char const *file, int line)
 
     assert(F->type != FD_FILE);
 
-    PROF_start(comm_close);
-
     F->flags.close_request = true;
 
     // We have caller's context and fde::codeContext. In the unlikely event they
@@ -894,8 +884,6 @@ _comm_close(int fd, char const *file, int line)
     // must use async call to wait for all callbacks
     // scheduled before comm_close() to finish
     ScheduleCallHere(completeCall);
-
-    PROF_stop(comm_close);
 }
 
 /* Send a udp datagram to specified TO_ADDR. */
@@ -905,7 +893,6 @@ comm_udp_sendto(int fd,
                 const void *buf,
                 int len)
 {
-    PROF_start(comm_udp_sendto);
     ++ statCounter.syscalls.sock.sendtos;
 
     debugs(50, 3, "comm_udp_sendto: Attempt to send UDP packet to " << to_addr <<
@@ -917,8 +904,6 @@ comm_udp_sendto(int fd,
     int xerrno = errno;
     Ip::Address::FreeAddr(AI);
 
-    PROF_stop(comm_udp_sendto);
-
     if (x >= 0) {
         errno = xerrno; // restore for caller to use
         return x;
@@ -1845,7 +1830,6 @@ comm_open_uds(int sock_type,
 
     int new_socket;
 
-    PROF_start(comm_open);
     /* Create socket for accepting new connections. */
     ++ statCounter.syscalls.sock.sockets;
 
@@ -1874,8 +1858,6 @@ comm_open_uds(int sock_type,
         } else {
             debugs(50, DBG_CRITICAL, MYNAME << "socket failure: " << xstrerr(xerrno));
         }
-
-        PROF_stop(comm_open);
         return -1;
     }
 
@@ -1898,7 +1880,6 @@ comm_open_uds(int sock_type,
     if (flags & COMM_NONBLOCKING) {
         if (commSetNonBlocking(new_socket) != Comm::OK) {
             comm_close(new_socket);
-            PROF_stop(comm_open);
             return -1;
         }
     }
@@ -1906,7 +1887,6 @@ comm_open_uds(int sock_type,
     if (flags & COMM_DOBIND) {
         if (commBind(new_socket, AI) != Comm::OK) {
             comm_close(new_socket);
-            PROF_stop(comm_open);
             return -1;
         }
     }
@@ -1920,8 +1900,6 @@ comm_open_uds(int sock_type,
     if (Config.tcpRcvBufsz > 0 && sock_type == SOCK_STREAM)
         commSetTcpRcvbuf(new_socket, Config.tcpRcvBufsz);
 
-    PROF_stop(comm_open);
-
     return new_socket;
 }
 
index aa0770fe5f2096934c4b2031a6e0df11ff29fce1..2989ea2737050c0784d9068d89b228b27b6aced7 100644 (file)
@@ -35,7 +35,6 @@
 #include "fd.h"
 #include "fde.h"
 #include "mgr/Registration.h"
-#include "profiler/Profiler.h"
 #include "SquidTime.h"
 #include "StatCounters.h"
 #include "StatHist.h"
@@ -316,8 +315,6 @@ Comm::DoSelect(int msec)
     fde *F;
     PF *hdl;
 
-    PROF_start(comm_check_incoming);
-
     if (msec > max_poll_time)
         msec = max_poll_time;
 
@@ -338,11 +335,9 @@ Comm::DoSelect(int msec)
 
         /* error during poll */
         getCurrentTime();
-        PROF_stop(comm_check_incoming);
         return Comm::COMM_ERROR;
     }
 
-    PROF_stop(comm_check_incoming);
     getCurrentTime();
 
     statCounter.select_fds_hist.count(num);
@@ -350,8 +345,6 @@ Comm::DoSelect(int msec)
     if (num == 0)
         return Comm::TIMEOUT; /* no error */
 
-    PROF_start(comm_handle_ready_fd);
-
     for (i = 0; i < num; ++i) {
         int fd = (int)do_poll.dp_fds[i].fd;
         F = &fd_table[fd];
@@ -383,10 +376,8 @@ Comm::DoSelect(int msec)
                     DEBUG_DEVPOLL ? 0 : 8,
                     HERE << "Calling read handler on FD " << fd
                 );
-                PROF_start(comm_read_handler);
                 F->read_handler = NULL;
                 hdl(fd, F->read_data);
-                PROF_stop(comm_read_handler);
                 ++ statCounter.select_fds;
             } else {
                 debugs(
@@ -407,10 +398,8 @@ Comm::DoSelect(int msec)
                     DEBUG_DEVPOLL ? 0 : 8,
                     HERE << "Calling write handler on FD " << fd
                 );
-                PROF_start(comm_write_handler);
                 F->write_handler = NULL;
                 hdl(fd, F->write_data);
-                PROF_stop(comm_write_handler);
                 ++ statCounter.select_fds;
             } else {
                 debugs(
@@ -424,7 +413,6 @@ Comm::DoSelect(int msec)
         }
     }
 
-    PROF_stop(comm_handle_ready_fd);
     return Comm::OK;
 }
 
index 7787f30e01881234fcfdb5dc74f6f45ef0c9e212..28cb910fea8c6081ad11235a951113d9f5002c48 100644 (file)
@@ -37,7 +37,6 @@
 #include "fde.h"
 #include "globals.h"
 #include "mgr/Registration.h"
-#include "profiler/Profiler.h"
 #include "SquidTime.h"
 #include "StatCounters.h"
 #include "StatHist.h"
@@ -225,8 +224,6 @@ Comm::DoSelect(int msec)
 
     struct epoll_event *cevents;
 
-    PROF_start(comm_check_incoming);
-
     if (msec > max_poll_time)
         msec = max_poll_time;
 
@@ -242,12 +239,9 @@ Comm::DoSelect(int msec)
 
         getCurrentTime();
 
-        PROF_stop(comm_check_incoming);
-
         return Comm::COMM_ERROR;
     }
 
-    PROF_stop(comm_check_incoming);
     getCurrentTime();
 
     statCounter.select_fds_hist.count(num);
@@ -255,8 +249,6 @@ Comm::DoSelect(int msec)
     if (num == 0)
         return Comm::TIMEOUT;       /* No error.. */
 
-    PROF_start(comm_handle_ready_fd);
-
     for (i = 0, cevents = pevents; i < num; ++i, ++cevents) {
         fd = cevents->data.fd;
         F = &fd_table[fd];
@@ -270,10 +262,8 @@ Comm::DoSelect(int msec)
         if (cevents->events & (EPOLLIN|EPOLLHUP|EPOLLERR) || F->flags.read_pending) {
             if ((hdl = F->read_handler) != NULL) {
                 debugs(5, DEBUG_EPOLL ? 0 : 8, HERE << "Calling read handler on FD " << fd);
-                PROF_start(comm_write_handler);
                 F->read_handler = NULL;
                 hdl(fd, F->read_data);
-                PROF_stop(comm_write_handler);
                 ++ statCounter.select_fds;
             } else {
                 debugs(5, DEBUG_EPOLL ? 0 : 8, HERE << "no read handler for FD " << fd);
@@ -285,10 +275,8 @@ Comm::DoSelect(int msec)
         if (cevents->events & (EPOLLOUT|EPOLLHUP|EPOLLERR)) {
             if ((hdl = F->write_handler) != NULL) {
                 debugs(5, DEBUG_EPOLL ? 0 : 8, HERE << "Calling write handler on FD " << fd);
-                PROF_start(comm_read_handler);
                 F->write_handler = NULL;
                 hdl(fd, F->write_data);
-                PROF_stop(comm_read_handler);
                 ++ statCounter.select_fds;
             } else {
                 debugs(5, DEBUG_EPOLL ? 0 : 8, HERE << "no write handler for FD " << fd);
@@ -300,8 +288,6 @@ Comm::DoSelect(int msec)
 
     CodeContext::Reset();
 
-    PROF_stop(comm_handle_ready_fd);
-
     return Comm::OK;
 }
 
index 44b8a071f9c02bc3286505e00f4a950103a7d501..3415026ebd4e506819fa4896a0fbe87f660326bd 100644 (file)
@@ -19,7 +19,6 @@
 #include "globals.h"
 #include "ICP.h"
 #include "mgr/Registration.h"
-#include "profiler/Profiler.h"
 #include "SquidConfig.h"
 #include "SquidTime.h"
 #include "StatCounters.h"
@@ -188,7 +187,6 @@ comm_check_incoming_poll_handlers(int nfds, int *fds)
     int npfds;
 
     struct pollfd pfds[3 + MAXTCPLISTENPORTS];
-    PROF_start(comm_check_incoming);
     incoming_sockets_accepted = 0;
 
     for (i = npfds = 0; i < nfds; ++i) {
@@ -210,18 +208,14 @@ comm_check_incoming_poll_handlers(int nfds, int *fds)
         }
     }
 
-    if (!nfds) {
-        PROF_stop(comm_check_incoming);
+    if (!nfds)
         return -1;
-    }
 
     getCurrentTime();
     ++ statCounter.syscalls.selects;
 
-    if (poll(pfds, npfds, 0) < 1) {
-        PROF_stop(comm_check_incoming);
+    if (poll(pfds, npfds, 0) < 1)
         return incoming_sockets_accepted;
-    }
 
     for (i = 0; i < npfds; ++i) {
         int revents;
@@ -246,7 +240,6 @@ comm_check_incoming_poll_handlers(int nfds, int *fds)
         }
     }
 
-    PROF_stop(comm_check_incoming);
     return incoming_sockets_accepted;
 }
 
@@ -351,8 +344,6 @@ Comm::DoSelect(int msec)
         if (commCheckTcpIncoming)
             comm_poll_tcp_incoming();
 
-        PROF_start(comm_poll_prep_pfds);
-
         calldns = calludp = calltcp = 0;
 
         nfds = 0;
@@ -383,8 +374,6 @@ Comm::DoSelect(int msec)
             }
         }
 
-        PROF_stop(comm_poll_prep_pfds);
-
         if (npending)
             msec = 0;
 
@@ -404,12 +393,10 @@ Comm::DoSelect(int msec)
         }
 
         for (;;) {
-            PROF_start(comm_poll_normal);
             ++ statCounter.syscalls.selects;
             num = poll(pfds, nfds, msec);
             int xerrno = errno;
             ++ statCounter.select_loops;
-            PROF_stop(comm_poll_normal);
 
             if (num >= 0 || npending > 0)
                 break;
@@ -437,7 +424,6 @@ Comm::DoSelect(int msec)
         /* scan each socket but the accept socket. Poll this
          * more frequently to minimize losses due to the 5 connect
          * limit in SunOS */
-        PROF_start(comm_handle_ready_fd);
 
         for (size_t loopIndex = 0; loopIndex < nfds; ++loopIndex) {
             fde *F;
@@ -474,10 +460,8 @@ Comm::DoSelect(int msec)
                 debugs(5, 6, "comm_poll: FD " << fd << " ready for reading");
 
                 if ((hdl = F->read_handler)) {
-                    PROF_start(comm_read_handler);
                     F->read_handler = NULL;
                     hdl(fd, F->read_data);
-                    PROF_stop(comm_read_handler);
                     ++ statCounter.select_fds;
 
                     if (commCheckUdpIncoming)
@@ -495,10 +479,8 @@ Comm::DoSelect(int msec)
                 debugs(5, 6, "comm_poll: FD " << fd << " ready for writing");
 
                 if ((hdl = F->write_handler)) {
-                    PROF_start(comm_write_handler);
                     F->write_handler = NULL;
                     hdl(fd, F->write_data);
-                    PROF_stop(comm_write_handler);
                     ++ statCounter.select_fds;
 
                     if (commCheckUdpIncoming)
@@ -540,8 +522,6 @@ Comm::DoSelect(int msec)
             }
         }
 
-        PROF_stop(comm_handle_ready_fd);
-
         if (calludp)
             comm_poll_udp_incoming();
 
index cbc89fd9e30e1bcb06242ac070f3969feefaba63..8231f4538417a0dc7f3b8c2fd79b4640992e90d7 100644 (file)
@@ -27,7 +27,6 @@
 #include "ip/QosConfig.h"
 #include "log/access_log.h"
 #include "MasterXaction.h"
-#include "profiler/Profiler.h"
 #include "SquidConfig.h"
 #include "SquidTime.h"
 #include "StatCounters.h"
@@ -345,7 +344,6 @@ Comm::TcpAcceptor::notify(const Comm::Flag flag, const Comm::ConnectionPointer &
 Comm::Flag
 Comm::TcpAcceptor::oldAccept(Comm::ConnectionPointer &details)
 {
-    PROF_start(comm_accept);
     ++statCounter.syscalls.sock.accepts;
     int sock;
     struct addrinfo *gai = NULL;
@@ -357,8 +355,6 @@ Comm::TcpAcceptor::oldAccept(Comm::ConnectionPointer &details)
 
         Ip::Address::FreeAddr(gai);
 
-        PROF_stop(comm_accept);
-
         if (ignoreErrno(errcode) || errcode == ECONNABORTED) {
             debugs(50, 5, status() << ": " << xstrerr(errcode));
             return Comm::NOMESSAGE;
@@ -390,7 +386,6 @@ Comm::TcpAcceptor::oldAccept(Comm::ConnectionPointer &details)
         int xerrno = errno;
         debugs(50, DBG_IMPORTANT, "ERROR: getsockname() failed to locate local-IP on " << details << ": " << xstrerr(xerrno));
         Ip::Address::FreeAddr(gai);
-        PROF_stop(comm_accept);
         return Comm::COMM_ERROR;
     }
     details->local = *gai;
@@ -400,7 +395,6 @@ Comm::TcpAcceptor::oldAccept(Comm::ConnectionPointer &details)
     if (conn->flags&(COMM_TRANSPARENT|COMM_INTERCEPTION) && !Ip::Interceptor.Lookup(details, conn)) {
         debugs(50, DBG_IMPORTANT, "ERROR: NAT/TPROXY lookup failed to locate original IPs on " << details);
         // Failed.
-        PROF_stop(comm_accept);
         return Comm::COMM_ERROR;
     }
 
@@ -419,7 +413,6 @@ Comm::TcpAcceptor::oldAccept(Comm::ConnectionPointer &details)
     if (Config.client_ip_max_connections >= 0) {
         if (clientdbEstablished(details->remote, 0) > Config.client_ip_max_connections) {
             debugs(50, DBG_IMPORTANT, "WARNING: " << details->remote << " attempting more than " << Config.client_ip_max_connections << " connections.");
-            PROF_stop(comm_accept);
             return Comm::NOMESSAGE;
         }
     }
@@ -438,7 +431,6 @@ Comm::TcpAcceptor::oldAccept(Comm::ConnectionPointer &details)
     /* IFF the socket is (tproxy) transparent, pass the flag down to allow spoofing */
     F->flags.transparent = fd_table[conn->fd].flags.transparent; // XXX: can we remove this line yet?
 
-    PROF_stop(comm_accept);
     return Comm::OK;
 }
 
index 3284c9efee0b70d7bd50fd84ebf81b500fa60d55..8d211e0c4fe65493f2ebeae0fd76a36b886a4794 100644 (file)
@@ -16,7 +16,6 @@
 #include "fde.h"
 #include "globals.h"
 #include "MemBuf.h"
-#include "profiler/Profiler.h"
 #include "SquidTime.h"
 #include "StatCounters.h"
 #if USE_DELAY_POOLS
@@ -64,7 +63,6 @@ Comm::HandleWrite(int fd, void *data)
     assert(state->conn != NULL);
     assert(state->conn->fd == fd);
 
-    PROF_start(commHandleWrite);
     debugs(5, 5, HERE << state->conn << ": off " <<
            (long int) state->offset << ", sz " << (long int) state->size << ".");
 
@@ -76,7 +74,6 @@ Comm::HandleWrite(int fd, void *data)
         assert(bucket->selectWaiting);
         bucket->selectWaiting = false;
         if (nleft > 0 && !bucket->applyQuota(nleft, state)) {
-            PROF_stop(commHandleWrite);
             return;
         }
     }
@@ -131,7 +128,5 @@ Comm::HandleWrite(int fd, void *data)
             state->finish(nleft ? Comm::OK : Comm::COMM_ERROR, 0);
         }
     }
-
-    PROF_stop(commHandleWrite);
 }
 
index 091ce3c3c5ad5a9a743533889090793e49ed9ad3..bdb58589d44258db1bb221727d3025557ea1dbc5 100644 (file)
@@ -39,7 +39,6 @@
 #include "ip/Address.h"
 #include "log/forward.h"
 #include "MemBuf.h"
-#include "profiler/Profiler.h"
 #include "SquidConfig.h"
 
 /* quick reference on behaviour here.
@@ -1249,8 +1248,6 @@ ESIContext::parse()
         parserState.parsing = 1;
         /* we don't keep any data around */
 
-        PROF_start(esiParsing);
-
         try {
             while (buffered.getRaw() && !flags.error)
                 parseOneBuffer();
@@ -1270,8 +1267,6 @@ ESIContext::parse()
             setErrorMessage("ESI parser error");
         }
 
-        PROF_stop(esiParsing);
-
         /* Tel the read code to allocate a new buffer */
         incoming = NULL;
 
@@ -1325,7 +1320,6 @@ ESIContext::process ()
      */
     {
         esiProcessResult_t status;
-        PROF_start(esiProcessing);
         processing = true;
         status = tree->process(0);
         processing = false;
@@ -1349,9 +1343,6 @@ ESIContext::process ()
             setError();
 
             setErrorMessage("esiProcess: ESI template Processing failed.");
-
-            PROF_stop(esiProcessing);
-
             return ESI_PROCESS_FAILED;
 
             break;
@@ -1372,7 +1363,6 @@ ESIContext::process ()
             flags.finished = 1;
         }
 
-        PROF_stop(esiProcessing);
         return status; /* because we have no callbacks */
     }
 }
index a1ebbee310e56be8edc45ee9447118141f43d2e5..7e515268500a506e38406d54e975c7adf2f6b03c 100644 (file)
@@ -12,7 +12,6 @@
 #include "Debug.h"
 #include "esi/Esi.h"
 #include "esi/Expression.h"
-#include "profiler/Profiler.h"
 
 #include <cerrno>
 #include <cmath>
@@ -1002,7 +1001,6 @@ ESIExpression::Evaluate(char const *s)
     stackmember stack[ESI_STACK_DEPTH_LIMIT];
     int stackdepth = 0;
     char const *end;
-    PROF_start(esiExpressionEval);
 
     while (*s) {
         stackmember candidate = getsymbol(s, &end);
@@ -1011,7 +1009,6 @@ ESIExpression::Evaluate(char const *s)
             assert(s != end);
 
             if (!addmember(stack, &stackdepth, &candidate)) {
-                PROF_stop(esiExpressionEval);
                 return 0;
             }
 
@@ -1019,7 +1016,6 @@ ESIExpression::Evaluate(char const *s)
         } else {
             assert (s == end);
             debugs(86, DBG_IMPORTANT, "failed parsing expression");
-            PROF_stop(esiExpressionEval);
             return 0;
         }
     }
@@ -1033,14 +1029,12 @@ ESIExpression::Evaluate(char const *s)
                 eval(stack, &stackdepth, stackdepth - 2, &rv)) {
             /* special case - leading operator failed */
             debugs(86, DBG_IMPORTANT, "invalid expression");
-            PROF_stop(esiExpressionEval);
             return 0;
         }
     }
 
     if (stackdepth == 0) {
         /* Empty expression - evaluate to false */
-        PROF_stop(esiExpressionEval);
         return 0;
     }
 
@@ -1049,8 +1043,6 @@ ESIExpression::Evaluate(char const *s)
 
     assert(stack[0].valuetype == ESI_EXPR_EXPR);
 
-    PROF_stop(esiExpressionEval);
-
     return stack[0].value.integral ? 1 : 0;
 }
 
index 4a4759a557375acc3b6bba225e8dd8480cd990db..f8e74f97c13e0d3ce3961d07d7f88d8d34da2d76 100644 (file)
@@ -11,7 +11,6 @@
 #include "squid.h"
 #include "event.h"
 #include "mgr/Registration.h"
-#include "profiler/Profiler.h"
 #include "SquidTime.h"
 #include "Store.h"
 #include "tools.h"
@@ -229,8 +228,6 @@ EventScheduler::checkEvents(int)
     if (result != 0)
         return result;
 
-    PROF_start(eventRun);
-
     do {
         ev_entry *event = tasks;
         assert(event);
@@ -255,7 +252,6 @@ EventScheduler::checkEvents(int)
             break; // do not dequeue events following a heavy event
     } while (result == 0);
 
-    PROF_stop(eventRun);
     return result;
 }
 
index 8dbb9775144e05ba133f7dc96bdf353686aa2fd8..133650163534f3b99b7e7602b515a14d68624ab6 100644 (file)
--- a/src/fd.cc
+++ b/src/fd.cc
@@ -16,7 +16,6 @@
 #include "fd.h"
 #include "fde.h"
 #include "globals.h"
-#include "profiler/Profiler.h"
 #include "SquidTime.h"
 
 // Solaris and possibly others lack MSG_NOSIGNAL optimization
@@ -105,79 +104,50 @@ fd_close(int fd)
 int
 socket_read_method(int fd, char *buf, int len)
 {
-    int i;
-    PROF_start(recv);
-    i = recv(fd, (void *) buf, len, 0);
-    PROF_stop(recv);
-    return i;
+    return recv(fd, (void *) buf, len, 0);
 }
 
 int
 file_read_method(int fd, char *buf, int len)
 {
-    int i;
-    PROF_start(read);
-    i = _read(fd, buf, len);
-    PROF_stop(read);
-    return i;
+    return _read(fd, buf, len);
 }
 
 int
 socket_write_method(int fd, const char *buf, int len)
 {
-    int i;
-    PROF_start(send);
-    i = send(fd, (const void *) buf, len, 0);
-    PROF_stop(send);
-    return i;
+    return send(fd, (const void *) buf, len, 0);
 }
 
 int
 file_write_method(int fd, const char *buf, int len)
 {
-    int i;
-    PROF_start(write);
-    i = (_write(fd, buf, len));
-    PROF_stop(write);
-    return i;
+    return _write(fd, buf, len);
 }
 
 #else
 int
 default_read_method(int fd, char *buf, int len)
 {
-    int i;
-    PROF_start(read);
-    i = read(fd, buf, len);
-    PROF_stop(read);
-    return i;
+    return read(fd, buf, len);
 }
 
 int
 default_write_method(int fd, const char *buf, int len)
 {
-    int i;
-    PROF_start(write);
-    i = write(fd, buf, len);
-    PROF_stop(write);
-    return i;
+    return write(fd, buf, len);
 }
 
 int
 msghdr_read_method(int fd, char *buf, int)
 {
-    PROF_start(read);
-    const int i = recvmsg(fd, reinterpret_cast<msghdr*>(buf), MSG_DONTWAIT);
-    PROF_stop(read);
-    return i;
+    return recvmsg(fd, reinterpret_cast<msghdr*>(buf), MSG_DONTWAIT);
 }
 
 int
 msghdr_write_method(int fd, const char *buf, int len)
 {
-    PROF_start(write);
     const int i = sendmsg(fd, reinterpret_cast<const msghdr*>(buf), MSG_NOSIGNAL);
-    PROF_stop(write);
     return i > 0 ? len : i; // len is imprecise but the caller expects a match
 }
 
index fdd6f358a901ec1e1ebe54e4ca371a7f033b2041..5b8929d660e540022910170a8d744883d2edfc17 100644 (file)
@@ -15,7 +15,6 @@
 #include "fs_io.h"
 #include "globals.h"
 #include "MemBuf.h"
-#include "profiler/Profiler.h"
 #include "StatCounters.h"
 
 #include <cerrno>
@@ -46,7 +45,6 @@ int
 file_open(const char *path, int mode)
 {
     int fd;
-    PROF_start(file_open);
 
     if (FILE_MODE(mode) == O_WRONLY)
         mode |= O_APPEND;
@@ -67,7 +65,6 @@ file_open(const char *path, int mode)
         fd_open(fd, FD_FILE, path);
     }
 
-    PROF_stop(file_open);
     return fd;
 }
 
@@ -77,7 +74,6 @@ file_close(int fd)
 {
     fde *F = &fd_table[fd];
     PF *read_callback;
-    PROF_start(file_close);
     assert(fd >= 0);
     assert(F->flags.open);
 
@@ -97,7 +93,6 @@ file_close(int fd)
 #else
         F->flags.close_request = true;
         debugs(6, 2, "file_close: FD " << fd << ", delaying close");
-        PROF_stop(file_close);
         return;
 #endif
 
@@ -116,8 +111,6 @@ file_close(int fd)
     fd_close(fd);
 
     ++ statCounter.syscalls.disk.closes;
-
-    PROF_stop(file_close);
 }
 
 /*
@@ -192,8 +185,6 @@ diskHandleWrite(int fd, void *)
     if (NULL == q)
         return;
 
-    PROF_start(diskHandleWrite);
-
     debugs(6, 3, "diskHandleWrite: FD " << fd);
 
     F->flags.write_daemon = false;
@@ -319,7 +310,6 @@ diskHandleWrite(int fd, void *)
              * NOTE, this callback can close the FD, so we must
              * not touch 'F', 'fdd', etc. after this.
              */
-            PROF_stop(diskHandleWrite);
             return;
             /* XXX But what about close_request??? */
         }
@@ -327,8 +317,6 @@ diskHandleWrite(int fd, void *)
 
     if (do_close)
         file_close(fd);
-
-    PROF_stop(diskHandleWrite);
 }
 
 /* write block to a file */
@@ -345,7 +333,6 @@ file_write(int fd,
 {
     dwrite_q *wq = NULL;
     fde *F = &fd_table[fd];
-    PROF_start(file_write);
     assert(fd >= 0);
     assert(F->flags.open);
     /* if we got here. Caller is eligible to write. */
@@ -377,8 +364,6 @@ file_write(int fd,
     if (!F->flags.write_daemon) {
         diskHandleWrite(fd, NULL);
     }
-
-    PROF_stop(file_write);
 }
 
 /*
@@ -411,8 +396,6 @@ diskHandleRead(int fd, void *data)
         return;
     }
 
-    PROF_start(diskHandleRead);
-
 #if WRITES_MAINTAIN_DISK_OFFSET
     if (F->disk.offset != ctrl_dat->offset) {
 #else
@@ -444,7 +427,6 @@ diskHandleRead(int fd, void *data)
     if (len < 0) {
         if (ignoreErrno(xerrno)) {
             Comm::SetSelect(fd, COMM_SELECT_READ, diskHandleRead, ctrl_dat, 0);
-            PROF_stop(diskHandleRead);
             return;
         }
 
@@ -461,8 +443,6 @@ diskHandleRead(int fd, void *data)
     cbdataReferenceDone(ctrl_dat->client_data);
 
     memFree(ctrl_dat, MEM_DREAD_CTRL);
-
-    PROF_stop(diskHandleRead);
 }
 
 /* start read operation */
@@ -473,7 +453,6 @@ void
 file_read(int fd, char *buf, int req_len, off_t offset, DRCB * handler, void *client_data)
 {
     dread_ctrl *ctrl_dat;
-    PROF_start(file_read);
     assert(fd >= 0);
     ctrl_dat = (dread_ctrl *)memAllocate(MEM_DREAD_CTRL);
     ctrl_dat->fd = fd;
@@ -484,7 +463,6 @@ file_read(int fd, char *buf, int req_len, off_t offset, DRCB * handler, void *cl
     ctrl_dat->handler = handler;
     ctrl_dat->client_data = cbdataReference(client_data);
     diskHandleRead(fd, ctrl_dat);
-    PROF_stop(file_read);
 }
 
 void
index 08b573a924319cf1c78c30aa52f648ff71256b0f..58283294ad4915e33715323ad94bcb64fa745d49 100644 (file)
@@ -48,7 +48,6 @@
 #include "neighbors.h"
 #include "pconn.h"
 #include "peer_proxy_negotiate_auth.h"
-#include "profiler/Profiler.h"
 #include "refresh.h"
 #include "RefreshPattern.h"
 #include "rfc1738.h"
@@ -1294,9 +1293,7 @@ HttpStateData::processReply()
     }
 
     if (!flags.headers_parsed) { // have not parsed headers yet?
-        PROF_start(HttpStateData_processReplyHeader);
         processReplyHeader();
-        PROF_stop(HttpStateData_processReplyHeader);
 
         if (!continueAfterParsingHeader()) // parsing error or need more data
             return; // TODO: send errors to ICAP
@@ -1305,9 +1302,7 @@ HttpStateData::processReply()
     }
 
     // kick more reads if needed and/or process the response body, if any
-    PROF_start(HttpStateData_processReplyBody);
     processReplyBody(); // may call serverComplete()
-    PROF_stop(HttpStateData_processReplyBody);
 }
 
 /**
index ebb917e5af18c6f77ff675b1b187a3a9452c831f..c1021475fc7b8e0fdc24d570114276fc444a865b 100644 (file)
@@ -17,7 +17,6 @@
 #include "HttpHeaderTools.h"
 #include "MemBuf.h"
 #include "mime_header.h"
-#include "profiler/Profiler.h"
 #include "SquidConfig.h"
 
 Http::Message::Message(http_hdr_owner_type owner):
@@ -171,16 +170,12 @@ Http::Message::httpMsgParseStep(const char *buf, int len, int atEnd)
 
     *parse_end_ptr = parse_start;
 
-    PROF_start(HttpMsg_httpMsgParseStep);
-
     if (pstate == Http::Message::psReadyToParseStartLine) {
         if (!httpMsgIsolateStart(&parse_start, &blk_start, &blk_end)) {
-            PROF_stop(HttpMsg_httpMsgParseStep);
             return 0;
         }
 
         if (!parseFirstLine(blk_start, blk_end)) {
-            PROF_stop(HttpMsg_httpMsgParseStep);
             return httpMsgParseError();
         }
 
@@ -203,7 +198,6 @@ Http::Message::httpMsgParseStep(const char *buf, int len, int atEnd)
         configureContentLengthInterpreter(interpreter);
         const int parsed = header.parse(parse_start, parse_len, atEnd, hsize, interpreter);
         if (parsed <= 0) {
-            PROF_stop(HttpMsg_httpMsgParseStep);
             return !parsed ? 0 : httpMsgParseError();
         }
         hdr_sz += hsize;
@@ -211,7 +205,6 @@ Http::Message::httpMsgParseStep(const char *buf, int len, int atEnd)
         pstate = Http::Message::psParsed;
     }
 
-    PROF_stop(HttpMsg_httpMsgParseStep);
     return 1;
 }
 
index 2c5822745c7301b418f9148e94ead0556d96ff68..204afbacbfa65f66aef7bebded02be1a20d64209 100644 (file)
@@ -11,7 +11,6 @@
 #include "http/one/RequestParser.h"
 #include "http/ProtocolVersion.h"
 #include "parser/Tokenizer.h"
-#include "profiler/Profiler.h"
 #include "SquidConfig.h"
 
 Http1::Parser::size_type
@@ -366,7 +365,6 @@ Http::One::RequestParser::doParse(const SBuf &aBuf)
 
     // stage 2: parse the request-line
     if (parsingStage_ == HTTP_PARSE_FIRST) {
-        PROF_start(HttpParserParseReqLine);
         const int retcode = parseRequestFirstLine();
 
         // first-line (or a look-alike) found successfully.
@@ -379,7 +377,6 @@ Http::One::RequestParser::doParse(const SBuf &aBuf)
         debugs(74, 5, "request-line: url: " << uri_);
         debugs(74, 5, "request-line: proto: " << msgProtocol_);
         debugs(74, 5, "Parser: bytes processed=" << (aBuf.length()-buf_.length()));
-        PROF_stop(HttpParserParseReqLine);
 
         // syntax errors already
         if (retcode < 0) {
index 353ee3f235f99056e0f6189e55a14f9b1f9a87d1..a73a70022995492053c39bdbbf13fbe7b1207b97 100644 (file)
@@ -11,7 +11,6 @@
 #include "http/one/ResponseParser.h"
 #include "http/ProtocolVersion.h"
 #include "parser/Tokenizer.h"
-#include "profiler/Profiler.h"
 #include "sbuf/Stream.h"
 #include "SquidConfig.h"
 
@@ -214,8 +213,6 @@ Http::One::ResponseParser::parse(const SBuf &aBuf)
 
     // stage 2: parse the status-line
     if (parsingStage_ == HTTP_PARSE_FIRST) {
-        PROF_start(HttpParserParseReplyLine);
-
         const int retcode = parseResponseFirstLine();
 
         // first-line (or a look-alike) found successfully.
@@ -226,7 +223,6 @@ Http::One::ResponseParser::parse(const SBuf &aBuf)
         debugs(74, 5, "status-line: status-code " << statusCode_);
         debugs(74, 5, "status-line: reason-phrase " << reasonPhrase_);
         debugs(74, 5, "Parser: bytes processed=" << (aBuf.length()-buf_.length()));
-        PROF_stop(HttpParserParseReplyLine);
 
         // syntax errors already
         if (retcode < 0) {
index 4576b761c54948ff5bc0d2b55fc2fa4ec4049113..cceb2b40d914c6d2113fb05da5fceb35b805157d 100644 (file)
@@ -65,7 +65,6 @@
 #include "peer_sourcehash.h"
 #include "peer_userhash.h"
 #include "PeerSelectState.h"
-#include "profiler/Profiler.h"
 #include "protos.h"
 #include "redirect.h"
 #include "refresh.h"
@@ -241,8 +240,6 @@ private:
 int
 SignalEngine::checkEvents(int)
 {
-    PROF_start(SignalEngine_checkEvents);
-
     if (do_reconfigure)
         mainReconfigureStart();
     else if (do_rotate)
@@ -251,7 +248,6 @@ SignalEngine::checkEvents(int)
         doShutdown(do_shutdown > 0 ? (int) Config.shutdownLifetime : 0);
     if (do_handle_stopped_child)
         handleStoppedChild();
-    PROF_stop(SignalEngine_checkEvents);
     return EVENT_IDLE;
 }
 
@@ -1334,12 +1330,6 @@ mainInitialize(void)
 
     eventAdd("fqdncache_purgelru", fqdncache_purgelru, nullptr, 15.0, 1);
 
-#if USE_XPROF_STATS
-
-    eventAdd("cpuProfiling", xprof_event, nullptr, 1.0, 1);
-
-#endif
-
     eventAdd("memPoolCleanIdlePools", Mem::CleanIdlePools, nullptr, 15.0, 1);
 
     configured_once = 1;
index 8a2cb80750c749c29e19d2559a57a44efbf48b81..85e69abdfa475e04b52600def4e7033193835bb7 100644 (file)
@@ -11,7 +11,6 @@
 #include "squid.h"
 #include "Debug.h"
 #include "mime_header.h"
-#include "profiler/Profiler.h"
 #include "sbuf/SBuf.h"
 
 size_t
@@ -21,8 +20,6 @@ headersEnd(const char *mime, size_t l, bool &containsObsFold)
     int state = 1;
     containsObsFold = false;
 
-    PROF_start(headersEnd);
-
     while (e < l && state < 3) {
         switch (state) {
 
@@ -60,7 +57,6 @@ headersEnd(const char *mime, size_t l, bool &containsObsFold)
 
         ++e;
     }
-    PROF_stop(headersEnd);
 
     if (3 == state)
         return e;
index b8a368278a6bc2e8ddbe3bd2de13ce731a78ab08..06a31f342fd4283f04a66918152f6ba1feecdaf6 100644 (file)
@@ -17,7 +17,6 @@
 #include "http/one/RequestParser.h"
 #include "http/Stream.h"
 #include "HttpHeaderTools.h"
-#include "profiler/Profiler.h"
 #include "servers/Http1Server.h"
 #include "SquidConfig.h"
 #include "Store.h"
@@ -73,8 +72,6 @@ Http::One::Server::noteMoreBodySpaceAvailable(BodyPipe::Pointer)
 Http::Stream *
 Http::One::Server::parseOneRequest()
 {
-    PROF_start(HttpServer_parseOneRequest);
-
     // reset because the protocol may have changed if this is the first request
     // and because we never bypass parsing failures of N+1st same-proto request
     preservingClientData_ = shouldPreserveClientData();
@@ -88,7 +85,6 @@ Http::One::Server::parseOneRequest()
     /* Process request */
     Http::Stream *context = parseHttpRequest(parser_);
 
-    PROF_stop(HttpServer_parseOneRequest);
     return context;
 }
 
index 6b7cb986d89187237e044bf34d7fbe65cfb279f6..b86d27cd8e1bf8802aa4ac91e1f7faa406c9beb5 100644 (file)
@@ -13,7 +13,6 @@
 #include "HttpReply.h"
 #include "mem_node.h"
 #include "MemObject.h"
-#include "profiler/Profiler.h"
 #include "stmem.h"
 
 /*
@@ -341,14 +340,12 @@ mem_hdr::nodeToRecieve(int64_t offset)
 bool
 mem_hdr::write (StoreIOBuffer const &writeBuffer)
 {
-    PROF_start(mem_hdr_write);
     debugs(19, 6, "mem_hdr::write: " << this << " " << writeBuffer.range() << " object end " << endOffset());
 
     if (unionNotEmpty(writeBuffer)) {
         debugs(19, DBG_CRITICAL, "mem_hdr::write: writeBuffer: " << writeBuffer.range());
         debugDump();
         fatal_dump("Attempt to overwrite already in-memory data. Preceding this there should be a mem_hdr::write output that lists the attempted write, and the currently present data. Please get a 'backtrace full' from this error - using the generated core, and file a bug report with the squid developers including the last 10 lines of cache.log and the backtrace.\n");
-        PROF_stop(mem_hdr_write);
         return false;
     }
 
@@ -367,7 +364,6 @@ mem_hdr::write (StoreIOBuffer const &writeBuffer)
         currentSource += wrote;
     }
 
-    PROF_stop(mem_hdr_write);
     return true;
 }
 
index 6031f4931120763648bba239b84505ddbb6b57cf..5d7385f6347985af0d8d657f3b58c8c3a4c23005 100644 (file)
@@ -33,7 +33,6 @@
 #include "MemStore.h"
 #include "mgr/Registration.h"
 #include "mgr/StoreIoAction.h"
-#include "profiler/Profiler.h"
 #include "repl_modules.h"
 #include "RequestFlags.h"
 #include "SquidConfig.h"
@@ -796,14 +795,12 @@ StoreEntry::write (StoreIOBuffer writeBuffer)
 {
     assert(mem_obj != NULL);
     /* This assert will change when we teach the store to update */
-    PROF_start(StoreEntry_write);
     assert(store_status == STORE_PENDING);
 
     // XXX: caller uses content offset, but we also store headers
     writeBuffer.offset += mem_obj->baseReply().hdr_sz;
 
     debugs(20, 5, "storeWrite: writing " << writeBuffer.length << " bytes for '" << getMD5Text() << "'");
-    PROF_stop(StoreEntry_write);
     storeGetMemSpace(writeBuffer.length);
     mem_obj->write(writeBuffer);
 
@@ -1137,10 +1134,8 @@ StoreEntry::abort()
 void
 storeGetMemSpace(int size)
 {
-    PROF_start(storeGetMemSpace);
     if (!shutting_down) // Store::Root() is FATALly missing during shutdown
         Store::Root().freeMemorySpace(size);
-    PROF_stop(storeGetMemSpace);
 }
 
 /* thunk through to Store::Root().maintain(). Note that this would be better still
@@ -1165,14 +1160,12 @@ Store::Maintain(void *)
 void
 StoreEntry::release(const bool shareable)
 {
-    PROF_start(storeRelease);
     debugs(20, 3, shareable << ' ' << *this << ' ' << getMD5Text());
     /* If, for any reason we can't discard this object because of an
      * outstanding request, mark it for pending release */
 
     if (locked()) {
         releaseRequest(shareable);
-        PROF_stop(storeRelease);
         return;
     }
 
@@ -1183,14 +1176,12 @@ StoreEntry::release(const bool shareable)
         lock("storeLateRelease");
         releaseRequest(shareable);
         LateReleaseStack.push(this);
-        PROF_stop(storeRelease);
         return;
     }
 
     storeLog(STORE_LOG_RELEASE, this);
     Store::Root().evictCached(*this);
     destroyStoreEntry(static_cast<hash_link *>(this));
-    PROF_stop(storeRelease);
 }
 
 static void
index a0ae0e72e875b8ac71c4a2f2a12cb53cc48896f5..abfdc48c00243b97b0ddff8a114996246ab4d62e 100644 (file)
@@ -11,7 +11,6 @@
 #include "squid.h"
 #include "mem_node.h"
 #include "MemStore.h"
-#include "profiler/Profiler.h"
 #include "SquidConfig.h"
 #include "SquidMath.h"
 #include "store/Controller.h"
@@ -94,7 +93,6 @@ Store::Controller::maintain()
 {
     static time_t last_warn_time = 0;
 
-    PROF_start(storeMaintainSwapSpace);
     swapDir->maintain();
 
     /* this should be emitted by the oversize dir, not globally */
@@ -107,8 +105,6 @@ Store::Controller::maintain()
             last_warn_time = squid_curtime;
         }
     }
-
-    PROF_stop(storeMaintainSwapSpace);
 }
 
 void
@@ -232,15 +228,8 @@ Store::Controller::sync(void)
 int
 Store::Controller::callback()
 {
-    /* This will likely double count. That's ok. */
-    PROF_start(storeDirCallback);
-
     /* mem cache callbacks ? */
-    int result = swapDir->callback();
-
-    PROF_stop(storeDirCallback);
-
-    return result;
+    return swapDir->callback();
 }
 
 /// update reference counters of the recently touched entry
index b85da0f38df0cc99684e2145a7e26ee90acde356..2021241df637af4c0e09a556df6a84f21d3db925 100644 (file)
@@ -14,7 +14,6 @@
 #include "Debug.h"
 #include "DebugMessages.h"
 #include "globals.h"
-#include "profiler/Profiler.h"
 #include "sbuf/Stream.h"
 #include "SquidConfig.h"
 #include "Store.h"
index 68baed5410c6d62afce0b6874e8270e8440be947..d4cf63057d2264a1fe13be4c20cad8e5149a1148 100644 (file)
@@ -18,7 +18,6 @@
 #include "MemBuf.h"
 #include "MemObject.h"
 #include "mime_header.h"
-#include "profiler/Profiler.h"
 #include "SquidConfig.h"
 #include "StatCounters.h"
 #include "Store.h"
@@ -259,12 +258,10 @@ store_client::copy(StoreEntry * anEntry,
     static bool copying (false);
     assert (!copying);
     copying = true;
-    PROF_start(storeClient_kickReads);
     /* we might be blocking comm reads due to readahead limits
      * now we have a new offset, trigger those reads...
      */
     entry->mem_obj->kickReads();
-    PROF_stop(storeClient_kickReads);
     copying = false;
 
     anEntry->lock("store_client::copy"); // see deletion note below
@@ -759,8 +756,6 @@ StoreEntry::invokeHandlers()
     dlink_node *nx = NULL;
     dlink_node *node;
 
-    PROF_start(InvokeHandlers);
-
     debugs(90, 3, mem_obj->nclients << " clients; " << *this << ' ' << getMD5Text());
     /* walk the entire list looking for valid callbacks */
 
@@ -781,7 +776,6 @@ StoreEntry::invokeHandlers()
         storeClientCopy2(this, sc);
     }
     CodeContext::Reset(savedContext);
-    PROF_stop(InvokeHandlers);
 }
 
 // Does not account for remote readers/clients.
index 2490f0d6bb74a6fc47d2665eec1f02ebc7cc7366..6f9365516125b8ce4c9cfed7f8e5f8a79f30120f 100644 (file)
@@ -10,7 +10,6 @@
 #define SQUID_WORDLIST_H
 
 #include "globals.h"
-#include "profiler/Profiler.h"
 #include "sbuf/List.h"
 
 /** A list of C-strings