Modified timing macros to include MWContext parameter.

This commit is contained in:
waterson%netscape.com 1998-08-09 20:32:30 +00:00
parent eced28047e
commit 17dec56a44
8 changed files with 51 additions and 37 deletions

View File

@ -221,7 +221,7 @@ lo_DisplayText(MWContext *context,
LO_TextAttr tmp_attr;
LO_TextAttr *hold_attr;
TIMING_STOPCLOCK_OBJECT("layout:blank-screen", context, "displaying text");
TIMING_STOPCLOCK_OBJECT("lo:blank", context, context, "text");
/* Blinking text elements are placed in a separate layer */
if (context->compositor && text->text_attr->attrmask & LO_ATTR_BLINK)

View File

@ -2103,7 +2103,7 @@ lo_FormatImage(MWContext *context, lo_DocState *state, PA_Tag *tag)
{
/* If a lowres image has been specified, we'll actually be
blocking on that, not the real (hires) url */
TIMING_STARTCLOCK_OBJECT("layout:block-on-image", image);
TIMING_STARTCLOCK_NAME("lo:blk-img", image->image_url);
state->top_state->layout_blocking_element = (LO_Element *)image;
}

View File

@ -4349,7 +4349,7 @@ LO_ProcessTag(void *data_object, PA_Tag *tag, intn status)
#endif /* OLD_MSGS */
lo_FinishLayout(context, state, EVENT_LOAD);
TIMING_STOPCLOCK_OBJECT("layout:whole-document", doc_id, "done");
TIMING_STOPCLOCK_OBJECT("lo:doc", doc_id, context, "ok");
}
orig_state->top_state->layout_status = status;
}
@ -4455,8 +4455,8 @@ LO_ProcessTag(void *data_object, PA_Tag *tag, intn status)
lo_GetRecycleList(context, doc_id, doc_data, &recycle_list); /* whh */
#endif /* MEMORY_ARENAS */
TIMING_STARTCLOCK_OBJECT("layout:blank-screen", context);
TIMING_STARTCLOCK_OBJECT("layout:whole-document", doc_id);
TIMING_STARTCLOCK_OBJECT("lo:blank", context);
TIMING_STARTCLOCK_OBJECT("lo:doc", doc_id);
#ifdef LOCAL_DEBUG
XP_TRACE(("Initializing new doc %d\n", doc_id));
@ -5506,7 +5506,7 @@ lo_set_image_info(MWContext *context, int32 ele_id, int32 width, int32 height)
image->height = height;
lo_FinishImage(context, state, image);
TIMING_STOPCLOCK_OBJECT("layout:block-on-image", image, "done");
TIMING_STOPCLOCK_NAME("lo:blk-img", image->image_url, context, "ok");
lo_FlushBlockage(context, state, main_doc_state);
}
else if (top_state->tags != NULL)

View File

