PR_fprintf(globals.mRequest.mFD, "<tr><td>Heap Object Count:</td><td align=right>%u</td></tr>\n", thisRun->mStats.mCompositeCount); PR_fprintf(globals.mRequest.mFD, "<tr><td>Heap Operation Seconds:</td><td align=right>" ST_MICROVAL_FORMAT "</td></tr>\n", ST_MICROVAL_PRINTABLE(thisRun->mStats.mHeapRuntimeCost));
int displayCallsiteDetails(tmcallsite* aCallsite){    int retval = 0;    if(NULL != aCallsite && NULL != aCallsite->method)    {        STRun* sortedRun = NULL;        STRun* thisRun = CALLSITE_RUN(aCallsite);        PR_fprintf(globals.mRequest.mFD, "%s+%u(%u) Callsite Details:<p>\n", tmgraphnode_name(aCallsite->method), aCallsite->offset, (PRUint32)aCallsite->entry.key);        PR_fprintf(globals.mRequest.mFD, "<table border=0>\n");        PR_fprintf(globals.mRequest.mFD, "<tr><td>Composite Byte Size:</td><td align=right>%u</td></tr>\n", thisRun->mStats.mSize);        PR_fprintf(globals.mRequest.mFD, "<tr><td>Composite Seconds:</td><td align=right>" ST_TIMEVAL_FORMAT "</td></tr>\n", ST_TIMEVAL_PRINTABLE64(thisRun->mStats.mTimeval64));        PR_fprintf(globals.mRequest.mFD, "<tr><td>Composite Weight:</td><td align=right>%llu</td></tr>\n", thisRun->mStats.mWeight64);        PR_fprintf(globals.mRequest.mFD, "</table>\n<p>\n");        /*        ** Kids (callsites we call):        */        if(NULL != aCallsite->kids && NULL != aCallsite->kids->method)        {            int displayRes = 0;            PRUint32 siteCount = 0;            tmcallsite** sites = NULL;            /*            ** Collect the kid sibling callsites.            ** Doing it this way sorts them for relevance.            */            siteCount = callsiteArrayFromCallsite(&sites, 0, aCallsite->kids, ST_FOLLOW_SIBLINGS);            if(0 != siteCount && NULL != sites)            {                /*                ** Got something to show.                */                PR_fprintf(globals.mRequest.mFD, "Children Callsites:<br>\n");                displayRes = displayTopCallsites(sites, siteCount, 0, __LINE__);                if(0 != displayRes)                {                    retval = __LINE__;                    REPORT_ERROR(__LINE__, displayTopCallsites);                }                PR_fprintf(globals.mRequest.mFD, "<p>\n");                /*                ** Done with array.                */                free(sites);                sites = NULL;            }        }        /*        ** Parents (those who call us):        */        if(NULL != aCallsite->parent && NULL != aCallsite->parent->method)        {            int displayRes = 0;            PR_fprintf(globals.mRequest.mFD, "Parent Callsites:<br>\n");            displayRes = displayCallsites(aCallsite->parent, ST_FOLLOW_PARENTS, 0, __LINE__);            if(0 != displayRes)            {                retval = __LINE__;                REPORT_ERROR(__LINE__, displayCallsites);            }            PR_fprintf(globals.mRequest.mFD, "<p>\n");        }        /*        ** Allocations we did.        ** Simply harvest our own run.        */        sortedRun = createRun(0);        if(NULL != sortedRun)        {            int harvestRes = 0;            harvestRes = harvestRun(CALLSITE_RUN(aCallsite), sortedRun, NULL);            if(0 == harvestRes)            {                if(0 != sortedRun->mAllocationCount)                {                    int sortRes = 0;                    sortRes = sortRun(sortedRun);                    if(0 == sortRes)                    {                        int displayRes = 0;                        PR_fprintf(globals.mRequest.mFD, "Allocations:<br>\n");                        displayRes = displayTopAllocations(sortedRun, 0);                        if(0 != displayRes)                        {                            retval = __LINE__;                            REPORT_ERROR(__LINE__, displayTopAllocations);                        }                        PR_fprintf(globals.mRequest.mFD, "<p>\n");                    }                    else                    {                        retval = __LINE__;                        REPORT_ERROR(__LINE__, sortRun);                    }                }            }            else            {                retval = __LINE__;                REPORT_ERROR(__LINE__, harvestRun);            }            /*            ** Done with the run.            */            freeRun(sortedRun);            sortedRun = NULL;        }        else        {            retval = __LINE__;            REPORT_ERROR(__LINE__, createRun);        }    }    else    {        retval = __LINE__;        REPORT_ERROR(__LINE__, displayCallsiteDetails);    }    return retval;}