From: adrian <> Date: Wed, 20 Sep 2006 12:29:10 +0000 (+0000) Subject: Additional hi-res probes X-Git-Tag: SQUID_3_0_PRE5~62 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2cca9b7d07e1fc203b21d4a09c994d8c0c63b76f;p=thirdparty%2Fsquid.git Additional hi-res probes --- diff --git a/include/profiling.h b/include/profiling.h index 68986f12af..31dc1270d5 100644 --- a/include/profiling.h +++ b/include/profiling.h @@ -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; diff --git a/src/client_side.cc b/src/client_side.cc index d7181ca2b1..7fdfc3d255 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -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) { diff --git a/src/http.cc b/src/http.cc index 5b5795210c..5e9f7075c9 100644 --- a/src/http.cc +++ b/src/http.cc @@ -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; diff --git a/src/mime.cc b/src/mime.cc index 01e1f65513..9976f9f9f5 100644 --- a/src/mime.cc +++ b/src/mime.cc @@ -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;