--------------------- PatchSet 5364 Date: 2002/10/13 06:52:30 Author: rbcollins Branch: esi Tag: (none) Log: add ESI profiling details Members: include/profiling.h:1.1.24.1->1.1.24.2 src/ESI.c:1.1.2.37->1.1.2.38 src/ESIExpression.c:1.1.2.3->1.1.2.4 src/client_side_reply.c:1.1.2.31->1.1.2.32 Index: squid/include/profiling.h =================================================================== RCS file: /cvsroot/squid-sf//squid/include/Attic/profiling.h,v retrieving revision 1.1.24.1 retrieving revision 1.1.24.2 diff -u -r1.1.24.1 -r1.1.24.2 --- squid/include/profiling.h 2 Oct 2002 12:54:13 -0000 1.1.24.1 +++ squid/include/profiling.h 13 Oct 2002 06:52:30 -0000 1.1.24.2 @@ -83,6 +83,11 @@ XPROF_file_read, XPROF_file_write, XPROF_file_close, +#ifdef ESI + XPROF_esiExpressionEval, + XPROF_esiProcessing, + XPROF_esiParsing, +#endif XPROF_LAST } xprof_type; Index: squid/src/ESI.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/ESI.c,v retrieving revision 1.1.2.37 retrieving revision 1.1.2.38 diff -u -r1.1.2.37 -r1.1.2.38 --- squid/src/ESI.c 24 Sep 2002 12:12:53 -0000 1.1.2.37 +++ squid/src/ESI.c 13 Oct 2002 06:52:30 -0000 1.1.2.38 @@ -1,6 +1,6 @@ /* - * $Id: ESI.c,v 1.1.2.37 2002/09/24 12:12:53 rbcollins Exp $ + * $Id: ESI.c,v 1.1.2.38 2002/10/13 06:52:30 rbcollins Exp $ * * DEBUG: section 86 ESI processing * AUTHOR: Robert Collins @@ -1224,6 +1224,8 @@ if (context->buffered) { context->flags.parsing = 1; /* we don't keep any data around */ + + PROF_start(esiParsing); while (context->buffered) { esiSegment *temp; @@ -1238,11 +1240,13 @@ debug (86,0)("%s", tempstr); if (!context->errormessage) context->errormessage = xstrdup (tempstr); + PROF_stop(esiParsing); return ESI_PROCESS_FAILED; } if (context->flags.error) { context->errorpage = ERR_ESI; context->errorstatus = HTTP_INTERNAL_SERVER_ERROR; + PROF_stop(esiParsing); return ESI_PROCESS_FAILED; } @@ -1251,6 +1255,9 @@ context->buffered = temp->next; cbdataFree (temp); } + + PROF_stop(esiParsing); + /* Tel the read code to allocate a new buffer */ context->incoming = NULL; context->flags.parsing = 0; @@ -1259,7 +1266,9 @@ /* ok, we've done all we can with the data. What can we process now? */ { - esiProcessResult_t status = PROCESS(context->tree, 0); + esiProcessResult_t status; + PROF_start(esiProcessing); + status = PROCESS(context->tree, 0); switch (status) { case ESI_PROCESS_COMPLETE: debug (86,5)("esiProcess: tree Processed OK\n"); @@ -1276,6 +1285,7 @@ context->errorstatus = HTTP_INTERNAL_SERVER_ERROR; if (!context->errormessage) context->errormessage = xstrdup("esiProcess: ESI template Processing failed."); + PROF_stop(esiProcessing); return ESI_PROCESS_FAILED; break; } @@ -1298,7 +1308,7 @@ if (!context->flags.finishedtemplate && !context->incoming) { context->incoming = context->buffered = cbdataAlloc (esiSegment); } - + PROF_stop(esiProcessing); return status; /* because we have no callbacks */ } } Index: squid/src/ESIExpression.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/ESIExpression.c,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -u -r1.1.2.3 -r1.1.2.4 --- squid/src/ESIExpression.c 25 Aug 2002 09:58:25 -0000 1.1.2.3 +++ squid/src/ESIExpression.c 13 Oct 2002 06:52:30 -0000 1.1.2.4 @@ -1,6 +1,6 @@ /* - * $Id: ESIExpression.c,v 1.1.2.3 2002/08/25 09:58:25 rbcollins Exp $ + * $Id: ESIExpression.c,v 1.1.2.4 2002/10/13 06:52:30 rbcollins Exp $ * * DEBUG: section 86 ESI processing * AUTHOR: Robert Collins @@ -900,6 +900,7 @@ stackmember stack[20]; int stackdepth = 0; char const *end; + PROF_start(esiExpressionEval); while (*s) { stackmember candidate = getsymbol (s, &end); @@ -908,6 +909,7 @@ assert (s != end); if (!addmember (stack, &stackdepth, &candidate)) { + PROF_stop(esiExpressionEval); return 0; } s = end; @@ -916,6 +918,7 @@ { assert (s == end); debug (86,1) ("failed parsing expression\n"); + PROF_stop(esiExpressionEval); return 0; } } @@ -929,16 +932,19 @@ { /* special case - leading operator failed */ debug (86,1) ("invalid expression\n"); + PROF_stop(esiExpressionEval); return 0; } } if (stackdepth == 0) { /* Empty expression - evaluate to false */ + PROF_stop(esiExpressionEval); return 0; } /* if we hit here, we think we have a valid result */ assert (stackdepth == 1); assert (stack[0].valuetype == ESI_EXPR_EXPR); + PROF_stop(esiExpressionEval); return stack[0].value.integral ? 1 : 0; } Index: squid/src/client_side_reply.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/client_side_reply.c,v retrieving revision 1.1.2.31 retrieving revision 1.1.2.32 diff -u -r1.1.2.31 -r1.1.2.32 --- squid/src/client_side_reply.c 13 Oct 2002 04:52:14 -0000 1.1.2.31 +++ squid/src/client_side_reply.c 13 Oct 2002 06:52:30 -0000 1.1.2.32 @@ -1,6 +1,6 @@ /* - * $Id: client_side_reply.c,v 1.1.2.31 2002/10/13 04:52:14 rbcollins Exp $ + * $Id: client_side_reply.c,v 1.1.2.32 2002/10/13 06:52:30 rbcollins Exp $ * * DEBUG: section 88 Client-side Reply Routines * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c) @@ -1545,7 +1545,7 @@ if (http->flags.accel && rep->sline.status != HTTP_FORBIDDEN && !clientAlwaysAllowResponse(rep->sline.status) && esiEnableProcessing(rep)) { - debug(88, 0) ("Enabling ESI processing for %s\n", http->uri); + debug(88, 2) ("Enabling ESI processing for %s\n", http->uri); clientStreamInsertHead(&http->client_stream, esiStreamRead, esiProcessStream, esiStreamDetach, esiStreamStatus, NULL); }