Skip to content

Commit

Permalink
DPL: add signposts to debug signals
Browse files Browse the repository at this point in the history
  • Loading branch information
ktf committed Jan 22, 2024
1 parent 88d397a commit dc32ec4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Framework/Core/src/DataProcessingDevice.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -495,11 +495,12 @@ void DataProcessingDevice::Init()

void on_signal_callback(uv_signal_t* handle, int signum)
{
ZoneScopedN("Signal callaback");
LOG(debug) << "Signal " << signum << " received.";
O2_SIGNPOST_ID_FROM_POINTER(sid, device, handle);
O2_SIGNPOST_START(device, sid, "signal_state", "Signal %d received.", signum);

auto* registry = (ServiceRegistry*)handle->data;
if (!registry) {
LOG(debug) << "No registry active. Ignoring signal";
O2_SIGNPOST_END(device, sid, "signal_state", "No registry active. Ignoring signal.");
return;
}
ServiceRegistryRef ref{*registry};
Expand All @@ -516,6 +517,7 @@ void on_signal_callback(uv_signal_t* handle, int signum)
// available and being offered, however we
// want to get out of the woods for now.
if (offer.valid && offer.sharedMemory != 0) {
O2_SIGNPOST_END(device, sid, "signal_state", "Memory already offered.");
return;
}
ri++;
Expand All @@ -532,6 +534,7 @@ void on_signal_callback(uv_signal_t* handle, int signum)
}
}
stats.updateStats({(int)ProcessingStatsId::TOTAL_SIGUSR1, DataProcessingStats::Op::Add, 1});
O2_SIGNPOST_END(device, sid, "signal_state", "Done processing signals.");
}

static auto toBeForwardedHeader = [](void* header) -> bool {
Expand Down

0 comments on commit dc32ec4

Please sign in to comment.