]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Add in more profiling points
authoradrian <>
Wed, 20 Sep 2006 17:38:13 +0000 (17:38 +0000)
committeradrian <>
Wed, 20 Sep 2006 17:38:13 +0000 (17:38 +0000)
include/profiling.h
src/HttpMsg.cc
src/store_client.cc

index b3fdf33e9aa85f90259bf0711af034364d6d85ed..7b9bc21ff278502e82c8d383bcaea20a01956b73 100644 (file)
@@ -133,6 +133,8 @@ typedef enum {
     XPROF_MemBuf_consume,
     XPROF_MemBuf_append,
     XPROF_MemBuf_grow,
+    XPROF_InvokeHandlers,
+    XPROF_HttpMsg_httpMsgParseStep,
     XPROF_LAST
 } xprof_type;
 
index ad0ddff3a05275c3d6f5fa82fbeaa8181b694131..070855121d4d8189b2e2f99631118ea46e545c62 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: HttpMsg.cc,v 1.30 2006/05/27 00:35:05 robertc Exp $
+ * $Id: HttpMsg.cc,v 1.31 2006/09/20 11:38:14 adrian Exp $
  *
  * DEBUG: section 74    HTTP Message
  * AUTHOR: Alex Rousskov
@@ -243,15 +243,22 @@ HttpMsg::httpMsgParseStep(const char *buf, int atEnd)
     const char **parse_end_ptr = &blk_end;
     assert(parse_start);
     assert(pstate < psParsed);
+    int retval;
 
     *parse_end_ptr = parse_start;
 
+    PROF_start(HttpMsg_httpMsgParseStep);
+
     if (pstate == psReadyToParseStartLine) {
-        if (!httpMsgIsolateStart(&parse_start, &blk_start, &blk_end))
-            return 0;
+        if (!httpMsgIsolateStart(&parse_start, &blk_start, &blk_end)) {
+            retval = 0;
+           goto finish;
+       }
 
-        if (!parseFirstLine(blk_start, blk_end))
-            return httpMsgParseError();
+        if (!parseFirstLine(blk_start, blk_end)) {
+            retval = httpMsgParseError();
+           goto finish;
+       }
 
         *parse_end_ptr = parse_start;
 
@@ -262,10 +269,12 @@ HttpMsg::httpMsgParseStep(const char *buf, int atEnd)
 
     if (pstate == psReadyToParseHeaders) {
         if (!httpMsgIsolateHeaders(&parse_start, &blk_start, &blk_end)) {
-            if (atEnd)
+            if (atEnd) {
                 blk_start = parse_start, blk_end = blk_start + strlen(blk_start);
-            else
-                return 0;
+           } else {
+               retval = 0;
+               goto finish;
+            }
         }
 
         if (!header.parse(blk_start, blk_end))
@@ -279,8 +288,10 @@ HttpMsg::httpMsgParseStep(const char *buf, int atEnd)
 
         ++pstate;
     }
-
-    return 1;
+    retval = 1;
+finish:
+    PROF_stop(HttpMsg_httpMsgParseStep);
+    return retval;
 }
 
 /* handy: resets and returns -1 */
index 3c11fbe14fd94627fbc1562ab3f2089cc908153c..523c5bda4cc8f56930c98a2e8855349ee77b1901 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_client.cc,v 1.147 2006/08/07 02:28:22 robertc Exp $
+ * $Id: store_client.cc,v 1.148 2006/09/20 11:38:14 adrian Exp $
  *
  * DEBUG: section 90    Storage Manager Client-Side Interface
  * AUTHOR: Duane Wessels
@@ -716,6 +716,8 @@ InvokeHandlers(StoreEntry * e)
     dlink_node *nx = NULL;
     dlink_node *node;
 
+    PROF_start(InvokeHandlers);
+
     debug(90, 3) ("InvokeHandlers: %s\n", e->getMD5Text());
     /* walk the entire list looking for valid callbacks */
 
@@ -732,6 +734,7 @@ InvokeHandlers(StoreEntry * e)
 
         storeClientCopy2(e, sc);
     }
+    PROF_stop(InvokeHandlers);
 }
 
 int