Ignore:
Timestamp:
Nov 1, 2016, 7:27:39 PM (9 years ago)
Author:
bird
Message:

kWorker: More stats and cache stats for a few more file types.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kWorker/kWorker.c

    r2968 r2987  
    986986/** Number of non-native modules. */
    987987static KU32     g_cNonNativeModules;
    988 
     988/** Number of read-cached files. */
     989static KU32     g_cReadCachedFiles;
     990/** Total size of read-cached files. */
     991static KSIZE    g_cbReadCachedFiles;
     992
     993/** Total number of ReadFile calls. */
     994static KSIZE    g_cReadFileCalls;
     995/** Total bytes read via ReadFile. */
     996static KSIZE    g_cbReadFileTotal;
     997/** Total number of read from read-cached files. */
     998static KSIZE    g_cReadFileFromReadCached;
     999/** Total bytes read from read-cached files. */
     1000static KSIZE    g_cbReadFileFromReadCached;
     1001/** Total number of read from in-memory temporary files. */
     1002static KSIZE    g_cReadFileFromInMemTemp;
     1003/** Total bytes read from in-memory temporary files. */
     1004static KSIZE    g_cbReadFileFromInMemTemp;
     1005
     1006/** Total number of WriteFile calls. */
     1007static KSIZE    g_cWriteFileCalls;
     1008/** Total bytes written via WriteFile. */
     1009static KSIZE    g_cbWriteFileTotal;
     1010/** Total number of written to from in-memory temporary files. */
     1011static KSIZE    g_cWriteFileToInMemTemp;
     1012/** Total bytes written to in-memory temporary files. */
     1013static KSIZE    g_cbWriteFileToInMemTemp;
    9891014
    9901015
     
    51345159    }
    51355160#endif
     5161#if 0 /* Experimental - need to flush these afterwards as they're highly unlikely to be used after the link is done.  */
     5162    /* Linker - Object file: .obj */
     5163    if ((wcFirst == 'o' || wcFirst == 'O') && g_Sandbox.pTool->u.Sandboxed.enmHint == KWTOOLHINT_VISUAL_CPP_LINK)
     5164    {
     5165        if (wcSecond == 'b' || wcSecond == 'B')
     5166        {
     5167            if (wcThird == 'j' || wcThird == 'J')
     5168                return K_TRUE;
     5169        }
     5170    }
     5171#endif
    51365172    else if (fAttrQuery)
    51375173    {
     
    51505186            if (wcSecond == 'x' || wcSecond == 'X')
    51515187            {
    5152                 if (wcThird == 'e' || wcThird == 'e')
     5188                if (wcThird == 'e' || wcThird == 'E')
    51535189                    return K_TRUE;
     5190            }
     5191        }
     5192        /* Response file: .rsp */
     5193        else if (wcFirst == 'r' || wcFirst == 'R')
     5194        {
     5195            if (wcSecond == 's' || wcSecond == 'S')
     5196            {
     5197                if (wcThird == 'p' || wcThird == 'P')
     5198                    return !g_Sandbox.fNoPchCaching;
     5199            }
     5200        }
     5201        /* Linker: */
     5202        if (g_Sandbox.pTool->u.Sandboxed.enmHint == KWTOOLHINT_VISUAL_CPP_LINK)
     5203        {
     5204            /* Object file: .obj */
     5205            if (wcFirst == 'o' || wcFirst == 'O')
     5206            {
     5207                if (wcSecond == 'b' || wcSecond == 'B')
     5208                {
     5209                    if (wcThird == 'j' || wcThird == 'J')
     5210                        return K_TRUE;
     5211                }
     5212            }
     5213            /* Library file: .lib */
     5214            else if (wcFirst == 'l' || wcFirst == 'L')
     5215            {
     5216                if (wcSecond == 'i' || wcSecond == 'I')
     5217                {
     5218                    if (wcThird == 'b' || wcThird == 'B')
     5219                        return K_TRUE;
     5220                }
     5221            }
     5222            /* Linker definition file: .def */
     5223            else if (wcFirst == 'd' || wcFirst == 'D')
     5224            {
     5225                if (wcSecond == 'e' || wcSecond == 'E')
     5226                {
     5227                    if (wcThird == 'f' || wcThird == 'F')
     5228                        return K_TRUE;
     5229                }
    51545230            }
    51555231        }
     
    52985374                            kFsCacheObjGetFullPathA(pFsObj, pCachedFile->szPath, cbPath, '/');
    52995375                            kFsCacheObjRetain(pFsObj);
     5376
     5377                            g_cReadCachedFiles++;
     5378                            g_cbReadCachedFiles += cbCache;
     5379
    53005380                            KWFS_LOG(("Cached '%s': %p LB %#x, hCached=%p\n", pCachedFile->szPath, pbCache, cbCache, hFile));
    53015381                            return pCachedFile;
     
    57465826                                               LPOVERLAPPED pOverlapped)
    57475827{
     5828    BOOL        fRet;
    57485829    KUPTR const idxHandle = KW_HANDLE_TO_INDEX(hFile);
     5830    g_cReadFileCalls++;
    57495831    kHlpAssert(GetCurrentThreadId() == g_Sandbox.idMainThread);
    57505832    if (idxHandle < g_Sandbox.cHandles)
     
    57775859                    kHlpAssert(!pOverlapped); kHlpAssert(pcbActuallyRead);
    57785860                    *pcbActuallyRead = cbActually;
     5861
     5862                    g_cbReadFileFromReadCached += cbActually;
     5863                    g_cbReadFileTotal          += cbActually;
     5864                    g_cReadFileFromReadCached++;
    57795865
    57805866                    KWFS_LOG(("ReadFile(%p,,%#x) -> TRUE, %#x bytes [cached]\n", hFile, cbToRead, cbActually));
     
    58365922                    *pcbActuallyRead = cbActually;
    58375923
     5924                    g_cbReadFileTotal         += cbActually;
     5925                    g_cbReadFileFromInMemTemp += cbActually;
     5926                    g_cReadFileFromInMemTemp++;
     5927
    58385928                    KWFS_LOG(("ReadFile(%p,,%#x) -> TRUE, %#x bytes [temp]\n", hFile, cbToRead, (KU32)cbActually));
    58395929                    return TRUE;
     
    58525942    }
    58535943
    5854     KWFS_LOG(("ReadFile(%p,%p,%#x,,)\n", hFile, pvBuffer, cbToRead));
    5855     return ReadFile(hFile, pvBuffer, cbToRead, pcbActuallyRead, pOverlapped);
     5944    fRet = ReadFile(hFile, pvBuffer, cbToRead, pcbActuallyRead, pOverlapped);
     5945    if (fRet && pcbActuallyRead)
     5946        g_cbReadFileTotal += *pcbActuallyRead;
     5947    KWFS_LOG(("ReadFile(%p,%p,%#x,,) -> %d, %#x\n", hFile, pvBuffer, cbToRead, fRet, pcbActuallyRead ? *pcbActuallyRead : 0));
     5948    return fRet;
    58565949}
    58575950
     
    60716164                                                LPOVERLAPPED pOverlapped)
    60726165{
     6166    BOOL        fRet;
    60736167    KUPTR const idxHandle = KW_HANDLE_TO_INDEX(hFile);
     6168    g_cWriteFileCalls++;
    60746169    kHlpAssert(GetCurrentThreadId() == g_Sandbox.idMainThread || g_fCtrlC);
    60756170    if (idxHandle < g_Sandbox.cHandles)
     
    61266221
    61276222                        *pcbActuallyWritten = cbToWrite;
     6223
     6224                        g_cbWriteFileTotal += cbToWrite;
     6225                        g_cbWriteFileToInMemTemp += cbToWrite;
     6226                        g_cWriteFileToInMemTemp++;
     6227
    61286228                        KWFS_LOG(("WriteFile(%p,,%#x) -> TRUE [temp]\n", hFile, cbToWrite));
    61296229                        return TRUE;
     
    61676267                    if (pcbActuallyWritten)
    61686268                        *pcbActuallyWritten = cbToWrite;
     6269                    g_cbWriteFileTotal += cbToWrite;
    61696270                    return TRUE;
    61706271                }
     
    61816282    }
    61826283
    6183     KWFS_LOG(("WriteFile(%p,,%#x)\n", hFile, cbToWrite));
    6184     return WriteFile(hFile, pvBuffer, cbToWrite, pcbActuallyWritten, pOverlapped);
     6284    fRet = WriteFile(hFile, pvBuffer, cbToWrite, pcbActuallyWritten, pOverlapped);
     6285    if (fRet && pcbActuallyWritten)
     6286        g_cbWriteFileTotal += *pcbActuallyWritten;
     6287    KWFS_LOG(("WriteFile(%p,,%#x) -> %d, %#x\n", hFile, cbToWrite, fRet, pcbActuallyWritten ? *pcbActuallyWritten : 0));
     6288    return fRet;
    61856289}
    61866290
     
    1005410158
    1005510159/**
     10160 * Decimal formatting of a 64-bit unsigned value into a large enough buffer.
     10161 *
     10162 * @returns pszBuf
     10163 * @param   pszBuf              The buffer (sufficiently large).
     10164 * @param   uValue              The value.
     10165 */
     10166static const char *kwFmtU64(char *pszBuf, KU64 uValue)
     10167{
     10168    char  szTmp[64];
     10169    char *psz = &szTmp[63];
     10170    int   cch = 4;
     10171
     10172    *psz-- = '\0';
     10173    do
     10174    {
     10175        if (--cch == 0)
     10176        {
     10177            *psz-- = ' ';
     10178            cch = 3;
     10179        }
     10180        *psz-- = (uValue % 10) + '0';
     10181        uValue /= 10;
     10182    } while (uValue != 0);
     10183
     10184    return strcpy(pszBuf, psz + 1);
     10185}
     10186
     10187
     10188/**
    1005610189 * Prints statistics.
    1005710190 */
     
    1006610199    int   off = 0;
    1006710200    char  szPrf[24];
     10201    char  sz1[64];
     10202    char  sz2[64];
     10203    char  sz3[64];
     10204    char  sz4[64];
    1006810205    extern size_t maybe_con_fwrite(void const *pvBuf, size_t cbUnit, size_t cUnits, FILE *pFile);
    1006910206
     
    1007210209    szBuf[off++] = '\n';
    1007310210
    10074     off += sprintf(&szBuf[off], "%s %10" KU32_PRI " jobs,  %" KU32_PRI" tools,  %" KU32_PRI " modules,  %" KU32_PRI" non-native ones\n",
    10075                    szPrf, g_cJobs, g_cTools, g_cModules, g_cNonNativeModules);
    10076 
    10077     off += sprintf(&szBuf[off], "%s %10" KSIZE_PRI_U " bytes for the cache\n",
    10078                    szPrf, g_pFsCache->cbObjects + g_pFsCache->cbAnsiPaths + g_pFsCache->cbUtf16Paths + sizeof(*g_pFsCache));
    10079     off += sprintf(&szBuf[off], "%s %10" KSIZE_PRI_U " objects, taking up %" KSIZE_PRI_U " bytes, avg %" KSIZE_PRI_U " bytes\n",
    10080                    szPrf, g_pFsCache->cObjects, g_pFsCache->cbObjects,
    10081                    g_pFsCache->cbObjects / g_pFsCache->cObjects);
    10082     off += sprintf(&szBuf[off], "%s %10" KSIZE_PRI_U " A path hashes, taking up %" KSIZE_PRI_U " bytes, avg %" KSIZE_PRI_U " bytes, %" KSIZE_PRI_U " collision\n",
    10083                    szPrf, g_pFsCache->cAnsiPaths, g_pFsCache->cbAnsiPaths,
    10084                    g_pFsCache->cbAnsiPaths / K_MAX(g_pFsCache->cAnsiPaths, 1), g_pFsCache->cAnsiPathCollisions);
     10211    off += sprintf(&szBuf[off], "%s %14s jobs, %s tools, %s modules, %s non-native ones\n", szPrf,
     10212                   kwFmtU64(sz1, g_cJobs), kwFmtU64(sz2, g_cTools), kwFmtU64(sz3, g_cModules), kwFmtU64(sz4, g_cNonNativeModules));
     10213    off += sprintf(&szBuf[off], "%s %14s bytes in %s read-cached files, avg %s bytes\n", szPrf,
     10214                   kwFmtU64(sz1, g_cbReadCachedFiles), kwFmtU64(sz2, g_cReadCachedFiles),
     10215                   kwFmtU64(sz3, g_cbReadCachedFiles / K_MAX(g_cReadCachedFiles, 1)));
     10216
     10217    off += sprintf(&szBuf[off], "%s %14s bytes read in %s calls\n",
     10218                   szPrf, kwFmtU64(sz1, g_cbReadFileTotal), kwFmtU64(sz2, g_cReadFileCalls));
     10219
     10220    off += sprintf(&szBuf[off], "%s %14s bytes read (%u%%) in %s calls (%u%%) from read cached files\n", szPrf,
     10221                   kwFmtU64(sz1, g_cbReadFileFromReadCached), (unsigned)(g_cbReadFileFromReadCached * (KU64)100 / g_cbReadFileTotal),
     10222                   kwFmtU64(sz2, g_cReadFileFromReadCached), (unsigned)(g_cReadFileFromReadCached * (KU64)100 / g_cReadFileCalls));
     10223
     10224    off += sprintf(&szBuf[off], "%s %14s bytes read (%u%%) in %s calls (%u%%) from in-memory temporary files\n", szPrf,
     10225                   kwFmtU64(sz1, g_cbReadFileFromInMemTemp), (unsigned)(g_cbReadFileFromInMemTemp * (KU64)100 / K_MAX(g_cbReadFileTotal, 1)),
     10226                   kwFmtU64(sz2, g_cReadFileFromInMemTemp), (unsigned)(g_cReadFileFromInMemTemp * (KU64)100 / K_MAX(g_cReadFileCalls, 1)));
     10227
     10228    off += sprintf(&szBuf[off], "%s %14s bytes written in %s calls\n", szPrf,
     10229                   kwFmtU64(sz1, g_cbWriteFileTotal), kwFmtU64(sz2, g_cWriteFileCalls));
     10230    off += sprintf(&szBuf[off], "%s %14s bytes written (%u%%) in %s calls (%u%%) to in-memory temporary files\n", szPrf,
     10231                   kwFmtU64(sz1, g_cbWriteFileToInMemTemp),
     10232                   (unsigned)(g_cbWriteFileToInMemTemp * (KU64)100 / K_MAX(g_cbWriteFileTotal, 1)),
     10233                   kwFmtU64(sz2, g_cWriteFileToInMemTemp),
     10234                   (unsigned)(g_cWriteFileToInMemTemp * (KU64)100 / K_MAX(g_cWriteFileCalls, 1)));
     10235
     10236    off += sprintf(&szBuf[off], "%s %14s bytes for the cache\n", szPrf,
     10237                   kwFmtU64(sz1, g_pFsCache->cbObjects + g_pFsCache->cbAnsiPaths + g_pFsCache->cbUtf16Paths + sizeof(*g_pFsCache)));
     10238    off += sprintf(&szBuf[off], "%s %14s objects, taking up %s bytes, avg %s bytes\n", szPrf,
     10239                   kwFmtU64(sz1, g_pFsCache->cObjects),
     10240                   kwFmtU64(sz2, g_pFsCache->cbObjects),
     10241                   kwFmtU64(sz3, g_pFsCache->cbObjects / g_pFsCache->cObjects));
     10242    off += sprintf(&szBuf[off], "%s %14s A path hashes, taking up %s bytes, avg %s bytes, %s collision\n", szPrf,
     10243                   kwFmtU64(sz1, g_pFsCache->cAnsiPaths),
     10244                   kwFmtU64(sz2, g_pFsCache->cbAnsiPaths),
     10245                   kwFmtU64(sz3, g_pFsCache->cbAnsiPaths / K_MAX(g_pFsCache->cAnsiPaths, 1)),
     10246                   kwFmtU64(sz4, g_pFsCache->cAnsiPathCollisions));
    1008510247#ifdef KFSCACHE_CFG_UTF16
    10086     off += sprintf(&szBuf[off], "%s %10" KSIZE_PRI_U " W path hashes, taking up %" KSIZE_PRI_U " bytes, avg %" KSIZE_PRI_U " bytes, %" KSIZE_PRI_U " collisions\n",
    10087                    szPrf, g_pFsCache->cUtf16Paths, g_pFsCache->cbUtf16Paths,
    10088                    g_pFsCache->cbUtf16Paths / K_MAX(g_pFsCache->cUtf16Paths, 1), g_pFsCache->cUtf16PathCollisions);
     10248    off += sprintf(&szBuf[off], "%s %14s W path hashes, taking up %s bytes, avg %s bytes, %s collisions\n", szPrf,
     10249                   kwFmtU64(sz1, g_pFsCache->cUtf16Paths),
     10250                   kwFmtU64(sz2, g_pFsCache->cbUtf16Paths),
     10251                   kwFmtU64(sz3, g_pFsCache->cbUtf16Paths / K_MAX(g_pFsCache->cUtf16Paths, 1)),
     10252                   kwFmtU64(sz4, g_pFsCache->cUtf16PathCollisions));
    1008910253#endif
    10090     off += sprintf(&szBuf[off], "%s %10" KSIZE_PRI_U " child hash tables, total of %" KSIZE_PRI_U " entries, %" KSIZE_PRI_U " children inserted, %" KSIZE_PRI_U " collisions\n",
    10091                    szPrf, g_pFsCache->cChildHashTabs, g_pFsCache->cChildHashEntriesTotal,
    10092                    g_pFsCache->cChildHashed, g_pFsCache->cChildHashCollisions);
     10254    off += sprintf(&szBuf[off], "%s %14s child hash tables, total of %s entries, %s children inserted, %s collisions\n", szPrf,
     10255                   kwFmtU64(sz1, g_pFsCache->cChildHashTabs),
     10256                   kwFmtU64(sz2, g_pFsCache->cChildHashEntriesTotal),
     10257                   kwFmtU64(sz3, g_pFsCache->cChildHashed),
     10258                   kwFmtU64(sz4, g_pFsCache->cChildHashCollisions));
    1009310259
    1009410260    cMisses = g_pFsCache->cLookups - g_pFsCache->cPathHashHits - g_pFsCache->cWalkHits;
    10095     off += sprintf(&szBuf[off], "%s %10" KSIZE_PRI_U " lookups: %" KSIZE_PRI_U " (%" KU64_PRI " %%) path hash hits, %" KSIZE_PRI_U " (%" KU64_PRI "%%) walks hits, %" KSIZE_PRI_U " (%" KU64_PRI "%%) misses\n",
    10096                    szPrf, g_pFsCache->cLookups,
    10097                    g_pFsCache->cPathHashHits, g_pFsCache->cPathHashHits * (KU64)100 / K_MAX(g_pFsCache->cLookups, 1),
    10098                    g_pFsCache->cWalkHits, g_pFsCache->cWalkHits * (KU64)100 / K_MAX(g_pFsCache->cLookups, 1),
    10099                    cMisses, cMisses * (KU64)100 / K_MAX(g_pFsCache->cLookups, 1));
    10100     off += sprintf(&szBuf[off], "%s %10" KSIZE_PRI_U " child searches, %" KSIZE_PRI_U " (%" KU64_PRI "%%) hash hits\n",
    10101                    szPrf, g_pFsCache->cChildSearches,
    10102                    g_pFsCache->cChildHashHits, g_pFsCache->cChildHashHits * (KU64)100 / K_MAX(g_pFsCache->cChildSearches, 1));
    10103     off += sprintf(&szBuf[off], "%s %10" KSIZE_PRI_U " name changes, growing %" KSIZE_PRI_U " times (%" KU64_PRI "%%)\n",
    10104                    szPrf, g_pFsCache->cNameChanges, g_pFsCache->cNameGrowths,
    10105                    g_pFsCache->cNameGrowths * 100 / K_MAX(g_pFsCache->cNameChanges, 1) );
     10261    off += sprintf(&szBuf[off], "%s %14s lookups: %s (%u%%) path hash hits, %s (%u%%) walks hits, %s (%u%%) misses\n", szPrf,
     10262                   kwFmtU64(sz1, g_pFsCache->cLookups),
     10263                   kwFmtU64(sz2, g_pFsCache->cPathHashHits),
     10264                   (unsigned)(g_pFsCache->cPathHashHits * (KU64)100 / K_MAX(g_pFsCache->cLookups, 1)),
     10265                   kwFmtU64(sz3, g_pFsCache->cWalkHits),
     10266                   (unsigned)(g_pFsCache->cWalkHits * (KU64)100 / K_MAX(g_pFsCache->cLookups, 1)),
     10267                   kwFmtU64(sz4, cMisses),
     10268                   (unsigned)(cMisses * (KU64)100 / K_MAX(g_pFsCache->cLookups, 1)));
     10269
     10270    off += sprintf(&szBuf[off], "%s %14s child searches, %s (%u%%) hash hits\n", szPrf,
     10271                   kwFmtU64(sz1, g_pFsCache->cChildSearches),
     10272                   kwFmtU64(sz2, g_pFsCache->cChildHashHits),
     10273                   (unsigned)(g_pFsCache->cChildHashHits * (KU64)100 / K_MAX(g_pFsCache->cChildSearches, 1)));
     10274    off += sprintf(&szBuf[off], "%s %14s name changes, growing %s times (%u%%)\n", szPrf,
     10275                   kwFmtU64(sz1, g_pFsCache->cNameChanges),
     10276                   kwFmtU64(sz2, g_pFsCache->cNameGrowths),
     10277                   (unsigned)(g_pFsCache->cNameGrowths * 100 / K_MAX(g_pFsCache->cNameChanges, 1)) );
    1010610278
    1010710279
     
    1011410286    if (!GetProcessMemoryInfo(GetCurrentProcess(), (PPROCESS_MEMORY_COUNTERS)&MemInfo, sizeof(MemInfo)))
    1011510287        memset(&MemInfo, 0, sizeof(MemInfo));
    10116     off += sprintf(&szBuf[off], "%s %10" KU32_PRI " handles; %" KU32_PRI " page faults; %" KSIZE_PRI_U " bytes page file, peaking at %" KSIZE_PRI_U " bytes\n",
    10117                    szPrf, cHandles, MemInfo.PageFaultCount, MemInfo.PagefileUsage, MemInfo.PeakPagefileUsage);
    10118     off += sprintf(&szBuf[off], "%s %10" KSIZE_PRI_U " bytes working set, peaking at %" KSIZE_PRI_U " bytes; %" KSIZE_PRI_U " byte private\n",
    10119                    szPrf, MemInfo.WorkingSetSize, MemInfo.PeakWorkingSetSize, MemInfo.PrivateUsage);
    10120     off += sprintf(&szBuf[off], "%s %10" KSIZE_PRI_U " bytes non-paged pool, peaking at %" KSIZE_PRI_U " bytes; %7" KSIZE_PRI_U " bytes paged pool, peaking at %" KSIZE_PRI_U " bytes\n",
    10121                    szPrf, MemInfo.QuotaNonPagedPoolUsage, MemInfo.QuotaPeakNonPagedPoolUsage,
    10122                    MemInfo.QuotaPagedPoolUsage, MemInfo.QuotaPeakPagedPoolUsage);
     10288    off += sprintf(&szBuf[off], "%s %14s handles; %s page faults; %s bytes page file, peaking at %s bytes\n", szPrf,
     10289                   kwFmtU64(sz1, cHandles),
     10290                   kwFmtU64(sz2, MemInfo.PageFaultCount),
     10291                   kwFmtU64(sz3, MemInfo.PagefileUsage),
     10292                   kwFmtU64(sz4, MemInfo.PeakPagefileUsage));
     10293    off += sprintf(&szBuf[off], "%s %14s bytes working set, peaking at %s bytes; %s byte private\n", szPrf,
     10294                   kwFmtU64(sz1, MemInfo.WorkingSetSize),
     10295                   kwFmtU64(sz2, MemInfo.PeakWorkingSetSize),
     10296                   kwFmtU64(sz3, MemInfo.PrivateUsage));
     10297    off += sprintf(&szBuf[off], "%s %14s bytes non-paged pool, peaking at %s bytes; %s bytes paged pool, peaking at %s bytes\n",
     10298                   szPrf,
     10299                   kwFmtU64(sz1, MemInfo.QuotaNonPagedPoolUsage),
     10300                   kwFmtU64(sz2, MemInfo.QuotaPeakNonPagedPoolUsage),
     10301                   kwFmtU64(sz3, MemInfo.QuotaPagedPoolUsage),
     10302                   kwFmtU64(sz4, MemInfo.QuotaPeakPagedPoolUsage));
    1012310303
    1012410304    if (!GetProcessIoCounters(GetCurrentProcess(), &IoCounters))
    1012510305        memset(&IoCounters, 0, sizeof(IoCounters));
    10126     off += sprintf(&szBuf[off], "%s %10" KU64_PRI " bytes in %" KU64_PRI " reads\n",
    10127                    szPrf, IoCounters.ReadTransferCount, IoCounters.ReadOperationCount);
    10128     off += sprintf(&szBuf[off], "%s %10" KU64_PRI " bytes in %" KU64_PRI " writes\n",
    10129                    szPrf, IoCounters.WriteTransferCount, IoCounters.WriteOperationCount);
    10130     off += sprintf(&szBuf[off], "%s %10" KU64_PRI " bytes in %" KU64_PRI " other I/O operations\n",
    10131                    szPrf, IoCounters.OtherTransferCount, IoCounters.OtherOperationCount);
     10306    off += sprintf(&szBuf[off], "%s %14s bytes in %s reads [src: OS]\n", szPrf,
     10307                   kwFmtU64(sz1, IoCounters.ReadTransferCount),
     10308                   kwFmtU64(sz2, IoCounters.ReadOperationCount));
     10309    off += sprintf(&szBuf[off], "%s %14s bytes in %s writes [src: OS]\n", szPrf,
     10310                   kwFmtU64(sz1, IoCounters.WriteTransferCount),
     10311                   kwFmtU64(sz2, IoCounters.WriteOperationCount));
     10312    off += sprintf(&szBuf[off], "%s %14s bytes in %s other I/O operations [src: OS]\n", szPrf,
     10313                   kwFmtU64(sz1, IoCounters.OtherTransferCount),
     10314                   kwFmtU64(sz2, IoCounters.OtherOperationCount));
    1013210315
    1013310316    MemStatus.dwLength = sizeof(MemStatus);
    1013410317    if (!GlobalMemoryStatusEx(&MemStatus))
    1013510318        memset(&MemStatus, 0, sizeof(MemStatus));
    10136     off += sprintf(&szBuf[off], "%s %10" KU64_PRI " bytes used VA, %#" KX64_PRI " bytes available\n", szPrf,
    10137                    MemStatus.ullTotalVirtual - MemStatus.ullAvailVirtual, MemStatus.ullAvailVirtual);
    10138     off += sprintf(&szBuf[off], "%s %9u%% system memory load\n", szPrf, MemStatus.dwMemoryLoad);
     10319    off += sprintf(&szBuf[off], "%s %14s bytes used VA, %#" KX64_PRI " bytes available\n", szPrf,
     10320                   kwFmtU64(sz1, MemStatus.ullTotalVirtual - MemStatus.ullAvailVirtual),
     10321                   MemStatus.ullAvailVirtual);
     10322    off += sprintf(&szBuf[off], "%s %14u %% system memory load\n", szPrf, MemStatus.dwMemoryLoad);
    1013910323
    1014010324    maybe_con_fwrite(szBuf, off, 1, stdout);
Note: See TracChangeset for help on using the changeset viewer.