Skip to content

Commit 560a1e9

Browse files
authored
DPL: extra signposts for InitTask callback (#13793)
1 parent a21ae94 commit 560a1e9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Framework/Core/src/DataProcessingDevice.cxx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,9 @@ void DataProcessingDevice::InitTask()
10081008
auto ref = ServiceRegistryRef{mServiceRegistry};
10091009
auto& deviceContext = ref.get<DeviceContext>();
10101010
auto& context = ref.get<DataProcessorContext>();
1011+
1012+
O2_SIGNPOST_ID_FROM_POINTER(cid, device, &context);
1013+
O2_SIGNPOST_START(device, cid, "InitTask", "Entering InitTask callback.");
10111014
auto& spec = getRunningDevice(mRunningDevice, mServiceRegistry);
10121015
auto distinct = DataRelayerHelpers::createDistinctRouteIndex(spec.inputs);
10131016
auto& state = ref.get<DeviceState>();
@@ -1098,10 +1101,13 @@ void DataProcessingDevice::InitTask()
10981101
// We will get there.
10991102
this->fillContext(mServiceRegistry.get<DataProcessorContext>(ServiceRegistry::globalDeviceSalt()), deviceContext);
11001103

1104+
O2_SIGNPOST_END(device, cid, "InitTask", "Exiting InitTask callback waiting for the remaining region callbacks.");
1105+
11011106
auto hasPendingEvents = [&mutex = mRegionInfoMutex, &pendingRegionInfos = mPendingRegionInfos](DeviceContext& deviceContext) {
11021107
std::lock_guard<std::mutex> lock(mutex);
11031108
return (pendingRegionInfos.empty() == false) || deviceContext.expectedRegionCallbacks > 0;
11041109
};
1110+
O2_SIGNPOST_START(device, cid, "InitTask", "Waiting for registation events.");
11051111
/// We now run an event loop also in InitTask. This is needed to:
11061112
/// * Make sure region registration callbacks are invoked
11071113
/// on the main thread.
@@ -1111,10 +1117,12 @@ void DataProcessingDevice::InitTask()
11111117
uv_run(state.loop, UV_RUN_ONCE);
11121118
// Handle callbacks if any
11131119
{
1120+
O2_SIGNPOST_EVENT_EMIT(device, cid, "InitTask", "Memory registration event received.");
11141121
std::lock_guard<std::mutex> lock(mRegionInfoMutex);
11151122
handleRegionCallbacks(mServiceRegistry, mPendingRegionInfos);
11161123
}
11171124
}
1125+
O2_SIGNPOST_END(device, cid, "InitTask", "Done waiting for registration events.");
11181126
}
11191127

11201128
void DataProcessingDevice::fillContext(DataProcessorContext& context, DeviceContext& deviceContext)

0 commit comments

Comments
 (0)