Ignore:
Timestamp:
Aug 27, 2007, 6:06:17 AM (18 years ago)
Author:
bird
Message:

Use kStuff.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kStuff/kProfile/prfreader.cpp.h

    r3537 r3565  
    11/* $Id: $ */
    22/** @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 kLIBC.
    10  *
    11  * kLIBC is free software; you can redistribute it and/or modify
    12  * it under the terms of the GNU General Public License as published by
    13  * the Free Software Foundation; either version 2 of the License, or
    14  * (at your option) any later version.
    15  *
    16  * kLIBC is 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,
    1717 * but WITHOUT ANY WARRANTY; without even the implied warranty of
    18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    19  * GNU General Public License for more details.
    20  *
    21  * You should have received a copy of the GNU General Public License
    22  * along with kLIBC; if not, write to the Free Software
    23  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
     18 * 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
    2424 *
    2525 */
     
    3636 * @param   pOut        Where to write error messages.
    3737 */
    38 static bool KPRF_NAME(IsValid)(KPRF_TYPE(PC,HDR) pHdr, uint32_t cb, FILE *pOut)
     38static bool KPRF_NAME(IsValid)(KPRF_TYPE(PC,HDR) pHdr, KU32 cb, FILE *pOut)
    3939{
    4040    KPRF_TYPE(,UPTR) uMaxPtr = ~(KPRF_TYPE(,UPTR))0 - pHdr->uBasePtr;
     
    4343     * Iterate the module segments.
    4444     */
    45     uint32_t off = pHdr->offModSegs;
     45    KU32 off = pHdr->offModSegs;
    4646    while (off < pHdr->offModSegs + pHdr->cbModSegs)
    4747    {
    4848        KPRF_TYPE(PC,MODSEG) pCur = KPRF_OFF2PTR(PC,MODSEG, off, pHdr);
    49         uint32_t cbCur = KPRF_OFFSETOF(MODSEG, szPath[pCur->cchPath + 1]);
     49        KU32 cbCur = KPRF_OFFSETOF(MODSEG, szPath[pCur->cchPath + 1]);
    5050        cbCur = KPRF_ALIGN(cbCur, KPRF_SIZEOF(UPTR));
    5151        if (cbCur + off > pHdr->offModSegs + pHdr->cbModSegs)
     
    7373     */
    7474    KPRF_TYPE(PC,FUNC) paFuncs = KPRF_OFF2PTR(PC,FUNC, pHdr->offFunctions, pHdr);
    75     for (uint32_t i = 0; i < pHdr->cFunctions; i++)
     75    for (KU32 i = 0; i < pHdr->cFunctions; i++)
    7676    {
    7777        KPRF_TYPE(PC,FUNC) pCur = &paFuncs[i];
     
    9797     */
    9898    KPRF_TYPE(PC,THREAD) paThreads = KPRF_OFF2PTR(PC,THREAD, pHdr->offThreads, pHdr);
    99     for (uint32_t i = 0; i < pHdr->cThreads; i++)
     99    for (KU32 i = 0; i < pHdr->cThreads; i++)
    100100    {
    101101        KPRF_TYPE(PC,THREAD) pCur = &paThreads[i];
     
    148148            "----------------\n",
    149149            pHdr->offModSegs, pHdr->cbModSegs, pHdr->cbMaxModSegs);
    150     uint32_t off = pHdr->offModSegs;
     150    KU32 off = pHdr->offModSegs;
    151151    while (off < pHdr->offModSegs + pHdr->cbModSegs)
    152152    {
    153153        KPRF_TYPE(PC,MODSEG) pCur = KPRF_OFF2PTR(PC,MODSEG, off, pHdr);
    154         uint32_t cbCur = KPRF_OFFSETOF(MODSEG, szPath[pCur->cchPath + 1]);
     154        KU32 cbCur = KPRF_OFFSETOF(MODSEG, szPath[pCur->cchPath + 1]);
    155155        cbCur = KPRF_ALIGN(cbCur, KPRF_SIZEOF(UPTR));
    156156
     
    172172            pHdr->offFunctions, pHdr->cFunctions, pHdr->cMaxFunctions);
    173173    KPRF_TYPE(PC,FUNC) paFuncs = KPRF_OFF2PTR(PC,FUNC, pHdr->offFunctions, pHdr);
    174     for (uint32_t i = 0; i < pHdr->cFunctions; i++)
     174    for (KU32 i = 0; i < pHdr->cFunctions; i++)
    175175    {
    176176        KPRF_TYPE(PC,FUNC) pCur = &paFuncs[i];
     
    188188
    189189#if 1
    190             PRTDBGMOD 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)
    193193            {
    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)
    197197                {
    198198                    fprintf(pOut, "  %s\n", Sym.szName);
    199199                }
    200                 RTDbgModuleClose(pMod);
     200                kDbgModuleClose(pMod);
    201201            }
    202202#endif
     
    214214            pHdr->offThreads, pHdr->cThreads, pHdr->cMaxThreads, pHdr->cStacks, pHdr->cMaxStacks, pHdr->cMaxStackFrames);
    215215    KPRF_TYPE(PC,THREAD) paThreads = KPRF_OFF2PTR(PC,THREAD, pHdr->offThreads, pHdr);
    216     for (uint32_t i = 0; i < pHdr->cThreads; i++)
     216    for (KU32 i = 0; i < pHdr->cThreads; i++)
    217217    {
    218218        KPRF_TYPE(PC,THREAD) pCur = &paThreads[i];
     
    248248{
    249249    /** 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. */
    251253    /** Pointer to the next segment for the module. */
    252254    KPRF_TYPE(P,REPORTMODSEG)   pNext;
     
    256258    KPRF_TYPE(P,REPORTMOD)      pMod;
    257259    /** The time this segment has spent on the stack.. */
    258     uint64_t                    OnStackTicks;
     260    KU64                        OnStackTicks;
    259261    /** The time this segment has spent on the top of the stack.. */
    260     uint64_t                    OnTopOfStackTicks;
     262    KU64                        OnTopOfStackTicks;
    261263    /** The number of profiled functions from this segment. */
    262     uint32_t                    cFunctions;
     264    KU32                        cFunctions;
     265    KU8                         mHeight;        /**< AVL Subtree height. */
    263266} KPRF_TYPE(,REPORTMODSEG), *KPRF_TYPE(P,REPORTMODSEG);
    264267
     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
    265284
    266285/**
     
    272291{
    273292    /** The module number. */
    274     uint32_t                    iMod;
     293    KU32                        iMod;
    275294    /** Pointer to the next module in the list. */
    276295    KPRF_TYPE(P,REPORTMOD)      pNext;
     
    278297    KPRF_TYPE(P,REPORTMODSEG)   pFirstSeg;
    279298    /** The debug module handle. */
    280     PRTDBGMOD                   pDbgMod;
     299    PKDBGMOD                    pDbgMod;
    281300    /** The time this segment has spent on the stack.. */
    282     uint64_t                    OnStackTicks;
     301    KU64                        OnStackTicks;
    283302    /** The time this segment has spent on the top of the stack.. */
    284     uint64_t                    OnTopOfStackTicks;
     303    KU64                        OnTopOfStackTicks;
    285304    /** The number of profiled functions from this segment. */
    286     uint32_t                    cFunctions;
     305    KU32                        cFunctions;
    287306} KPRF_TYPE(,REPORTMOD), *KPRF_TYPE(P,REPORTMOD);
    288307
     
    300319    KPRF_TYPE(P,REPORTMODSEG)   pModSeg;
    301320    /** Pointer to the function symbol. */
    302     PRTDBGSYMBOL                pSym;
     321    PKDBGSYMBOL                 pSym;
    303322    /** Pointer to the function line number. */
    304     PKDBGLINE                  pLine;
     323    PKDBGLINE                   pLine;
    305324} KPRF_TYPE(,REPORTFUNC), *KPRF_TYPE(P,REPORTFUNC);
    306325
     
    499518{
    500519    /** Pointer to the data set. */
    501     KPRF_TYPE(PC,HDR)   pHdr;
     520    KPRF_TYPE(PC,HDR)           pHdr;
    502521
    503522    /** @name Data-set item wrappers.
     
    510529    KPRF_TYPE(P,REPORTMOD)      pFirstMod;
    511530    /** The number of modules in the list. */
    512     uint32_t                    cMods;
     531    KU32                        cMods;
    513532    /** The module segment tree. */
    514     PAVLU32NODECORE             pModSegTree;
     533    KPRF_TYPE(P,REPORTMODSEG)   pModSegTree;
    515534    /** The number of module segments in the tree. */
    516     uint32_t                    cModSegs;
     535    KU32                        cModSegs;
    517536    /** @} */
    518537
     
    528547     * @{ */
    529548    /** Sum of the profiled ticks. */
    530     uint64_t                    ProfiledTicks;
     549    KU64                        ProfiledTicks;
    531550    /** Sum of the overhead ticks. */
    532     uint64_t                    OverheadTicks;
     551    KU64                        OverheadTicks;
    533552    /** Sum of the sleep ticks. */
    534     uint64_t                    SleepTicks;
     553    KU64                        SleepTicks;
    535554    /** Sum of calls performed. */
    536     uint64_t                    cCalls;
     555    KU64                        cCalls;
    537556    /** @} */
    538557
     
    552571     * Everything but the mods and modsegs is allocated in the same block as the report.
    553572     */
    554     size_t cb = KPRF_ALIGN(KPRF_SIZEOF(REPORT), 32);
    555     uintptr_t offThreads = cb;
     573    KSIZE cb = KPRF_ALIGN(KPRF_SIZEOF(REPORT), 32);
     574    KUPTR offThreads = cb;
    556575    cb += KPRF_ALIGN(KPRF_SIZEOF(REPORTTHREAD) * pHdr->cThreads, 32);
    557     uintptr_t offFunctions = cb;
     576    KUPTR offFunctions = cb;
    558577    cb += KPRF_ALIGN(KPRF_SIZEOF(REPORTFUNC) * pHdr->cFunctions, 32);
    559     uintptr_t offSortedThreads = cb;
     578    KUPTR offSortedThreads = cb;
    560579    cb += KPRF_ALIGN(sizeof(KPRF_TYPE(P,REPORTTHREAD)) * pHdr->cThreads, 32);
    561     uintptr_t offSortedFunctions = cb;
     580    KUPTR offSortedFunctions = cb;
    562581    cb += KPRF_ALIGN(sizeof(KPRF_TYPE(P,REPORTFUNC)) * pHdr->cFunctions, 32);
    563582    KPRF_TYPE(P,REPORT) pReport = (KPRF_TYPE(P,REPORT))malloc(cb);
     
    569588     */
    570589    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);
    573592    pReport->pFirstMod = NULL;
    574593    pReport->cMods = 0;
    575594    pReport->pModSegTree = NULL;
    576595    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);
    579598    pReport->ProfiledTicks = 0;
    580599    pReport->OverheadTicks = 0;
     
    593612 * @param   pvParam     User parameter, ignored.
    594613 */
    595 static DECLCALLBACK(int) KPRF_NAME(DeleteModSeg)(PAVLU32NODECORE pCore, void *pvParam)
     614static int KPRF_NAME(DeleteModSeg)(KPRF_TYPE(P,REPORTMODSEG) pCore, void *pvParam)
    596615{
    597616    free(pCore);
     
    614633        KPRF_TYPE(P,REPORTMOD) pFree = pReport->pFirstMod;
    615634        pReport->pFirstMod = pFree->pNext;
    616         RTDbgModuleClose(pFree->pDbgMod);
     635        kDbgModuleClose(pFree->pDbgMod);
    617636        free(pFree);
    618637    }
    619638
    620     RTAvlU32Destroy(&pReport->pModSegTree, KPRF_NAME(DeleteModSeg), NULL);
     639    KPRF_NAME(ReportTreeDestroy)(&pReport->pModSegTree, KPRF_NAME(DeleteModSeg), NULL);
    621640
    622641    /*
    623642     * The function debug info.
    624643     */
    625     uint32_t i = pReport->pHdr->cFunctions;
     644    KU32 i = pReport->pHdr->cFunctions;
    626645    while (i-- > 0)
    627646    {
    628         RTDbgSymbolFree(pReport->paFunctions[i].pSym);
    629         RTDbgLineFree(pReport->paFunctions[i].pLine);
     647        kDbgSymbolFree(pReport->paFunctions[i].pSym);
     648        kDbgLineFree(pReport->paFunctions[i].pLine);
    630649    }
    631650
     
    645664 * @param   pReport     The report to work on.
    646665 */
    647 static int KPRF_NAME(AnalyseModSegs)(KPRF_TYPE(P,REPORT) pReport)
    648 {
    649     const uint32_t offEnd = pReport->pHdr->offModSegs + pReport->pHdr->cbModSegs;
    650     uint32_t off = pReport->pHdr->offModSegs;
     666static 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;
    651670    while (off < offEnd)
    652671    {
    653672        KPRF_TYPE(PC,MODSEG) pCur = KPRF_OFF2PTR(PC,MODSEG, off, pReport->pHdr);
    654         uint32_t cbCur = KPRF_OFFSETOF(MODSEG, szPath[pCur->cchPath + 1]);
     673        KU32 cbCur = KPRF_OFFSETOF(MODSEG, szPath[pCur->cchPath + 1]);
    655674        cbCur = KPRF_ALIGN(cbCur, KPRF_SIZEOF(UPTR));
    656675
     
    662681            return -1;
    663682
    664         pSeg->Core.Key = off;
     683        pSeg->offSegment = off;
    665684        pSeg->pModSeg = pCur;
    666685        pSeg->pMod = NULL; /* below */
     
    669688        pSeg->cFunctions = 0;
    670689
    671         if (!RTAvlU32Insert(&pReport->pModSegTree, &pSeg->Core))
     690        if (!KPRF_NAME(ReportTreeInsert)(&pReport->pModSegTree, pSeg))
    672691        {
    673692            free(pSeg);
     
    707726            pMod->cFunctions = 0;
    708727
    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)
    711730                pMod->pDbgMod = NULL;
    712731        }
     
    729748static int KPRF_NAME(AnalyseFunctions)(KPRF_TYPE(P,REPORT) pReport)
    730749{
    731     uint32_t iFunc = pReport->pHdr->cFunctions;
     750    KU32 iFunc = pReport->pHdr->cFunctions;
    732751    KPRF_TYPE(PC,FUNC) pFunc = KPRF_OFF2PTR(PC,FUNC, pReport->pHdr->offFunctions + iFunc * sizeof(*pFunc), pReport->pHdr);
    733752    KPRF_TYPE(P,REPORTFUNC) pReportFunc = &pReport->paFunctions[iFunc];
     
    739758        pReport->papSortedFunctions[iFunc] = pReportFunc;
    740759        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);
    742761        pReportFunc->pSym = NULL;
    743762        pReportFunc->pLine = NULL;
     
    756775
    757776            /* 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);
    760779            /** @todo check displacement! */
    761             if (RT_FAILURE(rc))
     780            if (rc)
    762781                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)
    765784                pReportFunc->pLine = NULL;
    766785        }
     
    779798static int KPRF_NAME(AnalyseThreads)(KPRF_TYPE(P,REPORT) pReport)
    780799{
    781     uint32_t iThread = pReport->pHdr->cThreads;
     800    KU32 iThread = pReport->pHdr->cThreads;
    782801    KPRF_TYPE(PC,THREAD) pThread = KPRF_OFF2PTR(PC,THREAD, pReport->pHdr->offThreads + iThread * sizeof(*pThread), pReport->pHdr);
    783802    KPRF_TYPE(P,REPORTTHREAD) pReportThread = &pReport->paThreads[iThread];
     
    820839
    821840    /* read module segments */
    822     int rc = KPRF_NAME(AnalyseModSegs)(pReport);
     841    int rc = KPRF_NAME(AnalyzeModSegs)(pReport);
    823842    if (!rc)
    824843    {
     
    846865 * @internal
    847866 */
    848 static void KPRF_NAME(HtmlWriteRowU32X32)(FILE *pOut, const char *pszName, uint32_t u32, const char *pszUnit)
     867static void KPRF_NAME(HtmlWriteRowU32X32)(FILE *pOut, const char *pszName, KU32 u32, const char *pszUnit)
    849868{
    850869    fprintf(pOut,
     
    862881 * @internal
    863882 */
    864 static void KPRF_NAME(HtmlWriteRowU32)(FILE *pOut, const char *pszName, uint32_t u32, const char *pszUnit)
     883static void KPRF_NAME(HtmlWriteRowU32)(FILE *pOut, const char *pszName, KU32 u32, const char *pszUnit)
    865884{
    866885    fprintf(pOut,
     
    878897 * @internal
    879898 */
    880 static void KPRF_NAME(HtmlWriteRowU64)(FILE *pOut, const char *pszName, uint64_t u64, const char *pszUnit)
     899static void KPRF_NAME(HtmlWriteRowU64)(FILE *pOut, const char *pszName, KU64 u64, const char *pszUnit)
    881900{
    882901    fprintf(pOut,
     
    894913 * @internal
    895914 */
    896 static void KPRF_NAME(HtmlWriteRowX64)(FILE *pOut, const char *pszName, uint64_t u64, const char *pszUnit)
     915static void KPRF_NAME(HtmlWriteRowX64)(FILE *pOut, const char *pszName, KU64 u64, const char *pszUnit)
    897916{
    898917    fprintf(pOut,
     
    909928 * Writes a ticks.
    910929 */
    911 static void KPRF_NAME(HtmlWriteParts)(FILE *pOut, uint64_t cTicks, uint64_t cTotalTicks)
     930static void KPRF_NAME(HtmlWriteParts)(FILE *pOut, KU64 cTicks, KU64 cTotalTicks)
    912931{
    913932    /** U+2030 PER MILLE SIGN */
    914     static const uint8_t s_szPerMilleSignUtf8[4] = { 0xe2, 0x80, 0xb0, 0};
     933    static const KU8 s_szPerMilleSignUtf8[4] = { 0xe2, 0x80, 0xb0, 0};
    915934
    916935    if (cTicks * 100 / cTotalTicks)
    917936    {
    918         uint32_t u = (uint32_t)((cTicks * 1000) / cTotalTicks);
     937        KU32 u = (KU32)((cTicks * 1000) / cTotalTicks);
    919938        fprintf(pOut, "%u.%01u%%", u / 10, u %10);
    920939    }
    921940    else //if (cTicks * 100000 / cTotalTicks)
    922941    {
    923         uint32_t u = (uint32_t)((cTicks * 100000) / cTotalTicks);
     942        KU32 u = (KU32)((cTicks * 100000) / cTotalTicks);
    924943        fprintf(pOut, "%u.%02u%s", u / 100, u % 100, s_szPerMilleSignUtf8);
    925944    }
     
    936955 * Writes a ticks.
    937956 */
    938 static void KPRF_NAME(HtmlWriteTicks)(FILE *pOut, uint64_t cTicks, uint64_t cTotalTicks)
     957static void KPRF_NAME(HtmlWriteTicks)(FILE *pOut, KU64 cTicks, KU64 cTotalTicks)
    939958{
    940959    fprintf(pOut, "%" KPRF_FMT_U64 "", cTicks);
     
    956975 * @internal
    957976 */
    958 static void KPRF_NAME(HtmlWriteRowTicks)(FILE *pOut, const char *pszName, uint64_t cTicks, uint64_t cTotalTicks)
     977static void KPRF_NAME(HtmlWriteRowTicks)(FILE *pOut, const char *pszName, KU64 cTicks, KU64 cTotalTicks)
    959978{
    960979    fprintf(pOut,
     
    980999 * @internal
    9811000 */
    982 static void KPRF_NAME(HtmlWriteRowTimeStat)(FILE *pOut, const char *pszName, KPRF_TYPE(PC,TIMESTAT) pTimeStat, uint64_t cTotalTicks)
     1001static void KPRF_NAME(HtmlWriteRowTimeStat)(FILE *pOut, const char *pszName, KPRF_TYPE(PC,TIMESTAT) pTimeStat, KU64 cTotalTicks)
    9831002{
    9841003    fprintf(pOut,
     
    10081027 * @internal
    10091028 */
    1010 static void KPRF_NAME(HtmlWriteRowCalls)(FILE *pOut, const char *pszName, uint64_t cCalls, uint64_t cTotalCalls)
     1029static void KPRF_NAME(HtmlWriteRowCalls)(FILE *pOut, const char *pszName, KU64 cCalls, KU64 cTotalCalls)
    10111030{
    10121031    fprintf(pOut,
     
    11231142            "  </tr>\n");
    11241143
    1125     for (uint32_t iFunc = 0; iFunc < pReport->pHdr->cFunctions; iFunc++)
     1144    for (KU32 iFunc = 0; iFunc < pReport->pHdr->cFunctions; iFunc++)
    11261145    {
    11271146        KPRF_TYPE(P,REPORTFUNC) pReportFunc = pReport->papSortedFunctions[iFunc];
     
    12431262            "<head>\n"
    12441263            "  <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"
    12461265            "</head>\n"
    12471266            "<style>\n"
     
    13961415    KPRF_NAME(HtmlWriteRowCalls)(pOut, "Recorded Calls", pReport->cCalls, pReport->cCalls);
    13971416    fprintf(pOut, "<tr><td class=\"BlankRow\" colspan=7>&nbsp;</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__);
    14001419    fprintf(pOut,
    14011420            "</table>\n"
     
    14401459            "<p>\n"
    14411460            "<table class=\"Functions\">\n");
    1442     for (uint32_t iFunc = 0; iFunc < pHdr->cFunctions; iFunc++)
     1461    for (KU32 iFunc = 0; iFunc < pHdr->cFunctions; iFunc++)
    14431462    {
    14441463        KPRF_TYPE(P,REPORTFUNC) pReportFunc = &pReport->paFunctions[iFunc];
     
    14861505            "<table class=\"Threads\">\n");
    14871506
    1488     for (uint32_t iThread = 0; iThread < pHdr->cThreads; iThread++)
     1507    for (KU32 iThread = 0; iThread < pHdr->cThreads; iThread++)
    14891508    {
    14901509        KPRF_TYPE(PC,THREAD) pThread = pReport->paThreads[iThread].pThread;
     
    15271546
    15281547    KPRF_TYPE(P,REPORTMOD) pMod = pReport->pFirstMod;
    1529     uint32_t iMod = 0;
     1548    KU32 iMod = 0;
    15301549    while (pMod)
    15311550    {
Note: See TracChangeset for help on using the changeset viewer.