From 4e4ceef6b6420d71af554d0bc7ecdf934ca71363 Mon Sep 17 00:00:00 2001 From: "dp%netscape.com" Date: Tue, 30 Apr 2002 23:44:03 +0000 Subject: [PATCH] printCategoryTree git-svn-id: svn://10.0.0.236/trunk@120361 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/tools/trace-malloc/spacecategory.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/mozilla/tools/trace-malloc/spacecategory.c b/mozilla/tools/trace-malloc/spacecategory.c index 036d38c6fb9..6bab8a09c3a 100644 --- a/mozilla/tools/trace-malloc/spacecategory.c +++ b/mozilla/tools/trace-malloc/spacecategory.c @@ -64,13 +64,6 @@ #include #endif /* HAVE_BOUTELL_GD */ -/* -** Forward declarations -**/ -#if defined(DEBUG_dp) -extern void printCategoryTree(STCategoryNode* root); -#endif - /* ** AddRule ** @@ -594,14 +587,12 @@ PRBool freeNodeRunProcessor(void* clientData, STCategoryNode* node) PRBool printNodeProcessor(void* clientData, STCategoryNode* node) { STCategoryNode* root = (STCategoryNode*) clientData; - if (node->nchildren) - fprintf(stderr, "%-25s [%d children]\n", node->categoryName, node->nchildren); - else - fprintf(stderr, "%-25s [ %7d allocations, %7d size, %4.1f%% ]\n", node->categoryName, - node->run ? node->run->mStats.mCompositeCount:0, - node->run ? node->run->mStats.mSize:0, - node->run ? ((double)node->run->mStats.mSize / root->run->mStats.mSize * 100):0 - ); + fprintf(stderr, "%-25s [ %9s size", node->categoryName, + FormatNumber(node->run ? node->run->mStats.mSize:0)); + fprintf(stderr, ", %5.1f%%", + node->run ? ((double)node->run->mStats.mSize / root->run->mStats.mSize * 100):0); + fprintf(stderr, ", %7s allocations ]\n", + FormatNumber(node->run ? node->run->mStats.mCompositeCount:0)); return PR_TRUE; }