From ec1395a304118894761c2235e55f0417c053a4a7 Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Thu, 10 Oct 2024 22:01:57 +0000 Subject: [PATCH] Better flight logging --- Grid/util/FlightRecorder.cc | 45 +++++++++++++++++++++++++++++++++---- Grid/util/FlightRecorder.h | 7 ++++-- Grid/util/Init.cc | 3 +++ 3 files changed, 49 insertions(+), 6 deletions(-) diff --git a/Grid/util/FlightRecorder.cc b/Grid/util/FlightRecorder.cc index 60d18fb6..7bbd4acc 100644 --- a/Grid/util/FlightRecorder.cc +++ b/Grid/util/FlightRecorder.cc @@ -39,6 +39,8 @@ int FlightRecorder::ContinueOnFail; int FlightRecorder::LoggingMode; int FlightRecorder::ChecksumComms; int FlightRecorder::ChecksumCommsSend; +const char * FlightRecorder::StepName; +int32_t FlightRecorder::StepLoggingCounter; int32_t FlightRecorder::XmitLoggingCounter; int32_t FlightRecorder::RecvLoggingCounter; int32_t FlightRecorder::CsumLoggingCounter; @@ -58,6 +60,8 @@ void FlightRecorder::ResetCounters(void) CsumLoggingCounter=0; NormLoggingCounter=0; ReductionLoggingCounter=0; + StepName = "No steps started"; + StepLoggingCounter=0; } void FlightRecorder::Truncate(void) { @@ -88,6 +92,11 @@ void FlightRecorder::SetLoggingMode(FlightRecorder::LoggingMode_t mode) assert(0); } } +bool FlightRecorder::StepLog(const char *name) +{ + StepName = name; + StepLoggingCounter ++; +} void FlightRecorder::SetLoggingModePrint(void) { @@ -111,17 +120,19 @@ uint64_t FlightRecorder::ErrorCount(void) { return ErrorCounter; } -void FlightRecorder::NormLog(double value) +bool FlightRecorder::NormLog(double value) { uint64_t hex = * ( (uint64_t *)&value ); if(LoggingMode == LoggingModePrint) { std::cerr<<"FlightRecorder::NormLog : "<< NormLoggingCounter <<" "<si_signo); fprintf(stderr," mem address %llx\n",(unsigned long long)si->si_addr); fprintf(stderr," code %d\n",si->si_code);