MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fxSendProfilerRecord

Function fxSendProfilerRecord

xs/sources/xsDebug.c:3394–3430  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3392}
3393
3394void fxSendProfilerRecord(txMachine* the, txSlot* frame, txID id, txSlot* code)
3395{
3396#ifdef mxDebug
3397 if (fxIsConnected(the)) {
3398 fxEchoStart(the);
3399 if (id == 0) {
3400 fxEcho(the, "<pr name=\"(host)\" value=\"0\"");
3401 }
3402 else if (id == 1) {
3403 fxEcho(the, "<pr name=\"(gc)\" value=\"1\"");
3404 }
3405 else {
3406 fxEcho(the, "<pr name=\"");
3407 fxEchoFrameName(the, frame);
3408 fxEcho(the, "\" value=\"");
3409 fxEchoInteger(the, id);
3410 fxEcho(the, "\"");
3411 }
3412 if (code) {
3413 if ((code->kind == XS_CODE_KIND) || (code->kind == XS_CODE_X_KIND)) {
3414 txByte* p = code->value.code.address + 2;
3415 if (*p == XS_CODE_FILE) {
3416 txID file;
3417 txS2 line;
3418 p++;
3419 mxDecodeID(p, file);
3420 p++;
3421 mxDecode2(p, line);
3422 fxEchoPathLine(the, fxGetKeyName(the, file), line);
3423 }
3424 }
3425 }
3426 fxEcho(the, "/>");
3427 fxEchoStop(the);
3428 }
3429#endif
3430}
3431
3432void fxSendProfilerSamples(txMachine* the, txProfiler* profiler)
3433{

Callers 2

fxCreateProfilerFunction · 0.85
fxFrameToProfilerIDFunction · 0.85

Calls 8

fxEchoStartFunction · 0.85
fxEchoFunction · 0.85
fxEchoFrameNameFunction · 0.85
fxEchoIntegerFunction · 0.85
fxEchoPathLineFunction · 0.85
fxGetKeyNameFunction · 0.85
fxEchoStopFunction · 0.85
fxIsConnectedFunction · 0.70

Tested by

no test coverage detected