From: adrian <> Date: Wed, 20 Sep 2006 17:38:13 +0000 (+0000) Subject: Add in more profiling points X-Git-Tag: SQUID_3_0_PRE5~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ea37c79600ed7539576e0ceb1c7227122ff3ad5;p=thirdparty%2Fsquid.git Add in more profiling points --- diff --git a/include/profiling.h b/include/profiling.h index b3fdf33e9a..7b9bc21ff2 100644 --- a/include/profiling.h +++ b/include/profiling.h @@ -133,6 +133,8 @@ typedef enum { XPROF_MemBuf_consume, XPROF_MemBuf_append, XPROF_MemBuf_grow, + XPROF_InvokeHandlers, + XPROF_HttpMsg_httpMsgParseStep, XPROF_LAST } xprof_type; diff --git a/src/HttpMsg.cc b/src/HttpMsg.cc index ad0ddff3a0..070855121d 100644 --- a/src/HttpMsg.cc +++ b/src/HttpMsg.cc @@ -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 */ diff --git a/src/store_client.cc b/src/store_client.cc index 3c11fbe14f..523c5bda4c 100644 --- a/src/store_client.cc +++ b/src/store_client.cc @@ -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