MCPcopy Create free account
hub / github.com/apple/foundationdb / dump

Method dump

flow/Trace.cpp:1392–1426  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1390}
1391
1392void TraceBatch::dump() {
1393 if (!g_traceLog.isOpen() || FLOW_KNOBS->MIN_TRACE_SEVERITY > TRACE_BATCH_IMPLICIT_SEVERITY)
1394 return;
1395 std::string machine;
1396 if (g_network->isSimulated()) {
1397 NetworkAddress local = g_network->getLocalAddress();
1398 machine = formatIpPort(local.ip, local.port);
1399 }
1400
1401 for (int i = 0; i < attachBatch.size(); i++) {
1402 if (g_network->isSimulated()) {
1403 attachBatch[i].fields.addField("Machine", machine);
1404 }
1405 g_traceLog.writeEvent(attachBatch[i].fields, "", false);
1406 }
1407
1408 for (int i = 0; i < eventBatch.size(); i++) {
1409 if (g_network->isSimulated()) {
1410 eventBatch[i].fields.addField("Machine", machine);
1411 }
1412 g_traceLog.writeEvent(eventBatch[i].fields, "", false);
1413 }
1414
1415 for (int i = 0; i < buggifyBatch.size(); i++) {
1416 if (g_network->isSimulated()) {
1417 buggifyBatch[i].fields.addField("Machine", machine);
1418 }
1419 g_traceLog.writeEvent(buggifyBatch[i].fields, "", false);
1420 }
1421
1422 onMainThreadVoid([]() { g_traceLog.flush(); });
1423 eventBatch.clear();
1424 attachBatch.clear();
1425 buggifyBatch.clear();
1426}
1427
1428TraceBatch::EventInfo::EventInfo(double time, const char* name, uint64_t id, const char* location) {
1429 fields.addField("Severity", format("%d", (int)TRACE_BATCH_IMPLICIT_SEVERITY));

Callers 6

openTraceFileFunction · 0.45
outOfMemoryFunction · 0.45
getSBVarFunction · 0.45
gen_compile_db.pyFile · 0.45
create_directoryMethod · 0.45
saveMethod · 0.45

Calls 10

formatIpPortFunction · 0.85
onMainThreadVoidFunction · 0.85
addFieldMethod · 0.80
writeEventMethod · 0.80
clearMethod · 0.65
isOpenMethod · 0.45
isSimulatedMethod · 0.45
getLocalAddressMethod · 0.45
sizeMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected