XPROF_esiProcessing,
XPROF_esiParsing,
#endif
+ XPROF_storeClient_kickReads,
+ XPROF_eventRun,
+ XPROF_comm_calliocallback,
+ XPROF_CommReadCallbackData_callCallback,
+ XPROF_CommAcceptCallbackData_callCallback,
+ XPROF_CommWriteCallbackData_callCallback,
+ XPROF_CommFillCallbackData_callCallback,
+ XPROF_HttpStateData_readReply,
+ XPROF_HttpStateData_processReplyData,
+ XPROF_StoreEntry_write,
+ XPROF_storeGetMemSpace,
+ XPROF_MemObject_write,
+ XPROF_storeWriteComplete,
+ XPROF_mem_hdr_write,
XPROF_LAST
} xprof_type;
/*
- * $Id: MemObject.cc,v 1.7 2003/06/24 12:30:59 robertc Exp $
+ * $Id: MemObject.cc,v 1.8 2003/06/24 12:42:25 robertc Exp $
*
* DEBUG: section 19 Store Memory Primitives
* AUTHOR: Robert Collins
void
MemObject::write ( StoreIOBuffer writeBuffer, STMCB *callback, void *callbackData)
{
+ PROF_start(MemObject_write);
debug(19, 6) ("memWrite: offset %lu len %ld\n", (unsigned long)writeBuffer.offset, (long)writeBuffer.length);
/* the offset is into the content, not the headers */
assert (data_hdr.write (writeBuffer));
callback (callbackData, writeBuffer);
+ PROF_stop(MemObject_write);
}
void
/*
- * $Id: comm.cc,v 1.378 2003/06/23 14:13:03 robertc Exp $
+ * $Id: comm.cc,v 1.379 2003/06/24 12:42:25 robertc Exp $
*
* DEBUG: section 5 Socket Functions
* AUTHOR: Harvest Derived
void
CommReadCallbackData::callCallback()
{
+ PROF_start(CommReadCallbackData_callCallback);
callback.handler(result.fd, buf, retval, result.errcode, result.xerrno, callback.data);
+ PROF_stop(CommReadCallbackData_callCallback);
}
void
CommAcceptCallbackData::callCallback()
{
+ PROF_start(CommAcceptCallbackData_callCallback);
callback.handler(result.fd, newfd, &details, result.errcode, result.xerrno, callback.data);
+ PROF_stop(CommAcceptCallbackData_callCallback);
}
void
CommWriteCallbackData::callCallback()
{
+ PROF_start(CommWriteCallbackData_callCallback);
callback.handler(result.fd, buf, retval, result.errcode, result.xerrno, callback.data);
+ PROF_stop(CommWriteCallbackData_callCallback);
}
void
CommFillCallbackData::callCallback()
{
+ PROF_start(CommFillCallbackData_callCallback);
callback.handler(result.fd, sb, result.errcode, result.xerrno, callback.data);
+ PROF_stop(CommFillCallbackData_callCallback);
}
void
comm_calliocallback(void)
{
CommCallbackData *cio;
- dlink_node *node;
int oldseqnum = CommCallbackSeqnum++;
/* Call our callbacks until we hit NULL or the seqnum changes */
- while (CommCallbackList.head != NULL && oldseqnum != ((CommCallbackData *)CommCallbackList.head->data)->result.seqnum) {
+ /* This will likely rap other counts - again, thats ok (for now)
+ * What we should see is the total of the various callback subclasses
+ * equaling this counter.
+ * If they don't, someone has added a class but not profiled it.
+ */
+ PROF_start(comm_calliocallback);
- node = (dlink_node *)CommCallbackList.head;
+ while (CommCallbackList.head != NULL && oldseqnum != ((CommCallbackData *)CommCallbackList.head->data)->result.seqnum) {
+ dlink_node *node = (dlink_node *)CommCallbackList.head;
cio = (CommCallbackData *)node->data;
cio->callACallback();
cio->deleteSelf();
}
+
+ PROF_stop(comm_calliocallback);
}
void
/*
- * $Id: event.cc,v 1.37 2003/05/18 00:34:49 robertc Exp $
+ * $Id: event.cc,v 1.38 2003/06/24 12:42:25 robertc Exp $
*
* DEBUG: section 41 Event Processing
* AUTHOR: Henrik Nordstrom
if (tasks->when > current_dtime)
return;
+ PROF_start(eventRun);
+
run_id++;
debug(41, 5) ("eventRun: RUN ID %d\n", run_id);
memFree(event, MEM_EVENT);
}
+
+ PROF_stop(eventRun);
}
int
/*
- * $Id: http.cc,v 1.415 2003/06/19 13:47:25 hno Exp $
+ * $Id: http.cc,v 1.416 2003/06/24 12:42:25 robertc Exp $
*
* DEBUG: section 11 Hypertext Transfer Protocol (HTTP)
* AUTHOR: Harvest Derived
{
HttpStateData *httpState = static_cast<HttpStateData *>(data);
assert (fd == httpState->fd);
+ PROF_start(HttpStateData_readReply);
httpState->readReply (fd, buf, len, flag, xerrno, data);
+ PROF_stop(HttpStateData_readReply);
}
void
}
}
+ PROF_start(HttpStateData_processReplyData);
processReplyData(buf, len);
+ PROF_stop(HttpStateData_processReplyData);
}
}
/*
- * $Id: stmem.cc,v 1.77 2003/06/24 12:30:59 robertc Exp $
+ * $Id: stmem.cc,v 1.78 2003/06/24 12:42:25 robertc Exp $
*
* DEBUG: section 19 Store Memory Primitives
* AUTHOR: Harvest Derived
bool
mem_hdr::write (StoreIOBuffer const &writeBuffer)
{
+ PROF_start(mem_hdr_write);
// mem_node *tempNode;
debug(19, 6) ("mem_hdr::write: offset %lu len %ld, object end %lu\n", (unsigned long)writeBuffer.offset, (long)writeBuffer.length, (unsigned long)endOffset());
if (unionNotEmpty(writeBuffer)) {
fatal("Attempt to overwrite already in-memory data\n");
+ PROF_stop(mem_hdr_write);
return false;
}
currentSource += wrote;
}
+ PROF_stop(mem_hdr_write);
return true;
}
/*
- * $Id: store.cc,v 1.568 2003/06/23 16:49:13 wessels Exp $
+ * $Id: store.cc,v 1.569 2003/06/24 12:42:27 robertc Exp $
*
* DEBUG: section 20 Storage Manager
* AUTHOR: Harvest Derived
void
storeWriteComplete (void *data, StoreIOBuffer wroteBuffer)
{
+ PROF_start(storeWriteComplete);
StoreEntry *e = (StoreEntry *)data;
- if (EBIT_TEST(e->flags, DELAY_SENDING))
+ if (EBIT_TEST(e->flags, DELAY_SENDING)) {
+ PROF_stop(storeWriteComplete);
return;
+ }
InvokeHandlers(e);
+ PROF_stop(storeWriteComplete);
}
void
if (!writeBuffer.length)
return;
+ PROF_start(StoreEntry_write);
+
debug(20, 5) ("storeWrite: writing %u bytes for '%s'\n",
writeBuffer.length, getMD5Text());
storeGetMemSpace(writeBuffer.length);
mem_obj->write (writeBuffer, storeWriteComplete, this);
+
+ PROF_stop(StoreEntry_write);
}
/* Append incoming data from a primary server to an entry. */
static void
storeGetMemSpace(int size)
{
+ PROF_start(storeGetMemSpace);
StoreEntry *e = NULL;
int released = 0;
static time_t last_check = 0;
size_t pages_needed;
RemovalPurgeWalker *walker;
- if (squid_curtime == last_check)
+ if (squid_curtime == last_check) {
+ PROF_stop(storeGetMemSpace);
return;
+ }
last_check = squid_curtime;
pages_needed = (size / SM_PAGE_SIZE) + 1;
- if (mem_node::InUseCount() + pages_needed < store_pages_max)
+ if (mem_node::InUseCount() + pages_needed < store_pages_max) {
+ PROF_stop(storeGetMemSpace);
return;
+ }
debug(20, 2) ("storeGetMemSpace: Starting, need %d pages\n", pages_needed);
debug(20, 3) ("storeGetMemSpace stats:\n");
debug(20, 3) (" %6d HOT objects\n", hot_obj_count);
debug(20, 3) (" %6d were released\n", released);
+ PROF_stop(storeGetMemSpace);
}
/* The maximum objects to scan for maintain storage space */
/*
- * $Id: store_client.cc,v 1.127 2003/05/19 23:16:48 robertc Exp $
+ * $Id: store_client.cc,v 1.128 2003/06/24 12:42:27 robertc Exp $
*
* DEBUG: section 90 Storage Manager Client-Side Interface
* AUTHOR: Duane Wessels
copyInto.length = copyRequest.length;
copyInto.offset = copyRequest.offset;
+ static bool copying (false);
+ assert (!copying);
+ copying = true;
+ PROF_start(storeClient_kickReads);
/* we might be blocking comm reads due to readahead limits
* now we have a new offset, trigger those reads...
*/
entry->mem_obj->kickReads();
+ PROF_stop(storeClient_kickReads);
+ copying = false;
storeClientCopy2(entry, this);
}
/*
- * $Id: store_dir.cc,v 1.145 2003/02/21 22:50:12 robertc Exp $
+ * $Id: store_dir.cc,v 1.146 2003/06/24 12:42:27 robertc Exp $
*
* DEBUG: section 47 Store Directory Routines
* AUTHOR: Duane Wessels
}
/*
- * handle callbacks all avaliable fs'es ..
+ * handle callbacks all avaliable fs'es
*/
void
storeDirCallback(void)
{
- int i, j;
- SwapDir *SD;
+ int j;
static int ndir = 0;
+ /* This will likely double count. Thats ok. */
+ PROF_start(storeDirCallback);
+
do {
j = 0;
- for (i = 0; i < Config.cacheSwap.n_configured; i++) {
+ for (int i = 0; i < Config.cacheSwap.n_configured; i++) {
if (ndir >= Config.cacheSwap.n_configured)
ndir = ndir % Config.cacheSwap.n_configured;
- SD = INDEXSD(ndir);
+ SwapDir *SD = INDEXSD(ndir);
++ndir;
} while (j > 0);
ndir++;
+
+ PROF_stop(storeDirCallback);
}
int