@ -227,7 +227,7 @@ lo_create_script_blockage(MWContext *context, lo_DocState *state, int type)
if (type == LO_SCRIPT)
top_state->current_script = block_ele;
TIMING_STARTCLOCK_OBJECT("layout:block-on-script", block_ele);
TIMING_STARTCLOCK_OBJECT("lo:blk-js", block_ele);
return TRUE;
}
@ -393,7 +393,7 @@ lo_unblock_script_tag(MWContext * context, Bool messWithParser)
* style attribute scripts
*/
if (block_ele->type == LO_SCRIPT || block_ele->type == LO_UNKNOWN) {
TIMING_STOPCLOCK_OBJECT("layout:block-on-script", block_ele, "done");
TIMING_STOPCLOCK_OBJECT("lo:blk-js", block_ele, context, "ok");
lo_UnblockLayout(context, top_state);
}
else {

View File

@ -4639,7 +4639,7 @@ lo_BeginTableAttributes(MWContext *context,
}
if (state->top_state->table_nesting_level == 1)
TIMING_STARTCLOCK_OBJECT("layout:top-table", table_ele);
TIMING_STARTCLOCK_OBJECT("lo:blk-tab", table_ele);
table_ele->type = LO_TABLE;
/* Copied into lo_PositionTableElement() */
@ -7658,7 +7658,7 @@ fprintf(stderr, "lo_EndTable called\n");
if (!relayout)
{
if (state->top_state->table_nesting_level == 1)
TIMING_STOPCLOCK_OBJECT("layout:top-table", table->table_ele, "ok");
TIMING_STOPCLOCK_OBJECT("lo:blk-tab", table->table_ele, context, "ok");
state->top_state->table_nesting_level--;
}

View File

@ -784,7 +784,7 @@ net_FindAddress (const char *host_ptr,
PR_Free(msg);
}
TIMING_STARTCLOCK_NAME("dnslookup", (remapped_host_port ? remapped_host_port : host_port));
TIMING_STARTCLOCK_NAME("dns:lookup", (remapped_host_port ? remapped_host_port : host_port));
#ifndef ASYNC_DNS
status = net_dns_lookup(
@ -809,8 +809,8 @@ net_FindAddress (const char *host_ptr,
}
}
TIMING_STOPCLOCK_NAME("dnslookup", (remapped_host_port ? remapped_host_port : host_port),
(hoststruct_pointer ? "ok" : "error"));
TIMING_STOPCLOCK_NAME("dns:lookup", (remapped_host_port ? remapped_host_port : host_port),
window_id, (hoststruct_pointer ? "ok" : "error"));
if (!hoststruct_pointer) {
if(first_dns_failure) {
@ -1260,14 +1260,14 @@ HG71089
return MK_UNABLE_TO_LOCATE_HOST;
}
TIMING_STARTCLOCK_NAME("tcpconnect", url);
TIMING_STARTCLOCK_NAME("tcp:connect", url);
status = net_start_first_connect(host, *sock, window_id,
*tcp_con_data, error_msg);
if(status != MK_WAITING_FOR_CONNECTION)
{
TIMING_STOPCLOCK_NAME("tcpconnect", url, "error");
TIMING_STOPCLOCK_NAME("tcp:connect", url, window_id, "error");
NET_FreeTCPConData(*tcp_con_data);
*tcp_con_data = 0;
}
@ -1378,14 +1378,14 @@ NET_FinishConnect (CONST char *url,
return MK_UNABLE_TO_LOCATE_HOST;
}
TIMING_STARTCLOCK_NAME("tcpconnect", url);
TIMING_STARTCLOCK_NAME("tcp:connect", url);
status = net_start_first_connect(host, *sock, window_id,
*tcp_con_data, error_msg);
if(status != MK_WAITING_FOR_CONNECTION)
{
TIMING_STOPCLOCK_NAME("tcpconnect", url, "error");
TIMING_STOPCLOCK_NAME("tcp:connect", url, window_id, "error");
NET_FreeTCPConData(*tcp_con_data);
*tcp_con_data = 0;
}
@ -1517,7 +1517,7 @@ error_out:
else
FREE(host);
TIMING_STOPCLOCK_NAME("tcpconnect", url, "error");
TIMING_STOPCLOCK_NAME("tcp:connect", url, window_id, "error");
HG92362
if (error == PR_CONNECT_REFUSED_ERROR)
@ -1548,7 +1548,7 @@ error_out:
}
}
TIMING_STOPCLOCK_NAME("tcpconnect", url, "ok");
TIMING_STOPCLOCK_NAME("tcp:connect", url, window_id, "ok");
TRACEMSG(("mktcp.c: Successful connection (message 1)"));
NET_FreeTCPConData(*tcp_con_data);
*tcp_con_data = 0;

View File

