VirtualBox

Changeset 32924 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Oct 5, 2010 2:20:35 PM (14 years ago)
Author:
vboxsync
Message:

crOpenGL: add opcodes counter

Location:
trunk/src/VBox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/OpenGL/include/cr_net.h

    r32909 r32924  
    168168    int total_bytes_recv;
    169169    int recv_count;
     170    int opcodes_count;
    170171
    171172    /* credits for flow control */
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_clear.c

    r32911 r32924  
    3232    uint64_t mCallsSum;
    3333    uint32_t *mpaCalls;
     34
     35    uint64_t mOpsSum;
     36    uint32_t *mpaOps;
     37
    3438} VBOXCRFPS, *PVBOXCRFPS;
    3539
     
    4246    pFps->mpaBytesSent = crCalloc(sizeof (pFps->mpaBytesSent[0]) * cPeriods);
    4347    pFps->mpaCalls = crCalloc(sizeof (pFps->mpaCalls[0]) * cPeriods);
     48    pFps->mpaOps = crCalloc(sizeof (pFps->mpaOps[0]) * cPeriods);
    4449}
    4550
     
    5459{
    5560    uint64_t cur = RTTimeNanoTS();
    56     uint64_t curBytes, curBytesSent, curCalls;
     61    uint64_t curBytes, curBytesSent, curCalls, curOps;
    5762    int i;
    5863
     
    6065    curBytesSent = 0;
    6166    curCalls = 0;
     67    curOps = 0;
    6268
    6369    for (i = 0; i < cr_server.numClients; i++)
     
    6874            curBytesSent += cr_server.clients[i]->conn->total_bytes_sent;
    6975            curCalls += cr_server.clients[i]->conn->recv_count;
     76            curOps += cr_server.clients[i]->conn->opcodes_count;
    7077            cr_server.clients[i]->conn->total_bytes_recv = 0;
    7178            cr_server.clients[i]->conn->total_bytes_sent = 0;
    7279            cr_server.clients[i]->conn->recv_count = 0;
     80            cr_server.clients[i]->conn->opcodes_count = 0;
    7381        }
    7482    }
     
    9098        pFps->mpaCalls[pFps->miPeriod] = curCalls;
    9199
     100        pFps->mOpsSum += curOps - pFps->mpaOps[pFps->miPeriod];
     101        pFps->mpaOps[pFps->miPeriod] = curOps;
     102
    92103        ++pFps->miPeriod;
    93104        pFps->miPeriod %= pFps->mcPeriods;
     
    120131{
    121132    return vboxCrFpsGetFps(pFps) * pFps->mCallsSum / pFps->mcPeriods;
     133}
     134
     135double vboxCrFpsGetOps(PVBOXCRFPS pFps)
     136{
     137    return vboxCrFpsGetFps(pFps) * pFps->mOpsSum / pFps->mcPeriods;
    122138}
    123139
     
    181197      double bpsSent = vboxCrFpsGetBpsSent(&Fps);
    182198      double cps = vboxCrFpsGetCps(&Fps);
    183       crDebug("fps: %f, rec Mbps: %.1f, send Mbps: %.1f, cps: %.1f", fps, bps/(1024.0*1024.0), bpsSent/(1024.0*1024.0), cps);
     199      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);
    184201  }
    185202#endif
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_stream.c

    r25155 r32924  
    330330    msg_opcodes = (const CRMessageOpcodes *) msg;
    331331    opcodeBytes = (msg_opcodes->numOpcodes + 3) & ~0x03;
     332
     333#ifdef VBOXCR_LOGFPS
     334    CRASSERT(cr_server.curClient && cr_server.curClient->conn && cr_server.curClient->conn->id == msg->header.conn_id);
     335    cr_server.curClient->conn->opcodes_count += msg_opcodes->numOpcodes;
     336#endif
    332337
    333338    data_ptr = (const char *) msg_opcodes + sizeof(CRMessageOpcodes) + opcodeBytes;
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