Changeset 3565 for trunk/kStuff/kProfile/prfreader.cpp.h
- Timestamp:
- Aug 27, 2007, 6:06:17 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kStuff/kProfile/prfreader.cpp.h
r3537 r3565 1 1 /* $Id: $ */ 2 2 /** @file 3 * 4 * kProfiler Mark 2 - Reader template.5 * 6 * Copyright (c) 2006 knut st. osmundsen <bird-src-spam@anduin.net.de> 7 * 8 * 9 * This file is part of k LIBC.10 * 11 * k LIBC is free software; you can redistribute it and/or modify12 * it under the terms of the GNU General Public License as published by13 * the Free Software Foundation; either version 2 of the License, or14 * (at your option) any later version.15 * 16 * k LIBCis distributed in the hope that it will be useful,3 * kProfiler Mark 2 - Reader Code Template. 4 */ 5 6 /* 7 * Copyright (c) 2006-2007 knut st. osmundsen <bird-src-spam@anduin.net> 8 * 9 * This file is part of kProfiler. 10 * 11 * kProfiler is free software; you can redistribute it and/or 12 * modify it under the terms of the GNU Lesser General Public 13 * License as published by the Free Software Foundation; either 14 * version 2.1 of the License, or (at your option) any later version. 15 * 16 * kProfiler is distributed in the hope that it will be useful, 17 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 * GNUGeneral Public License for more details.20 * 21 * You should have received a copy of the GNU General Public License22 * along with kLIBC; if not, write to the Free Software23 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston, MA 02111-1307USA18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 * Lesser General Public License for more details. 20 * 21 * You should have received a copy of the GNU Lesser General Public 22 * License along with kProfiler; if not, write to the Free Software 23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 24 * 25 25 */ … … 36 36 * @param pOut Where to write error messages. 37 37 */ 38 static bool KPRF_NAME(IsValid)(KPRF_TYPE(PC,HDR) pHdr, uint32_tcb, FILE *pOut)38 static bool KPRF_NAME(IsValid)(KPRF_TYPE(PC,HDR) pHdr, KU32 cb, FILE *pOut) 39 39 { 40 40 KPRF_TYPE(,UPTR) uMaxPtr = ~(KPRF_TYPE(,UPTR))0 - pHdr->uBasePtr; … … 43 43 * Iterate the module segments. 44 44 */ 45 uint32_toff = pHdr->offModSegs;45 KU32 off = pHdr->offModSegs; 46 46 while (off < pHdr->offModSegs + pHdr->cbModSegs) 47 47 { 48 48 KPRF_TYPE(PC,MODSEG) pCur = KPRF_OFF2PTR(PC,MODSEG, off, pHdr); 49 uint32_tcbCur = KPRF_OFFSETOF(MODSEG, szPath[pCur->cchPath + 1]);49 KU32 cbCur = KPRF_OFFSETOF(MODSEG, szPath[pCur->cchPath + 1]); 50 50 cbCur = KPRF_ALIGN(cbCur, KPRF_SIZEOF(UPTR)); 51 51 if (cbCur + off > pHdr->offModSegs + pHdr->cbModSegs) … … 73 73 */ 74 74 KPRF_TYPE(PC,FUNC) paFuncs = KPRF_OFF2PTR(PC,FUNC, pHdr->offFunctions, pHdr); 75 for ( uint32_ti = 0; i < pHdr->cFunctions; i++)75 for (KU32 i = 0; i < pHdr->cFunctions; i++) 76 76 { 77 77 KPRF_TYPE(PC,FUNC) pCur = &paFuncs[i]; … … 97 97 */ 98 98 KPRF_TYPE(PC,THREAD) paThreads = KPRF_OFF2PTR(PC,THREAD, pHdr->offThreads, pHdr); 99 for ( uint32_ti = 0; i < pHdr->cThreads; i++)99 for (KU32 i = 0; i < pHdr->cThreads; i++) 100 100 { 101 101 KPRF_TYPE(PC,THREAD) pCur = &paThreads[i]; … … 148 148 "----------------\n", 149 149 pHdr->offModSegs, pHdr->cbModSegs, pHdr->cbMaxModSegs); 150 uint32_toff = pHdr->offModSegs;150 KU32 off = pHdr->offModSegs; 151 151 while (off < pHdr->offModSegs + pHdr->cbModSegs) 152 152 { 153 153 KPRF_TYPE(PC,MODSEG) pCur = KPRF_OFF2PTR(PC,MODSEG, off, pHdr); 154 uint32_tcbCur = KPRF_OFFSETOF(MODSEG, szPath[pCur->cchPath + 1]);154 KU32 cbCur = KPRF_OFFSETOF(MODSEG, szPath[pCur->cchPath + 1]); 155 155 cbCur = KPRF_ALIGN(cbCur, KPRF_SIZEOF(UPTR)); 156 156 … … 172 172 pHdr->offFunctions, pHdr->cFunctions, pHdr->cMaxFunctions); 173 173 KPRF_TYPE(PC,FUNC) paFuncs = KPRF_OFF2PTR(PC,FUNC, pHdr->offFunctions, pHdr); 174 for ( uint32_ti = 0; i < pHdr->cFunctions; i++)174 for (KU32 i = 0; i < pHdr->cFunctions; i++) 175 175 { 176 176 KPRF_TYPE(PC,FUNC) pCur = &paFuncs[i]; … … 188 188 189 189 #if 1 190 P RTDBGMOD pMod;191 int rc = RTDbgModuleOpen(pModSeg->szPath, &pMod);192 if ( RT_SUCCESS(rc))190 PKDBGMOD pMod; 191 int rc = kDbgModuleOpen(&pMod, pModSeg->szPath, NULL /* pLdrMod */); 192 if (!rc) 193 193 { 194 RTDBGSYMBOL Sym;195 rc = RTDbgModuleQuerySymbol(pMod, pModSeg->iSegment, (RTUINTPTR)(pCur->uEntryPtr - pModSeg->uBasePtr), &Sym);196 if ( RT_SUCCESS(rc))194 KDBGSYMBOL Sym; 195 rc = kDbgModuleQuerySymbol(pMod, pModSeg->iSegment, pCur->uEntryPtr - pModSeg->uBasePtr, &Sym); 196 if (!rc) 197 197 { 198 198 fprintf(pOut, " %s\n", Sym.szName); 199 199 } 200 RTDbgModuleClose(pMod);200 kDbgModuleClose(pMod); 201 201 } 202 202 #endif … … 214 214 pHdr->offThreads, pHdr->cThreads, pHdr->cMaxThreads, pHdr->cStacks, pHdr->cMaxStacks, pHdr->cMaxStackFrames); 215 215 KPRF_TYPE(PC,THREAD) paThreads = KPRF_OFF2PTR(PC,THREAD, pHdr->offThreads, pHdr); 216 for ( uint32_ti = 0; i < pHdr->cThreads; i++)216 for (KU32 i = 0; i < pHdr->cThreads; i++) 217 217 { 218 218 KPRF_TYPE(PC,THREAD) pCur = &paThreads[i]; … … 248 248 { 249 249 /** AVL node core. The key is the data set offset of the module segment record. */ 250 AVLU32NODECORE Core; 250 KDBGADDR offSegment; 251 struct KPRF_TYPE(,REPORTMODSEG) *mpLeft; /**< AVL left branch. */ 252 struct KPRF_TYPE(,REPORTMODSEG) *mpRight; /**< AVL rigth branch. */ 251 253 /** Pointer to the next segment for the module. */ 252 254 KPRF_TYPE(P,REPORTMODSEG) pNext; … … 256 258 KPRF_TYPE(P,REPORTMOD) pMod; 257 259 /** The time this segment has spent on the stack.. */ 258 uint64_tOnStackTicks;260 KU64 OnStackTicks; 259 261 /** The time this segment has spent on the top of the stack.. */ 260 uint64_tOnTopOfStackTicks;262 KU64 OnTopOfStackTicks; 261 263 /** The number of profiled functions from this segment. */ 262 uint32_t cFunctions; 264 KU32 cFunctions; 265 KU8 mHeight; /**< AVL Subtree height. */ 263 266 } KPRF_TYPE(,REPORTMODSEG), *KPRF_TYPE(P,REPORTMODSEG); 264 267 268 /* Instantiate the AVL tree code. */ 269 #define KAVL_CHECK_FOR_EQUAL_INSERT 270 #define KAVL_MAX_STACK 32 271 #define KAVL_STD_KEY_COMP 272 #define mKey offSegment 273 #define KAVLKEY KDBGADDR 274 #define KAVLNODE KPRF_TYPE(,REPORTMODSEG) 275 #define KAVL_FN(name) KPRF_NAME(ReportTree ## name) 276 #define KAVL_TYPE(prefix,name) KPRF_TYPE(prefix, REPORTMODESEG ## name) 277 #define KAVL_INT(name) KPRF_NAME(REPORTMODESEGINT ## name) 278 #define KAVL_DECL(type) K_DECL_INLINE(type) 279 #include <k/kAvlTmpl/kAvlBase.h> 280 #include <k/kAvlTmpl/kAvlDestroy.h> 281 #include <k/kAvlTmpl/kAvlGet.h> 282 #include <k/kAvlTmpl/kAvlUndef.h> 283 265 284 266 285 /** … … 272 291 { 273 292 /** The module number. */ 274 uint32_tiMod;293 KU32 iMod; 275 294 /** Pointer to the next module in the list. */ 276 295 KPRF_TYPE(P,REPORTMOD) pNext; … … 278 297 KPRF_TYPE(P,REPORTMODSEG) pFirstSeg; 279 298 /** The debug module handle. */ 280 P RTDBGMODpDbgMod;299 PKDBGMOD pDbgMod; 281 300 /** The time this segment has spent on the stack.. */ 282 uint64_tOnStackTicks;301 KU64 OnStackTicks; 283 302 /** The time this segment has spent on the top of the stack.. */ 284 uint64_tOnTopOfStackTicks;303 KU64 OnTopOfStackTicks; 285 304 /** The number of profiled functions from this segment. */ 286 uint32_tcFunctions;305 KU32 cFunctions; 287 306 } KPRF_TYPE(,REPORTMOD), *KPRF_TYPE(P,REPORTMOD); 288 307 … … 300 319 KPRF_TYPE(P,REPORTMODSEG) pModSeg; 301 320 /** Pointer to the function symbol. */ 302 P RTDBGSYMBOLpSym;321 PKDBGSYMBOL pSym; 303 322 /** Pointer to the function line number. */ 304 PKDBGLINE pLine;323 PKDBGLINE pLine; 305 324 } KPRF_TYPE(,REPORTFUNC), *KPRF_TYPE(P,REPORTFUNC); 306 325 … … 499 518 { 500 519 /** Pointer to the data set. */ 501 KPRF_TYPE(PC,HDR) pHdr;520 KPRF_TYPE(PC,HDR) pHdr; 502 521 503 522 /** @name Data-set item wrappers. … … 510 529 KPRF_TYPE(P,REPORTMOD) pFirstMod; 511 530 /** The number of modules in the list. */ 512 uint32_tcMods;531 KU32 cMods; 513 532 /** The module segment tree. */ 514 PAVLU32NODECOREpModSegTree;533 KPRF_TYPE(P,REPORTMODSEG) pModSegTree; 515 534 /** The number of module segments in the tree. */ 516 uint32_tcModSegs;535 KU32 cModSegs; 517 536 /** @} */ 518 537 … … 528 547 * @{ */ 529 548 /** Sum of the profiled ticks. */ 530 uint64_tProfiledTicks;549 KU64 ProfiledTicks; 531 550 /** Sum of the overhead ticks. */ 532 uint64_tOverheadTicks;551 KU64 OverheadTicks; 533 552 /** Sum of the sleep ticks. */ 534 uint64_tSleepTicks;553 KU64 SleepTicks; 535 554 /** Sum of calls performed. */ 536 uint64_tcCalls;555 KU64 cCalls; 537 556 /** @} */ 538 557 … … 552 571 * Everything but the mods and modsegs is allocated in the same block as the report. 553 572 */ 554 size_tcb = KPRF_ALIGN(KPRF_SIZEOF(REPORT), 32);555 uintptr_toffThreads = cb;573 KSIZE cb = KPRF_ALIGN(KPRF_SIZEOF(REPORT), 32); 574 KUPTR offThreads = cb; 556 575 cb += KPRF_ALIGN(KPRF_SIZEOF(REPORTTHREAD) * pHdr->cThreads, 32); 557 uintptr_toffFunctions = cb;576 KUPTR offFunctions = cb; 558 577 cb += KPRF_ALIGN(KPRF_SIZEOF(REPORTFUNC) * pHdr->cFunctions, 32); 559 uintptr_toffSortedThreads = cb;578 KUPTR offSortedThreads = cb; 560 579 cb += KPRF_ALIGN(sizeof(KPRF_TYPE(P,REPORTTHREAD)) * pHdr->cThreads, 32); 561 uintptr_toffSortedFunctions = cb;580 KUPTR offSortedFunctions = cb; 562 581 cb += KPRF_ALIGN(sizeof(KPRF_TYPE(P,REPORTFUNC)) * pHdr->cFunctions, 32); 563 582 KPRF_TYPE(P,REPORT) pReport = (KPRF_TYPE(P,REPORT))malloc(cb); … … 569 588 */ 570 589 pReport->pHdr = pHdr; 571 pReport->paThreads = (KPRF_TYPE(P,REPORTTHREAD))(( uint8_t*)pReport + offThreads);572 pReport->paFunctions = (KPRF_TYPE(P,REPORTFUNC))(( uint8_t*)pReport + offFunctions);590 pReport->paThreads = (KPRF_TYPE(P,REPORTTHREAD))((KU8 *)pReport + offThreads); 591 pReport->paFunctions = (KPRF_TYPE(P,REPORTFUNC))((KU8 *)pReport + offFunctions); 573 592 pReport->pFirstMod = NULL; 574 593 pReport->cMods = 0; 575 594 pReport->pModSegTree = NULL; 576 595 pReport->cModSegs = 0; 577 pReport->papSortedThreads = (KPRF_TYPE(P,REPORTTHREAD) *)(( uint8_t*)pReport + offSortedThreads);578 pReport->papSortedFunctions = (KPRF_TYPE(P,REPORTFUNC) *)(( uint8_t*)pReport + offSortedFunctions);596 pReport->papSortedThreads = (KPRF_TYPE(P,REPORTTHREAD) *)((KU8 *)pReport + offSortedThreads); 597 pReport->papSortedFunctions = (KPRF_TYPE(P,REPORTFUNC) *)((KU8 *)pReport + offSortedFunctions); 579 598 pReport->ProfiledTicks = 0; 580 599 pReport->OverheadTicks = 0; … … 593 612 * @param pvParam User parameter, ignored. 594 613 */ 595 static DECLCALLBACK(int) KPRF_NAME(DeleteModSeg)(PAVLU32NODECOREpCore, void *pvParam)614 static int KPRF_NAME(DeleteModSeg)(KPRF_TYPE(P,REPORTMODSEG) pCore, void *pvParam) 596 615 { 597 616 free(pCore); … … 614 633 KPRF_TYPE(P,REPORTMOD) pFree = pReport->pFirstMod; 615 634 pReport->pFirstMod = pFree->pNext; 616 RTDbgModuleClose(pFree->pDbgMod);635 kDbgModuleClose(pFree->pDbgMod); 617 636 free(pFree); 618 637 } 619 638 620 RTAvlU32Destroy(&pReport->pModSegTree, KPRF_NAME(DeleteModSeg), NULL);639 KPRF_NAME(ReportTreeDestroy)(&pReport->pModSegTree, KPRF_NAME(DeleteModSeg), NULL); 621 640 622 641 /* 623 642 * The function debug info. 624 643 */ 625 uint32_ti = pReport->pHdr->cFunctions;644 KU32 i = pReport->pHdr->cFunctions; 626 645 while (i-- > 0) 627 646 { 628 RTDbgSymbolFree(pReport->paFunctions[i].pSym);629 RTDbgLineFree(pReport->paFunctions[i].pLine);647 kDbgSymbolFree(pReport->paFunctions[i].pSym); 648 kDbgLineFree(pReport->paFunctions[i].pLine); 630 649 } 631 650 … … 645 664 * @param pReport The report to work on. 646 665 */ 647 static int KPRF_NAME(Analy seModSegs)(KPRF_TYPE(P,REPORT) pReport)648 { 649 const uint32_toffEnd = pReport->pHdr->offModSegs + pReport->pHdr->cbModSegs;650 uint32_toff = pReport->pHdr->offModSegs;666 static int KPRF_NAME(AnalyzeModSegs)(KPRF_TYPE(P,REPORT) pReport) 667 { 668 const KU32 offEnd = pReport->pHdr->offModSegs + pReport->pHdr->cbModSegs; 669 KU32 off = pReport->pHdr->offModSegs; 651 670 while (off < offEnd) 652 671 { 653 672 KPRF_TYPE(PC,MODSEG) pCur = KPRF_OFF2PTR(PC,MODSEG, off, pReport->pHdr); 654 uint32_tcbCur = KPRF_OFFSETOF(MODSEG, szPath[pCur->cchPath + 1]);673 KU32 cbCur = KPRF_OFFSETOF(MODSEG, szPath[pCur->cchPath + 1]); 655 674 cbCur = KPRF_ALIGN(cbCur, KPRF_SIZEOF(UPTR)); 656 675 … … 662 681 return -1; 663 682 664 pSeg-> Core.Key= off;683 pSeg->offSegment = off; 665 684 pSeg->pModSeg = pCur; 666 685 pSeg->pMod = NULL; /* below */ … … 669 688 pSeg->cFunctions = 0; 670 689 671 if (! RTAvlU32Insert(&pReport->pModSegTree, &pSeg->Core))690 if (!KPRF_NAME(ReportTreeInsert)(&pReport->pModSegTree, pSeg)) 672 691 { 673 692 free(pSeg); … … 707 726 pMod->cFunctions = 0; 708 727 709 int rc = RTDbgModuleOpen(pSeg->pModSeg->szPath, &pMod->pDbgMod);710 if ( RT_FAILURE(rc))728 int rc = kDbgModuleOpen(&pMod->pDbgMod, pSeg->pModSeg->szPath, NULL /* kLdrMod */); 729 if (rc) 711 730 pMod->pDbgMod = NULL; 712 731 } … … 729 748 static int KPRF_NAME(AnalyseFunctions)(KPRF_TYPE(P,REPORT) pReport) 730 749 { 731 uint32_tiFunc = pReport->pHdr->cFunctions;750 KU32 iFunc = pReport->pHdr->cFunctions; 732 751 KPRF_TYPE(PC,FUNC) pFunc = KPRF_OFF2PTR(PC,FUNC, pReport->pHdr->offFunctions + iFunc * sizeof(*pFunc), pReport->pHdr); 733 752 KPRF_TYPE(P,REPORTFUNC) pReportFunc = &pReport->paFunctions[iFunc]; … … 739 758 pReport->papSortedFunctions[iFunc] = pReportFunc; 740 759 pReportFunc->pFunc = pFunc; 741 pReportFunc->pModSeg = (KPRF_TYPE(P,REPORTMODSEG))RTAvlU32Get(&pReport->pModSegTree, pFunc->offModSeg);760 pReportFunc->pModSeg = KPRF_NAME(ReportTreeGet)(&pReport->pModSegTree, pFunc->offModSeg); 742 761 pReportFunc->pSym = NULL; 743 762 pReportFunc->pLine = NULL; … … 756 775 757 776 /* Get debug info. */ 758 RTUINTPTR offSegment = (RTUINTPTR)(pFunc->uEntryPtr - pModSeg->pModSeg->uBasePtr);759 int rc = RTDbgModuleQuerySymbolA(pMod->pDbgMod, pModSeg->pModSeg->iSegment, offSegment, &pReportFunc->pSym);777 KDBGADDR offSegment = pFunc->uEntryPtr - pModSeg->pModSeg->uBasePtr; 778 int rc = kDbgModuleQuerySymbolA(pMod->pDbgMod, pModSeg->pModSeg->iSegment, offSegment, &pReportFunc->pSym); 760 779 /** @todo check displacement! */ 761 if ( RT_FAILURE(rc))780 if (rc) 762 781 pReportFunc->pSym = NULL; 763 rc = RTDbgModuleQueryLineA(pMod->pDbgMod, pModSeg->pModSeg->iSegment, offSegment, &pReportFunc->pLine);764 if ( RT_FAILURE(rc))782 rc = kDbgModuleQueryLineA(pMod->pDbgMod, pModSeg->pModSeg->iSegment, offSegment, &pReportFunc->pLine); 783 if (rc) 765 784 pReportFunc->pLine = NULL; 766 785 } … … 779 798 static int KPRF_NAME(AnalyseThreads)(KPRF_TYPE(P,REPORT) pReport) 780 799 { 781 uint32_tiThread = pReport->pHdr->cThreads;800 KU32 iThread = pReport->pHdr->cThreads; 782 801 KPRF_TYPE(PC,THREAD) pThread = KPRF_OFF2PTR(PC,THREAD, pReport->pHdr->offThreads + iThread * sizeof(*pThread), pReport->pHdr); 783 802 KPRF_TYPE(P,REPORTTHREAD) pReportThread = &pReport->paThreads[iThread]; … … 820 839 821 840 /* read module segments */ 822 int rc = KPRF_NAME(Analy seModSegs)(pReport);841 int rc = KPRF_NAME(AnalyzeModSegs)(pReport); 823 842 if (!rc) 824 843 { … … 846 865 * @internal 847 866 */ 848 static void KPRF_NAME(HtmlWriteRowU32X32)(FILE *pOut, const char *pszName, uint32_tu32, const char *pszUnit)867 static void KPRF_NAME(HtmlWriteRowU32X32)(FILE *pOut, const char *pszName, KU32 u32, const char *pszUnit) 849 868 { 850 869 fprintf(pOut, … … 862 881 * @internal 863 882 */ 864 static void KPRF_NAME(HtmlWriteRowU32)(FILE *pOut, const char *pszName, uint32_tu32, const char *pszUnit)883 static void KPRF_NAME(HtmlWriteRowU32)(FILE *pOut, const char *pszName, KU32 u32, const char *pszUnit) 865 884 { 866 885 fprintf(pOut, … … 878 897 * @internal 879 898 */ 880 static void KPRF_NAME(HtmlWriteRowU64)(FILE *pOut, const char *pszName, uint64_tu64, const char *pszUnit)899 static void KPRF_NAME(HtmlWriteRowU64)(FILE *pOut, const char *pszName, KU64 u64, const char *pszUnit) 881 900 { 882 901 fprintf(pOut, … … 894 913 * @internal 895 914 */ 896 static void KPRF_NAME(HtmlWriteRowX64)(FILE *pOut, const char *pszName, uint64_tu64, const char *pszUnit)915 static void KPRF_NAME(HtmlWriteRowX64)(FILE *pOut, const char *pszName, KU64 u64, const char *pszUnit) 897 916 { 898 917 fprintf(pOut, … … 909 928 * Writes a ticks. 910 929 */ 911 static void KPRF_NAME(HtmlWriteParts)(FILE *pOut, uint64_t cTicks, uint64_tcTotalTicks)930 static void KPRF_NAME(HtmlWriteParts)(FILE *pOut, KU64 cTicks, KU64 cTotalTicks) 912 931 { 913 932 /** U+2030 PER MILLE SIGN */ 914 static const uint8_ts_szPerMilleSignUtf8[4] = { 0xe2, 0x80, 0xb0, 0};933 static const KU8 s_szPerMilleSignUtf8[4] = { 0xe2, 0x80, 0xb0, 0}; 915 934 916 935 if (cTicks * 100 / cTotalTicks) 917 936 { 918 uint32_t u = (uint32_t)((cTicks * 1000) / cTotalTicks);937 KU32 u = (KU32)((cTicks * 1000) / cTotalTicks); 919 938 fprintf(pOut, "%u.%01u%%", u / 10, u %10); 920 939 } 921 940 else //if (cTicks * 100000 / cTotalTicks) 922 941 { 923 uint32_t u = (uint32_t)((cTicks * 100000) / cTotalTicks);942 KU32 u = (KU32)((cTicks * 100000) / cTotalTicks); 924 943 fprintf(pOut, "%u.%02u%s", u / 100, u % 100, s_szPerMilleSignUtf8); 925 944 } … … 936 955 * Writes a ticks. 937 956 */ 938 static void KPRF_NAME(HtmlWriteTicks)(FILE *pOut, uint64_t cTicks, uint64_tcTotalTicks)957 static void KPRF_NAME(HtmlWriteTicks)(FILE *pOut, KU64 cTicks, KU64 cTotalTicks) 939 958 { 940 959 fprintf(pOut, "%" KPRF_FMT_U64 "", cTicks); … … 956 975 * @internal 957 976 */ 958 static void KPRF_NAME(HtmlWriteRowTicks)(FILE *pOut, const char *pszName, uint64_t cTicks, uint64_tcTotalTicks)977 static void KPRF_NAME(HtmlWriteRowTicks)(FILE *pOut, const char *pszName, KU64 cTicks, KU64 cTotalTicks) 959 978 { 960 979 fprintf(pOut, … … 980 999 * @internal 981 1000 */ 982 static void KPRF_NAME(HtmlWriteRowTimeStat)(FILE *pOut, const char *pszName, KPRF_TYPE(PC,TIMESTAT) pTimeStat, uint64_tcTotalTicks)1001 static void KPRF_NAME(HtmlWriteRowTimeStat)(FILE *pOut, const char *pszName, KPRF_TYPE(PC,TIMESTAT) pTimeStat, KU64 cTotalTicks) 983 1002 { 984 1003 fprintf(pOut, … … 1008 1027 * @internal 1009 1028 */ 1010 static void KPRF_NAME(HtmlWriteRowCalls)(FILE *pOut, const char *pszName, uint64_t cCalls, uint64_tcTotalCalls)1029 static void KPRF_NAME(HtmlWriteRowCalls)(FILE *pOut, const char *pszName, KU64 cCalls, KU64 cTotalCalls) 1011 1030 { 1012 1031 fprintf(pOut, … … 1123 1142 " </tr>\n"); 1124 1143 1125 for ( uint32_tiFunc = 0; iFunc < pReport->pHdr->cFunctions; iFunc++)1144 for (KU32 iFunc = 0; iFunc < pReport->pHdr->cFunctions; iFunc++) 1126 1145 { 1127 1146 KPRF_TYPE(P,REPORTFUNC) pReportFunc = pReport->papSortedFunctions[iFunc]; … … 1243 1262 "<head>\n" 1244 1263 " <meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\">\n" 1245 " <title>kProfile 2 - %s</title>\n"1264 " <title>kProfiler 2 - %s</title>\n" 1246 1265 "</head>\n" 1247 1266 "<style>\n" … … 1396 1415 KPRF_NAME(HtmlWriteRowCalls)(pOut, "Recorded Calls", pReport->cCalls, pReport->cCalls); 1397 1416 fprintf(pOut, "<tr><td class=\"BlankRow\" colspan=7> </td></tr>\n"); 1398 KPRF_NAME(HtmlWriteRowString)(pOut, "kProfile Version ", NULL, "Mark 2 Alpha 1");1399 KPRF_NAME(HtmlWriteRowString)(pOut, "kProfile Build Time ", NULL, __DATE__ " " __TIME__);1417 KPRF_NAME(HtmlWriteRowString)(pOut, "kProfiler Version ", NULL, "Mark 2 Alpha 1"); 1418 KPRF_NAME(HtmlWriteRowString)(pOut, "kProfiler Build Time ", NULL, __DATE__ " " __TIME__); 1400 1419 fprintf(pOut, 1401 1420 "</table>\n" … … 1440 1459 "<p>\n" 1441 1460 "<table class=\"Functions\">\n"); 1442 for ( uint32_tiFunc = 0; iFunc < pHdr->cFunctions; iFunc++)1461 for (KU32 iFunc = 0; iFunc < pHdr->cFunctions; iFunc++) 1443 1462 { 1444 1463 KPRF_TYPE(P,REPORTFUNC) pReportFunc = &pReport->paFunctions[iFunc]; … … 1486 1505 "<table class=\"Threads\">\n"); 1487 1506 1488 for ( uint32_tiThread = 0; iThread < pHdr->cThreads; iThread++)1507 for (KU32 iThread = 0; iThread < pHdr->cThreads; iThread++) 1489 1508 { 1490 1509 KPRF_TYPE(PC,THREAD) pThread = pReport->paThreads[iThread].pThread; … … 1527 1546 1528 1547 KPRF_TYPE(P,REPORTMOD) pMod = pReport->pFirstMod; 1529 uint32_tiMod = 0;1548 KU32 iMod = 0; 1530 1549 while (pMod) 1531 1550 {
Note:
See TracChangeset
for help on using the changeset viewer.