VirtualBox

Ignore:
Timestamp:
Sep 20, 2013 4:29:01 PM (11 years ago)
Author:
vboxsync
Message:

crOpenGL: more dumper enhance

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server.h

    r47628 r48615  
    478478void crServerDumpDrawelv(GLuint idx, const char*pszElFormat, uint32_t cbEl, const void *pvVal, uint32_t cVal);
    479479
     480extern int64_t g_CrDbgDumpPid;
    480481extern unsigned long g_CrDbgDumpEnabled;
    481482extern unsigned long g_CrDbgDumpDraw;
     
    572573#define CR_SERVER_DUMP_DEFAULT_FILTER_DMP(_ev) (((_ev) & g_CrDbgDumpDraw) != 0)
    573574
    574 #define CR_SERVER_DUMP_FILTER_OP(_ev, _pDumper) (g_CrDbgDumpEnabled && crServerDumpFilterOp((_ev), (_pDumper)))
     575#define CR_SERVER_DUMP_FILTER_OP(_ev, _pDumper) (g_CrDbgDumpEnabled \
     576                && (!g_CrDbgDumpPid \
     577                        || (g_CrDbgDumpPid > 0 && ((uint64_t)g_CrDbgDumpPid) == cr_server.curClient->pid) \
     578                        || (g_CrDbgDumpPid < 0 && ((uint64_t)(-g_CrDbgDumpPid)) != cr_server.curClient->pid)) \
     579                && crServerDumpFilterOp((_ev), (_pDumper)))
    575580#define CR_SERVER_DUMP_FILTER_DMP(_ev, _pDumper) (crServerDumpFilterDmp((_ev), (_pDumper)))
    576581
     
    578583            if (!CR_SERVER_DUMP_FILTER_OP(CR_SERVER_DUMP_F_DRAW_ENTER_ALL, cr_server.Recorder.pDumper)) break; \
    579584            crServerDumpCheckInit(); \
    580             crDmpStrF(cr_server.Recorder.pDumper, "==ENTER %s==", __FUNCTION__); \
     585            crDmpStrF(cr_server.Recorder.pDumper, "==ENTER[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
    581586            if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_STATE_ENTER, cr_server.Recorder.pDumper)) { crServerDumpState(); } \
    582587            if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_PROGRAM_ENTER, cr_server.Recorder.pDumper)) { crServerDumpCurrentProgram(); } \
     
    585590            if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_TEX_ENTER, cr_server.Recorder.pDumper)) { crServerDumpTextures(); } \
    586591            if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_BUFF_ENTER, cr_server.Recorder.pDumper)) { crServerDumpBuffer(-1); } \
    587             crDmpStrF(cr_server.Recorder.pDumper, "==Done ENTER %s==", __FUNCTION__); \
     592            crDmpStrF(cr_server.Recorder.pDumper, "==Done ENTER[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
    588593        } while (0)
    589594
     
    591596            if (!CR_SERVER_DUMP_FILTER_OP(CR_SERVER_DUMP_F_DRAW_LEAVE_ALL, cr_server.Recorder.pDumper)) break; \
    592597            crServerDumpCheckInit(); \
    593             crDmpStrF(cr_server.Recorder.pDumper, "==LEAVE %s==", __FUNCTION__); \
     598            crDmpStrF(cr_server.Recorder.pDumper, "==LEAVE[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
    594599            if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_TEX_LEAVE, cr_server.Recorder.pDumper)) { crServerDumpTextures(); } \
    595600            if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_BUFF_LEAVE, cr_server.Recorder.pDumper)) { crServerDumpBuffer(-1); } \
     
    598603            if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_PROGRAM_LEAVE, cr_server.Recorder.pDumper)) { crServerDumpCurrentProgram(); } \
    599604            if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_DRAW_STATE_LEAVE, cr_server.Recorder.pDumper)) { crServerDumpState(); } \
    600             crDmpStrF(cr_server.Recorder.pDumper, "==Done LEAVE %s==", __FUNCTION__); \
     605            crDmpStrF(cr_server.Recorder.pDumper, "==Done LEAVE[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
    601606        } while (0)
    602607
     
    604609            if (!CR_SERVER_DUMP_FILTER_OP(CR_SERVER_DUMP_F_COMPILE_SHADER, cr_server.Recorder.pDumper)) break; \
    605610            crServerDumpCheckInit(); \
    606             crDmpStrF(cr_server.Recorder.pDumper, "== %s", __FUNCTION__); \
     611            crDmpStrF(cr_server.Recorder.pDumper, "==[%d] %s", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
    607612            crServerDumpShader((_id)); \
    608             crDmpStrF(cr_server.Recorder.pDumper, "====="); \
     613            crDmpStrF(cr_server.Recorder.pDumper, "==Done[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
    609614        } while (0)
    610615
     
    612617            if (!CR_SERVER_DUMP_FILTER_OP(CR_SERVER_DUMP_F_SHADER_SOURCE, cr_server.Recorder.pDumper)) break; \
    613618            crServerDumpCheckInit(); \
    614             crDmpStrF(cr_server.Recorder.pDumper, "==%s==", __FUNCTION__); \
     619            crDmpStrF(cr_server.Recorder.pDumper, "==[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
    615620            crServerDumpShader((_id)); \
    616             crDmpStrF(cr_server.Recorder.pDumper, "==Done %s==", __FUNCTION__); \
     621            crDmpStrF(cr_server.Recorder.pDumper, "==Done[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
    617622        } while (0)
    618623
     
    620625            if (!CR_SERVER_DUMP_FILTER_OP(CR_SERVER_DUMP_F_LINK_PROGRAM, cr_server.Recorder.pDumper)) break; \
    621626            crServerDumpCheckInit(); \
    622             crDmpStrF(cr_server.Recorder.pDumper, "==%s==", __FUNCTION__); \
     627            crDmpStrF(cr_server.Recorder.pDumper, "==[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
    623628            crServerDumpProgram((_id)); \
    624             crDmpStrF(cr_server.Recorder.pDumper, "==Done %s==", __FUNCTION__); \
     629            crDmpStrF(cr_server.Recorder.pDumper, "==Done[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
    625630        } while (0)
    626631
     
    628633            if (!CR_SERVER_DUMP_FILTER_OP(CR_SERVER_DUMP_F_SWAPBUFFERS_ENTER, cr_server.Recorder.pDumper)) break; \
    629634            crServerDumpCheckInit(); \
    630             crDmpStrF(cr_server.Recorder.pDumper, "==ENTER %s==", __FUNCTION__); \
     635            crDmpStrF(cr_server.Recorder.pDumper, "==ENTER[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
    631636            if (CR_SERVER_DUMP_FILTER_DMP(CR_SERVER_DUMP_F_SWAPBUFFERS_ENTER, cr_server.Recorder.pDumper)) { crServerDumpBuffer(CR_SERVER_FBO_BB_IDX(cr_server.currentMural)); } \
    632637            if (g_CrDbgDumpDrawFramesCount) { crServerDumpFramesCheck(); } \
    633             crDmpStrF(cr_server.Recorder.pDumper, "==Done ENTER %s==", __FUNCTION__); \
     638            crDmpStrF(cr_server.Recorder.pDumper, "==Done ENTER[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
    634639        } while (0)
    635640
    636641#define CR_SERVER_DUMP_SWAPBUFFERS_LEAVE() do { \
    637642            if (!CR_SERVER_DUMP_FILTER_OP(CR_SERVER_DUMP_F_SWAPBUFFERS_LEAVE, cr_server.Recorder.pDumper)) break; \
    638             crDmpStrF(cr_server.Recorder.pDumper, "==LEAVE %s==", __FUNCTION__); \
     643            crDmpStrF(cr_server.Recorder.pDumper, "==LEAVE[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
    639644            crServerDumpCheckInit(); \
    640             crDmpStrF(cr_server.Recorder.pDumper, "==Done LEAVE %s==", __FUNCTION__); \
     645            crDmpStrF(cr_server.Recorder.pDumper, "==Done LEAVE[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
    641646        } while (0)
    642647
     
    644649        if (!CR_SERVER_DUMP_FILTER_OP(CR_SERVER_DUMP_F_DRAWEL, cr_server.Recorder.pDumper)) break; \
    645650        crServerDumpCheckInit(); \
    646         crDmpStrF(cr_server.Recorder.pDumper, "==%s==", __FUNCTION__); \
     651        crDmpStrF(cr_server.Recorder.pDumper, "==[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
    647652        crServerDumpDrawel _msg; \
    648653    } while (0)
     
    651656        if (!CR_SERVER_DUMP_FILTER_OP(CR_SERVER_DUMP_F_DRAWEL, cr_server.Recorder.pDumper)) break; \
    652657        crServerDumpCheckInit(); \
    653         crDmpStrF(cr_server.Recorder.pDumper, "==%s==", __FUNCTION__); \
     658        crDmpStrF(cr_server.Recorder.pDumper, "==[%d] %s==", (uint32_t)cr_server.curClient->pid, __FUNCTION__); \
    654659        crServerDumpDrawelv((_index), (_pszElFormat), (_cbEl), (_pvVal), (_cVal)); \
    655660    } while (0)
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_misc.c

    r48275 r48615  
    13961396 * 0x22 - dump texture and buffer on exit */
    13971397
    1398 unsigned long g_CrDbgDumpEnabled = 1;
     1398int64_t g_CrDbgDumpPid = 0;
     1399unsigned long g_CrDbgDumpEnabled = 0;
    13991400unsigned long g_CrDbgDumpDraw = CR_SERVER_DUMP_F_COMPILE_SHADER
    14001401        | CR_SERVER_DUMP_F_LINK_PROGRAM
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