From 0fdbed07cfc1a3d2e5e43ea0db62f76a60b208ab Mon Sep 17 00:00:00 2001 From: Ernst Hellbar Date: Wed, 17 Sep 2025 12:52:27 +0200 Subject: [PATCH] DPL: add possibility to disable downscaling of processing reporting by env variable --- Framework/Core/src/CallbacksPolicy.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Framework/Core/src/CallbacksPolicy.cxx b/Framework/Core/src/CallbacksPolicy.cxx index aa22fa830c4c2..5e7bd7bc8306a 100644 --- a/Framework/Core/src/CallbacksPolicy.cxx +++ b/Framework/Core/src/CallbacksPolicy.cxx @@ -23,7 +23,7 @@ namespace o2::framework { -static bool checkPrescale(const TimingInfo& info, int prescale, bool startProcessing) +static bool checkPrescale(const TimingInfo& info, int prescale, bool startProcessing, bool noDownscaling) { if (prescale <= 1) { static size_t counter = 0; @@ -31,7 +31,7 @@ static bool checkPrescale(const TimingInfo& info, int prescale, bool startProces if (startProcessing) { counter++; } - if (counter <= 100000) { + if (counter <= 100000 || noDownscaling) { return true; } if (counter > 100000 * downscaleFactor) { @@ -53,6 +53,8 @@ CallbacksPolicy epnProcessReporting() if (!prescale) { prescale = 1; } + static bool noDownscaling = getenv("DPL_REPORT_PROCESSING_NO_DOWNSCALING") != nullptr && std::abs(atoi(getenv("DPL_REPORT_PROCESSING_NO_DOWNSCALING"))); + return { .matcher = [forceReport](DeviceSpec const&, ConfigContext const& context) -> bool { static bool report = DefaultsHelpers::deploymentMode() == DeploymentMode::OnlineDDS || forceReport; @@ -61,7 +63,7 @@ CallbacksPolicy epnProcessReporting() .policy = [prescale](CallbackService& callbacks, InitContext& context) -> void { callbacks.set([prescale](ServiceRegistryRef registry, int op) { auto& info = registry.get(); - if ((int)info.firstTForbit != -1 && checkPrescale(info, prescale, true)) { + if ((int)info.firstTForbit != -1 && checkPrescale(info, prescale, true, noDownscaling)) { char const* what = info.isTimer() ? "timer" : "timeslice"; LOGP(info, "Processing {}:{}, tfCounter:{}, firstTForbit:{}, runNumber:{}, creation:{}, action:{}", what, info.timeslice, info.tfCounter, info.firstTForbit, info.runNumber, info.creation, op); @@ -70,7 +72,7 @@ CallbacksPolicy epnProcessReporting() }); callbacks.set([prescale](ServiceRegistryRef registry, int op) { auto& info = registry.get(); - if ((int)info.firstTForbit != -1 && checkPrescale(info, prescale, false)) { + if ((int)info.firstTForbit != -1 && checkPrescale(info, prescale, false, noDownscaling)) { char const* what = info.isTimer() ? "timer" : "timeslice"; LOGP(info, "Done processing {}:{}, tfCounter:{}, firstTForbit:{}, runNumber:{}, creation:{}, action:{}, wall:{}", what, info.timeslice, info.tfCounter, info.firstTForbit, info.runNumber, info.creation, op, uv_hrtime() - info.lapse);