]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Additional hi-res probes
authoradrian <>
Wed, 20 Sep 2006 12:29:10 +0000 (12:29 +0000)
committeradrian <>
Wed, 20 Sep 2006 12:29:10 +0000 (12:29 +0000)
include/profiling.h
src/client_side.cc
src/http.cc
src/mime.cc

index 68986f12afeee57977308aaf68e50f8573396c32..31dc1270d532e0debe2da5ad5c150cf5f321faad 100644 (file)
@@ -127,6 +127,9 @@ typedef enum {
     XPROF_MemObject_write,
     XPROF_storeWriteComplete,
     XPROF_mem_hdr_write,
+    XPROF_headersEnd,
+    XPROF_parseHttpRequest,
+    XPROF_HttpStateData_processReplyHeader,
     XPROF_LAST
 } xprof_type;
 
index d7181ca2b1382d1677426df25e1d8a270ad2b5bc..7fdfc3d25581164ee256d020cd52a90377a59cd9 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.734 2006/09/19 07:56:57 adrian Exp $
+ * $Id: client_side.cc,v 1.735 2006/09/20 06:29:10 adrian Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -2469,7 +2469,9 @@ clientParseRequest(ConnStateData::Pointer conn, bool &do_next_read)
         conn->in.buf[conn->in.notYetUsed] = '\0';
 
         /* Process request */
+       PROF_start(parseHttpRequest);
         context = parseHttpRequest(conn, &method, &prefix, &req_line_sz, &http_ver);
+       PROF_stop(parseHttpRequest);
 
         /* partial or incomplete request */
         if (!context) {
index 5b5795210c8ab6e69a09f664fb4c73065707ca0a..5e9f7075c95b043b6938f4760ecb1088f05d97c3 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: http.cc,v 1.506 2006/09/19 07:56:57 adrian Exp $
+ * $Id: http.cc,v 1.507 2006/09/20 06:29:10 adrian Exp $
  *
  * DEBUG: section 11    Hypertext Transfer Protocol (HTTP)
  * AUTHOR: Harvest Derived
@@ -1039,14 +1039,17 @@ HttpStateData::readReply (size_t len, comm_err_t flag, int xerrno)
         /* Connection closed; retrieval done. */
         eof = 1;
 
-        if (!flags.headers_parsed)
+        if (!flags.headers_parsed) {
             /*
             * When we called processReplyHeader() before, we
             * didn't find the end of headers, but now we are
             * definately at EOF, so we want to process the reply
             * headers.
              */
+           PROF_start(HttpStateData_processReplyHeader);
             processReplyHeader();
+           PROF_stop(HttpStateData_processReplyHeader);
+       }
         else if (getReply()->sline.status == HTTP_INVALID_HEADER && HttpVersion(0,9) != getReply()->sline.version) {
             fwd->fail(errorCon(ERR_INVALID_RESP, HTTP_BAD_GATEWAY, fwd->request));
             flags.do_next_read = 0;
@@ -1063,7 +1066,9 @@ HttpStateData::readReply (size_t len, comm_err_t flag, int xerrno)
         }
     } else {
         if (!flags.headers_parsed) {
+           PROF_start(HttpStateData_processReplyHeader);
             processReplyHeader();
+           PROF_stop(HttpStateData_processReplyHeader);
 
             if (flags.headers_parsed) {
                 bool fail = reply == NULL;
index 01e1f655136cded51f053d1014e2a62fd425ccb8..9976f9f9f57d61f23f5913a0055868c6a6932881 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: mime.cc,v 1.127 2006/05/19 17:05:18 wessels Exp $
+ * $Id: mime.cc,v 1.128 2006/09/20 06:29:10 adrian Exp $
  *
  * DEBUG: section 25    MIME Parsing
  * AUTHOR: Harvest Derived
@@ -180,6 +180,8 @@ headersEnd(const char *mime, size_t l)
     size_t e = 0;
     int state = 1;
 
+    PROF_start(headersEnd);
+
     while (e < l && state < 3) {
         switch (state) {
 
@@ -214,6 +216,7 @@ headersEnd(const char *mime, size_t l)
 
         e++;
     }
+    PROF_stop(headersEnd);
 
     if (3 == state)
         return e;