VirtualBox

Changeset 32940 in vbox for trunk/src/VBox/HostServices


Ignore:
Timestamp:
Oct 6, 2010 10:47:09 AM (14 years ago)
Author:
vboxsync
Message:

crOpenGL: another perf counter

Location:
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_clear.c

    r32924 r32940  
    3636    uint32_t *mpaOps;
    3737
     38    uint64_t mTimeUsedSum;
     39    uint64_t *mpaTimes;
    3840} VBOXCRFPS, *PVBOXCRFPS;
    3941
     
    4749    pFps->mpaCalls = crCalloc(sizeof (pFps->mpaCalls[0]) * cPeriods);
    4850    pFps->mpaOps = crCalloc(sizeof (pFps->mpaOps[0]) * cPeriods);
     51    pFps->mpaTimes = crCalloc(sizeof (pFps->mpaTimes[0]) * cPeriods);
    4952}
    5053
     
    5962{
    6063    uint64_t cur = RTTimeNanoTS();
    61     uint64_t curBytes, curBytesSent, curCalls, curOps;
     64    uint64_t curBytes, curBytesSent, curCalls, curOps, curTimeUsed;
    6265    int i;
    6366
     
    6669    curCalls = 0;
    6770    curOps = 0;
     71    curTimeUsed = 0;
    6872
    6973    for (i = 0; i < cr_server.numClients; i++)
     
    7579            curCalls += cr_server.clients[i]->conn->recv_count;
    7680            curOps += cr_server.clients[i]->conn->opcodes_count;
     81            curTimeUsed += cr_server.clients[i]->timeUsed;
    7782            cr_server.clients[i]->conn->total_bytes_recv = 0;
    7883            cr_server.clients[i]->conn->total_bytes_sent = 0;
    7984            cr_server.clients[i]->conn->recv_count = 0;
    8085            cr_server.clients[i]->conn->opcodes_count = 0;
     86            cr_server.clients[i]->timeUsed = 0;
    8187        }
    8288    }
     
    101107        pFps->mpaOps[pFps->miPeriod] = curOps;
    102108
     109        pFps->mTimeUsedSum += curTimeUsed - pFps->mpaTimes[pFps->miPeriod];
     110        pFps->mpaTimes[pFps->miPeriod] = curTimeUsed;
     111
    103112        ++pFps->miPeriod;
    104113        pFps->miPeriod %= pFps->mcPeriods;
     
    136145{
    137146    return vboxCrFpsGetFps(pFps) * pFps->mOpsSum / pFps->mcPeriods;
     147}
     148
     149double vboxCrFpsGetTimeProcPercent(PVBOXCRFPS pFps)
     150{
     151    return 100.0*pFps->mTimeUsedSum/pFps->mPeriodSum;
    138152}
    139153
     
    198212      double cps = vboxCrFpsGetCps(&Fps);
    199213      double ops = vboxCrFpsGetOps(&Fps);
    200       crDebug("fps: %f, rec Mbps: %.1f, send Mbps: %.1f, cps: %.1f, ops: %.0f", fps, bps/(1024.0*1024.0), bpsSent/(1024.0*1024.0), cps, ops);
     214      double tup = vboxCrFpsGetTimeProcPercent(&Fps);
     215      crDebug("fps: %f, rec Mbps: %.1f, send Mbps: %.1f, cps: %.1f, ops: %.0f, host %.1f%%",
     216              fps, bps/(1024.0*1024.0), bpsSent/(1024.0*1024.0), cps, ops, tup);
    201217  }
    202218#endif
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c

    r32420 r32940  
    2525#include <iprt/assert.h>
    2626
     27#ifdef VBOXCR_LOGFPS
     28#include <iprt/timer.h>
     29#endif
     30
    2731/**
    2832 * \mainpage CrServerLib
     
    380384    CRClient *pClient = NULL;
    381385    int32_t i;
     386#ifdef VBOXCR_LOGFPS
     387    uint64_t tstart, tend;
     388#endif
    382389
    383390    /*crDebug("=>crServer: ClientWrite u32ClientID=%d", u32ClientID);*/
     
    395402
    396403    if (!pClient->conn->vMajor) return VERR_NOT_SUPPORTED;
     404
     405#ifdef VBOXCR_LOGFPS
     406    tstart = RTTimeNanoTS();
     407#endif
    397408
    398409    CRASSERT(pBuffer);
     
    452463    CRASSERT(!pClient->conn->allow_redir_ptr || crNetNumMessages(pClient->conn)==0);
    453464
     465#ifdef VBOXCR_LOGFPS
     466    tend = RTTimeNanoTS();
     467    pClient->timeUsed += tend-tstart;
     468#endif
    454469    /*crDebug("<=crServer: ClientWrite u32ClientID=%d", u32ClientID);*/
    455470
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette