| 1284 | thread_local bool BaseTraceEvent::networkThread = false; |
| 1285 | |
| 1286 | void BaseTraceEvent::setNetworkThread() { |
| 1287 | if (!networkThread) { |
| 1288 | if (FLOW_KNOBS->ALLOCATION_TRACING_ENABLED) { |
| 1289 | // Ensure that threadId is initialized before we enable allocation tracing, otherwise it would |
| 1290 | // be initialized either by first normal usage of TraceEvent or by allocation tracing which is |
| 1291 | // non-deterministic, and we could run into https://github.com/apple/foundationdb/issues/7872. |
| 1292 | getTraceThreadId(); |
| 1293 | --g_allocation_tracing_disabled; |
| 1294 | } |
| 1295 | |
| 1296 | traceEventThrottlerCache = new TransientThresholdMetricSample<Standalone<StringRef>>( |
| 1297 | FLOW_KNOBS->TRACE_EVENT_METRIC_UNITS_PER_SAMPLE, FLOW_KNOBS->TRACE_EVENT_THROTTLER_MSG_LIMIT); |
| 1298 | networkThread = true; |
| 1299 | } |
| 1300 | } |
| 1301 | |
| 1302 | bool BaseTraceEvent::isNetworkThread() { |
| 1303 | return networkThread; |
nothing calls this directly
no test coverage detected