@ -2469,7 +2469,7 @@ NET_GetURL (URL_Struct *URL_s,
if (!cache_method)
{
TIMING_MESSAGE(("cache,%s,not found", URL_s->address));
TIMING_MESSAGE(("cache,%.64s,%08x,not found", URL_s->address, window_id));
/* cache testing stuff */
if(NET_IsCacheTraceOn())
@ -2520,7 +2520,7 @@ NET_GetURL (URL_Struct *URL_s,
{
/* the cached file is valid so use it unilaterally
*/
TIMING_MESSAGE(("cache,%s,valid", URL_s->address));
TIMING_MESSAGE(("cache,%.64s,%08x,valid", URL_s->address, window_id));
type = cache_method;
}
else if(URL_s->real_content_length > URL_s->content_length)
@ -2538,12 +2538,14 @@ NET_GetURL (URL_Struct *URL_s,
URL_s->memory_copy = 0;
cache_method = 0;
TRACEMSG(("Getting the rest of a partial cache file"));
TIMING_MESSAGE(("cache,%s,partial", URL_s->address));
TIMING_MESSAGE(("cache,%.64s,%08x,partial", URL_s->address, window_id));
}
else if (URL_s->force_reload != NET_DONT_RELOAD)
{
TRACEMSG(("Force reload flag set. Checking server to see if modified"));
TIMING_MESSAGE(("cache,%s,forced reload", URL_s->address));
TIMING_MESSAGE(("cache,%.64s,%08x,forced reload",
URL_s->address, window_id));
/* cache testing stuff */
if(NET_IsCacheTraceOn())
{
@ -2577,7 +2579,8 @@ NET_GetURL (URL_Struct *URL_s,
URL_s->expires = 0; /* remove cache reference */
cache_method = 0;
TIMING_MESSAGE(("cache,%s,expired", URL_s->address));
TIMING_MESSAGE(("cache,%.64s,%08x,expired",
URL_s->address, window_id));
/* cache testing stuff */
if(NET_IsCacheTraceOn())
@ -2593,14 +2596,18 @@ NET_GetURL (URL_Struct *URL_s,
{
/* the cached file is valid so use it unilaterally
*/
TIMING_MESSAGE(("cache,%s,valid", URL_s->address));
TIMING_MESSAGE(("cache,%.64s,%08x,valid",
URL_s->address, window_id));
type = cache_method;
}
}
else if((NET_CacheUseMethod == CU_NEVER_CHECK || URL_s->history_num)
&& !URL_s->expires)
{
TIMING_MESSAGE(("cache,%s,valid", URL_s->address));
TIMING_MESSAGE(("cache,%.64s,%08x,valid",
URL_s->address, window_id));
type = cache_method;
}
else if(NET_CacheUseMethod == CU_CHECK_ALL_THE_TIME
@ -2624,7 +2631,9 @@ NET_GetURL (URL_Struct *URL_s,
* and it doesn't have an expiration date...
* FORCE Reload it
*/
TIMING_MESSAGE(("cache,%s,forced reload:non-history http", URL_s->address));
TIMING_MESSAGE(("cache,%.64s,%08x,forced reload:non-history http",
URL_s->address, window_id));
TRACEMSG(("Non history http file found. Force reloading it "));
/* strip the cache file and
* memory pointer
@ -2642,7 +2651,9 @@ NET_GetURL (URL_Struct *URL_s,
#endif /* MOZ_OFFLINE */
) /* *X* check for is offline */
{
TIMING_MESSAGE(("cache,%s,forced reload:non-history cgi", URL_s->address));
TIMING_MESSAGE(("cache,%.64s,%08x,forced reload:non-history cgi",
URL_s->address, window_id));
TRACEMSG(("Non history cgi script found (probably)."
" Force reloading it "));
/* cache testing stuff */
@ -2667,7 +2678,8 @@ NET_GetURL (URL_Struct *URL_s,
{
/* the cached file is valid so use it unilaterally
*/
TIMING_MESSAGE(("cache,%s,valid", URL_s->address));
TIMING_MESSAGE(("cache,%.64s,%08x,valid", URL_s->address, window_id));
type = cache_method;
}
}

View File

@ -1640,8 +1640,8 @@ net_send_http_request (ActiveEntry *ce)
TRACEMSG(("Sending HTTP Request:\n---------------------------------"));
TIMING_STARTCLOCK_NAME("http:complete", ce->URL_s->address);
TIMING_STARTCLOCK_NAME("http:request", ce->URL_s->address);
TIMING_STARTCLOCK_NAME("http:xfer", ce->URL_s->address);
TIMING_STARTCLOCK_NAME("http:req", ce->URL_s->address);
ce->status = (int) NET_BlockingWrite(cd->connection->sock, command, command_size);
#if defined(JAVA)
@ -1768,7 +1768,7 @@ net_http_send_post_data (ActiveEntry *ce)
/* normal done
*/
TRACEMSG(("End of post data data"));
TIMING_STOPCLOCK_NAME("http:post", ce->URL_s->address, "ok");
TIMING_STOPCLOCK_NAME("http:post", ce->URL_s->address, ce->window_id, "ok");
/* make sure these are empty
*/
@ -2063,7 +2063,8 @@ net_parse_first_http_line (ActiveEntry *ce)
/* ce->status greater than 0
*/
TIMING_STOPCLOCK_NAME("http:request", ce->URL_s->address, "response received");
TIMING_STOPCLOCK_NAME("http:req", ce->URL_s->address,
ce->window_id, "response received");
BlockAllocCat(cd->line_buffer, cd->line_buffer_size, small_buf, ce->status);
cd->line_buffer_size += ce->status;
@ -3533,7 +3534,8 @@ HG51096
break;
case HTTP_DONE:
TIMING_STOPCLOCK_NAME("http:complete", ce->URL_s->address, "ok");
TIMING_STOPCLOCK_NAME("http:xfer", ce->URL_s->address,
ce->window_id, "ok");
NET_ClearReadSelect(ce->window_id, cd->connection->sock);
NET_TotalNumberOfOpenConnections--;
@ -3566,9 +3568,9 @@ HG51096
break;
case HTTP_ERROR_DONE:
TIMING_STOPCLOCK_NAME("http:post", ce->URL_s->address, "error");
TIMING_STOPCLOCK_NAME("http:request", ce->URL_s->address, "error");
TIMING_STOPCLOCK_NAME("http:complete", ce->URL_s->address, "error");
TIMING_STOPCLOCK_NAME("http:post", ce->URL_s->address, ce->window_id, "error");
TIMING_STOPCLOCK_NAME("http:request", ce->URL_s->address, ce->window_id, "error");
TIMING_STOPCLOCK_NAME("http:complete", ce->URL_s->address, ce->window_id, "error");
if(cd->connection->sock != NULL) {
NET_ClearDNSSelect(ce->window_id, cd->connection->sock);
NET_ClearReadSelect(ce->window_id, cd->connection->sock);