Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-05-04 02:52:57

0001 // -*- C++ -*-
0002 //
0003 // Package:     Services
0004 // Class  :     Tracer
0005 //
0006 // Implementation:
0007 //     <Notes on implementation>
0008 //
0009 // Original Author:  Chris Jones
0010 //         Created:  Thu Sep  8 14:17:58 EDT 2005
0011 //
0012 
0013 #include "FWCore/Framework/interface/ComponentDescription.h"
0014 #include "FWCore/Framework/interface/DataKey.h"
0015 #include "FWCore/Framework/interface/EventSetupRecordKey.h"
0016 #include "FWCore/Framework/interface/IOVSyncValue.h"
0017 
0018 #include "FWCore/ServiceRegistry/interface/ServiceMaker.h"
0019 
0020 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0021 #include "FWCore/ServiceRegistry/interface/ActivityRegistry.h"
0022 
0023 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0024 #include "FWCore/ServiceRegistry/interface/ConsumesInfo.h"
0025 #include "FWCore/ServiceRegistry/interface/PathsAndConsumesOfModulesBase.h"
0026 #include "FWCore/ServiceRegistry/interface/SystemBounds.h"
0027 #include "FWCore/Utilities/interface/BranchType.h"
0028 #include "FWCore/Utilities/interface/Exception.h"
0029 #include "FWCore/Utilities/interface/ProductKindOfType.h"
0030 #include "FWCore/Utilities/interface/TimeOfDay.h"
0031 
0032 #include "DataFormats/Provenance/interface/EventID.h"
0033 #include "DataFormats/Provenance/interface/LuminosityBlockID.h"
0034 #include "DataFormats/Provenance/interface/ModuleDescription.h"
0035 #include "DataFormats/Provenance/interface/RunID.h"
0036 #include "DataFormats/Provenance/interface/Timestamp.h"
0037 
0038 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0039 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0040 #include "FWCore/ServiceRegistry/interface/GlobalContext.h"
0041 #include "FWCore/ServiceRegistry/interface/ModuleCallingContext.h"
0042 #include "FWCore/ServiceRegistry/interface/ESModuleCallingContext.h"
0043 #include "FWCore/ServiceRegistry/interface/PathContext.h"
0044 #include "FWCore/ServiceRegistry/interface/ProcessContext.h"
0045 #include "FWCore/ServiceRegistry/interface/StreamContext.h"
0046 #include "DataFormats/Common/interface/HLTPathStatus.h"
0047 
0048 #include <iostream>
0049 #include <vector>
0050 
0051 #include <string>
0052 #include <set>
0053 
0054 namespace edm {
0055   class ConfigurationDescriptions;
0056   class GlobalContext;
0057   class HLTPathStatus;
0058   class LuminosityBlock;
0059   class ModuleCallingContext;
0060   class ModuleDescription;
0061   class PathContext;
0062   class PathsAndConsumesOfModulesBase;
0063   class ProcessContext;
0064   class Run;
0065   class StreamContext;
0066 
0067   namespace service {
0068     class Tracer {
0069     public:
0070       Tracer(const ParameterSet&, ActivityRegistry&);
0071 
0072       static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0073 
0074       void preallocate(service::SystemBounds const&);
0075 
0076       void preBeginJob(PathsAndConsumesOfModulesBase const&, ProcessContext const&);
0077       void postBeginJob();
0078       void postEndJob();
0079 
0080       void preSourceEvent(StreamID);
0081       void postSourceEvent(StreamID);
0082 
0083       void preSourceLumi(LuminosityBlockIndex);
0084       void postSourceLumi(LuminosityBlockIndex);
0085 
0086       void preSourceRun(RunIndex);
0087       void postSourceRun(RunIndex);
0088 
0089       void preSourceProcessBlock();
0090       void postSourceProcessBlock(std::string const&);
0091 
0092       void preOpenFile(std::string const&);
0093       void postOpenFile(std::string const&);
0094 
0095       void preCloseFile(std::string const& lfn);
0096       void postCloseFile(std::string const&);
0097 
0098       void preModuleBeginStream(StreamContext const&, ModuleCallingContext const&);
0099       void postModuleBeginStream(StreamContext const&, ModuleCallingContext const&);
0100 
0101       void preModuleEndStream(StreamContext const&, ModuleCallingContext const&);
0102       void postModuleEndStream(StreamContext const&, ModuleCallingContext const&);
0103 
0104       void preBeginProcessBlock(GlobalContext const&);
0105       void postBeginProcessBlock(GlobalContext const&);
0106 
0107       void preAccessInputProcessBlock(GlobalContext const&);
0108       void postAccessInputProcessBlock(GlobalContext const&);
0109 
0110       void preEndProcessBlock(GlobalContext const&);
0111       void postEndProcessBlock(GlobalContext const&);
0112 
0113       void preWriteProcessBlock(GlobalContext const&);
0114       void postWriteProcessBlock(GlobalContext const&);
0115 
0116       void preGlobalBeginRun(GlobalContext const&);
0117       void postGlobalBeginRun(GlobalContext const&);
0118 
0119       void preGlobalEndRun(GlobalContext const&);
0120       void postGlobalEndRun(GlobalContext const&);
0121 
0122       void preGlobalWriteRun(GlobalContext const&);
0123       void postGlobalWriteRun(GlobalContext const&);
0124 
0125       void preStreamBeginRun(StreamContext const&);
0126       void postStreamBeginRun(StreamContext const&);
0127 
0128       void preStreamEndRun(StreamContext const&);
0129       void postStreamEndRun(StreamContext const&);
0130 
0131       void preGlobalBeginLumi(GlobalContext const&);
0132       void postGlobalBeginLumi(GlobalContext const&);
0133 
0134       void preGlobalEndLumi(GlobalContext const&);
0135       void postGlobalEndLumi(GlobalContext const&);
0136 
0137       void preGlobalWriteLumi(GlobalContext const&);
0138       void postGlobalWriteLumi(GlobalContext const&);
0139 
0140       void preStreamBeginLumi(StreamContext const&);
0141       void postStreamBeginLumi(StreamContext const&);
0142 
0143       void preStreamEndLumi(StreamContext const&);
0144       void postStreamEndLumi(StreamContext const&);
0145 
0146       void preEvent(StreamContext const&);
0147       void postEvent(StreamContext const&);
0148 
0149       void prePathEvent(StreamContext const&, PathContext const&);
0150       void postPathEvent(StreamContext const&, PathContext const&, HLTPathStatus const&);
0151 
0152       void preModuleConstruction(ModuleDescription const& md);
0153       void postModuleConstruction(ModuleDescription const& md);
0154 
0155       void preModuleDestruction(ModuleDescription const& md);
0156       void postModuleDestruction(ModuleDescription const& md);
0157 
0158       void preModuleBeginJob(ModuleDescription const& md);
0159       void postModuleBeginJob(ModuleDescription const& md);
0160 
0161       void preModuleEndJob(ModuleDescription const& md);
0162       void postModuleEndJob(ModuleDescription const& md);
0163 
0164       void preModuleEventPrefetching(StreamContext const&, ModuleCallingContext const&);
0165       void postModuleEventPrefetching(StreamContext const&, ModuleCallingContext const&);
0166       void preModuleEvent(StreamContext const&, ModuleCallingContext const&);
0167       void postModuleEvent(StreamContext const&, ModuleCallingContext const&);
0168       void preModuleEventAcquire(StreamContext const&, ModuleCallingContext const&);
0169       void postModuleEventAcquire(StreamContext const&, ModuleCallingContext const&);
0170       void preModuleEventDelayedGet(StreamContext const&, ModuleCallingContext const&);
0171       void postModuleEventDelayedGet(StreamContext const&, ModuleCallingContext const&);
0172       void preEventReadFromSource(StreamContext const&, ModuleCallingContext const&);
0173       void postEventReadFromSource(StreamContext const&, ModuleCallingContext const&);
0174 
0175       void preModuleStreamBeginRun(StreamContext const&, ModuleCallingContext const&);
0176       void postModuleStreamBeginRun(StreamContext const&, ModuleCallingContext const&);
0177       void preModuleStreamEndRun(StreamContext const&, ModuleCallingContext const&);
0178       void postModuleStreamEndRun(StreamContext const&, ModuleCallingContext const&);
0179 
0180       void preModuleStreamBeginLumi(StreamContext const&, ModuleCallingContext const&);
0181       void postModuleStreamBeginLumi(StreamContext const&, ModuleCallingContext const&);
0182       void preModuleStreamEndLumi(StreamContext const&, ModuleCallingContext const&);
0183       void postModuleStreamEndLumi(StreamContext const&, ModuleCallingContext const&);
0184 
0185       void preModuleBeginProcessBlock(GlobalContext const&, ModuleCallingContext const&);
0186       void postModuleBeginProcessBlock(GlobalContext const&, ModuleCallingContext const&);
0187       void preModuleAccessInputProcessBlock(GlobalContext const&, ModuleCallingContext const&);
0188       void postModuleAccessInputProcessBlock(GlobalContext const&, ModuleCallingContext const&);
0189       void preModuleEndProcessBlock(GlobalContext const&, ModuleCallingContext const&);
0190       void postModuleEndProcessBlock(GlobalContext const&, ModuleCallingContext const&);
0191 
0192       void preModuleGlobalBeginRun(GlobalContext const&, ModuleCallingContext const&);
0193       void postModuleGlobalBeginRun(GlobalContext const&, ModuleCallingContext const&);
0194       void preModuleGlobalEndRun(GlobalContext const&, ModuleCallingContext const&);
0195       void postModuleGlobalEndRun(GlobalContext const&, ModuleCallingContext const&);
0196 
0197       void preModuleGlobalBeginLumi(GlobalContext const&, ModuleCallingContext const&);
0198       void postModuleGlobalBeginLumi(GlobalContext const&, ModuleCallingContext const&);
0199       void preModuleGlobalEndLumi(GlobalContext const&, ModuleCallingContext const&);
0200       void postModuleGlobalEndLumi(GlobalContext const&, ModuleCallingContext const&);
0201 
0202       void preModuleWriteProcessBlock(GlobalContext const&, ModuleCallingContext const&);
0203       void postModuleWriteProcessBlock(GlobalContext const&, ModuleCallingContext const&);
0204 
0205       void preModuleWriteRun(GlobalContext const&, ModuleCallingContext const&);
0206       void postModuleWriteRun(GlobalContext const&, ModuleCallingContext const&);
0207 
0208       void preModuleWriteLumi(GlobalContext const&, ModuleCallingContext const&);
0209       void postModuleWriteLumi(GlobalContext const&, ModuleCallingContext const&);
0210 
0211       void preSourceConstruction(ModuleDescription const& md);
0212       void postSourceConstruction(ModuleDescription const& md);
0213 
0214       void preESModulePrefetching(eventsetup::EventSetupRecordKey const&, ESModuleCallingContext const&);
0215       void postESModulePrefetching(eventsetup::EventSetupRecordKey const&, ESModuleCallingContext const&);
0216       void preESModule(eventsetup::EventSetupRecordKey const&, ESModuleCallingContext const&);
0217       void postESModule(eventsetup::EventSetupRecordKey const&, ESModuleCallingContext const&);
0218 
0219     private:
0220       std::string indention_;
0221       std::set<std::string> dumpContextForLabels_;
0222       bool dumpNonModuleContext_;
0223       bool dumpPathsAndConsumes_;
0224       bool printTimestamps_;
0225       bool dumpEventSetupInfo_;
0226     };
0227   }  // namespace service
0228 }  // namespace edm
0229 
0230 using namespace edm::service;
0231 
0232 namespace {
0233 
0234   class TimeStamper {
0235   public:
0236     TimeStamper(bool enable) : enabled_(enable) {}
0237 
0238     friend std::ostream& operator<<(std::ostream& out, TimeStamper const& timestamp) {
0239       if (timestamp.enabled_)
0240         out << std::setprecision(2) << edm::TimeOfDay() << "  ";
0241       return out;
0242     }
0243 
0244   private:
0245     bool enabled_;
0246   };
0247 
0248 }  // namespace
0249 
0250 Tracer::Tracer(ParameterSet const& iPS, ActivityRegistry& iRegistry)
0251     : indention_(iPS.getUntrackedParameter<std::string>("indention")),
0252       dumpContextForLabels_(),
0253       dumpNonModuleContext_(iPS.getUntrackedParameter<bool>("dumpNonModuleContext")),
0254       dumpPathsAndConsumes_(iPS.getUntrackedParameter<bool>("dumpPathsAndConsumes")),
0255       printTimestamps_(iPS.getUntrackedParameter<bool>("printTimestamps")),
0256       dumpEventSetupInfo_(iPS.getUntrackedParameter<bool>("dumpEventSetupInfo")) {
0257   for (std::string& label : iPS.getUntrackedParameter<std::vector<std::string>>("dumpContextForLabels"))
0258     dumpContextForLabels_.insert(std::move(label));
0259 
0260   iRegistry.watchPreallocate(this, &Tracer::preallocate);
0261 
0262   iRegistry.watchPreBeginJob(this, &Tracer::preBeginJob);
0263   iRegistry.watchPostBeginJob(this, &Tracer::postBeginJob);
0264   iRegistry.watchPostEndJob(this, &Tracer::postEndJob);
0265 
0266   iRegistry.watchPreSourceEvent(this, &Tracer::preSourceEvent);
0267   iRegistry.watchPostSourceEvent(this, &Tracer::postSourceEvent);
0268 
0269   iRegistry.watchPreSourceLumi(this, &Tracer::preSourceLumi);
0270   iRegistry.watchPostSourceLumi(this, &Tracer::postSourceLumi);
0271 
0272   iRegistry.watchPreSourceRun(this, &Tracer::preSourceRun);
0273   iRegistry.watchPostSourceRun(this, &Tracer::postSourceRun);
0274 
0275   iRegistry.watchPreSourceProcessBlock(this, &Tracer::preSourceProcessBlock);
0276   iRegistry.watchPostSourceProcessBlock(this, &Tracer::postSourceProcessBlock);
0277 
0278   iRegistry.watchPreOpenFile(this, &Tracer::preOpenFile);
0279   iRegistry.watchPostOpenFile(this, &Tracer::postOpenFile);
0280 
0281   iRegistry.watchPreCloseFile(this, &Tracer::preCloseFile);
0282   iRegistry.watchPostCloseFile(this, &Tracer::postCloseFile);
0283 
0284   iRegistry.watchPreModuleBeginStream(this, &Tracer::preModuleBeginStream);
0285   iRegistry.watchPostModuleBeginStream(this, &Tracer::postModuleBeginStream);
0286 
0287   iRegistry.watchPreModuleEndStream(this, &Tracer::preModuleEndStream);
0288   iRegistry.watchPostModuleEndStream(this, &Tracer::postModuleEndStream);
0289 
0290   iRegistry.watchPreBeginProcessBlock(this, &Tracer::preBeginProcessBlock);
0291   iRegistry.watchPostBeginProcessBlock(this, &Tracer::postBeginProcessBlock);
0292 
0293   iRegistry.watchPreAccessInputProcessBlock(this, &Tracer::preAccessInputProcessBlock);
0294   iRegistry.watchPostAccessInputProcessBlock(this, &Tracer::postAccessInputProcessBlock);
0295 
0296   iRegistry.watchPreEndProcessBlock(this, &Tracer::preEndProcessBlock);
0297   iRegistry.watchPostEndProcessBlock(this, &Tracer::postEndProcessBlock);
0298 
0299   iRegistry.watchPreWriteProcessBlock(this, &Tracer::preWriteProcessBlock);
0300   iRegistry.watchPostWriteProcessBlock(this, &Tracer::postWriteProcessBlock);
0301 
0302   iRegistry.watchPreGlobalBeginRun(this, &Tracer::preGlobalBeginRun);
0303   iRegistry.watchPostGlobalBeginRun(this, &Tracer::postGlobalBeginRun);
0304 
0305   iRegistry.watchPreGlobalEndRun(this, &Tracer::preGlobalEndRun);
0306   iRegistry.watchPostGlobalEndRun(this, &Tracer::postGlobalEndRun);
0307 
0308   iRegistry.watchPreGlobalWriteRun(this, &Tracer::preGlobalWriteRun);
0309   iRegistry.watchPostGlobalWriteRun(this, &Tracer::postGlobalWriteRun);
0310 
0311   iRegistry.watchPreStreamBeginRun(this, &Tracer::preStreamBeginRun);
0312   iRegistry.watchPostStreamBeginRun(this, &Tracer::postStreamBeginRun);
0313 
0314   iRegistry.watchPreStreamEndRun(this, &Tracer::preStreamEndRun);
0315   iRegistry.watchPostStreamEndRun(this, &Tracer::postStreamEndRun);
0316 
0317   iRegistry.watchPreGlobalBeginLumi(this, &Tracer::preGlobalBeginLumi);
0318   iRegistry.watchPostGlobalBeginLumi(this, &Tracer::postGlobalBeginLumi);
0319 
0320   iRegistry.watchPreGlobalEndLumi(this, &Tracer::preGlobalEndLumi);
0321   iRegistry.watchPostGlobalEndLumi(this, &Tracer::postGlobalEndLumi);
0322 
0323   iRegistry.watchPreGlobalWriteLumi(this, &Tracer::preGlobalWriteLumi);
0324   iRegistry.watchPostGlobalWriteLumi(this, &Tracer::postGlobalWriteLumi);
0325 
0326   iRegistry.watchPreStreamBeginLumi(this, &Tracer::preStreamBeginLumi);
0327   iRegistry.watchPostStreamBeginLumi(this, &Tracer::postStreamBeginLumi);
0328 
0329   iRegistry.watchPreStreamEndLumi(this, &Tracer::preStreamEndLumi);
0330   iRegistry.watchPostStreamEndLumi(this, &Tracer::postStreamEndLumi);
0331 
0332   iRegistry.watchPreEvent(this, &Tracer::preEvent);
0333   iRegistry.watchPostEvent(this, &Tracer::postEvent);
0334 
0335   iRegistry.watchPrePathEvent(this, &Tracer::prePathEvent);
0336   iRegistry.watchPostPathEvent(this, &Tracer::postPathEvent);
0337 
0338   iRegistry.watchPreModuleConstruction(this, &Tracer::preModuleConstruction);
0339   iRegistry.watchPostModuleConstruction(this, &Tracer::postModuleConstruction);
0340 
0341   iRegistry.watchPreModuleDestruction(this, &Tracer::preModuleDestruction);
0342   iRegistry.watchPostModuleDestruction(this, &Tracer::postModuleDestruction);
0343 
0344   iRegistry.watchPreModuleBeginJob(this, &Tracer::preModuleBeginJob);
0345   iRegistry.watchPostModuleBeginJob(this, &Tracer::postModuleBeginJob);
0346 
0347   iRegistry.watchPreModuleEndJob(this, &Tracer::preModuleEndJob);
0348   iRegistry.watchPostModuleEndJob(this, &Tracer::postModuleEndJob);
0349 
0350   iRegistry.watchPreModuleEventPrefetching(this, &Tracer::preModuleEventPrefetching);
0351   iRegistry.watchPostModuleEventPrefetching(this, &Tracer::postModuleEventPrefetching);
0352   iRegistry.watchPreModuleEvent(this, &Tracer::preModuleEvent);
0353   iRegistry.watchPostModuleEvent(this, &Tracer::postModuleEvent);
0354   iRegistry.watchPreModuleEventAcquire(this, &Tracer::preModuleEventAcquire);
0355   iRegistry.watchPostModuleEventAcquire(this, &Tracer::postModuleEventAcquire);
0356   iRegistry.watchPreModuleEventDelayedGet(this, &Tracer::preModuleEventDelayedGet);
0357   iRegistry.watchPostModuleEventDelayedGet(this, &Tracer::postModuleEventDelayedGet);
0358   iRegistry.watchPreEventReadFromSource(this, &Tracer::preEventReadFromSource);
0359   iRegistry.watchPostEventReadFromSource(this, &Tracer::postEventReadFromSource);
0360 
0361   iRegistry.watchPreModuleStreamBeginRun(this, &Tracer::preModuleStreamBeginRun);
0362   iRegistry.watchPostModuleStreamBeginRun(this, &Tracer::postModuleStreamBeginRun);
0363   iRegistry.watchPreModuleStreamEndRun(this, &Tracer::preModuleStreamEndRun);
0364   iRegistry.watchPostModuleStreamEndRun(this, &Tracer::postModuleStreamEndRun);
0365 
0366   iRegistry.watchPreModuleStreamBeginLumi(this, &Tracer::preModuleStreamBeginLumi);
0367   iRegistry.watchPostModuleStreamBeginLumi(this, &Tracer::postModuleStreamBeginLumi);
0368   iRegistry.watchPreModuleStreamEndLumi(this, &Tracer::preModuleStreamEndLumi);
0369   iRegistry.watchPostModuleStreamEndLumi(this, &Tracer::postModuleStreamEndLumi);
0370 
0371   iRegistry.watchPreModuleBeginProcessBlock(this, &Tracer::preModuleBeginProcessBlock);
0372   iRegistry.watchPostModuleBeginProcessBlock(this, &Tracer::postModuleBeginProcessBlock);
0373   iRegistry.watchPreModuleAccessInputProcessBlock(this, &Tracer::preModuleAccessInputProcessBlock);
0374   iRegistry.watchPostModuleAccessInputProcessBlock(this, &Tracer::postModuleAccessInputProcessBlock);
0375   iRegistry.watchPreModuleEndProcessBlock(this, &Tracer::preModuleEndProcessBlock);
0376   iRegistry.watchPostModuleEndProcessBlock(this, &Tracer::postModuleEndProcessBlock);
0377 
0378   iRegistry.watchPreModuleGlobalBeginRun(this, &Tracer::preModuleGlobalBeginRun);
0379   iRegistry.watchPostModuleGlobalBeginRun(this, &Tracer::postModuleGlobalBeginRun);
0380   iRegistry.watchPreModuleGlobalEndRun(this, &Tracer::preModuleGlobalEndRun);
0381   iRegistry.watchPostModuleGlobalEndRun(this, &Tracer::postModuleGlobalEndRun);
0382 
0383   iRegistry.watchPreModuleGlobalBeginLumi(this, &Tracer::preModuleGlobalBeginLumi);
0384   iRegistry.watchPostModuleGlobalBeginLumi(this, &Tracer::postModuleGlobalBeginLumi);
0385   iRegistry.watchPreModuleGlobalEndLumi(this, &Tracer::preModuleGlobalEndLumi);
0386   iRegistry.watchPostModuleGlobalEndLumi(this, &Tracer::postModuleGlobalEndLumi);
0387 
0388   iRegistry.watchPreModuleWriteProcessBlock(this, &Tracer::preModuleWriteProcessBlock);
0389   iRegistry.watchPostModuleWriteProcessBlock(this, &Tracer::postModuleWriteProcessBlock);
0390 
0391   iRegistry.watchPreModuleWriteRun(this, &Tracer::preModuleWriteRun);
0392   iRegistry.watchPostModuleWriteRun(this, &Tracer::postModuleWriteRun);
0393 
0394   iRegistry.watchPreModuleWriteLumi(this, &Tracer::preModuleWriteLumi);
0395   iRegistry.watchPostModuleWriteLumi(this, &Tracer::postModuleWriteLumi);
0396 
0397   iRegistry.watchPreSourceConstruction(this, &Tracer::preSourceConstruction);
0398   iRegistry.watchPostSourceConstruction(this, &Tracer::postSourceConstruction);
0399 
0400   iRegistry.watchPreESModulePrefetching(this, &Tracer::preESModulePrefetching);
0401   iRegistry.watchPostESModulePrefetching(this, &Tracer::postESModulePrefetching);
0402   iRegistry.watchPreESModule(this, &Tracer::preESModule);
0403   iRegistry.watchPostESModule(this, &Tracer::postESModule);
0404 
0405   iRegistry.preSourceEarlyTerminationSignal_.connect([this](edm::TerminationOrigin iOrigin) {
0406     LogAbsolute out("Tracer");
0407     out << TimeStamper(printTimestamps_);
0408     out << indention_ << indention_ << " early termination before processing transition";
0409   });
0410   iRegistry.preStreamEarlyTerminationSignal_.connect(
0411       [this](edm::StreamContext const& iContext, edm::TerminationOrigin iOrigin) {
0412         LogAbsolute out("Tracer");
0413         out << TimeStamper(printTimestamps_);
0414         if (iContext.eventID().luminosityBlock() == 0) {
0415           out << indention_ << indention_ << " early termination of run: stream = " << iContext.streamID()
0416               << " run = " << iContext.eventID().run();
0417         } else {
0418           if (iContext.eventID().event() == 0) {
0419             out << indention_ << indention_ << " early termination of stream lumi: stream = " << iContext.streamID()
0420                 << " run = " << iContext.eventID().run() << " lumi = " << iContext.eventID().luminosityBlock();
0421           } else {
0422             out << indention_ << indention_ << " early termination of event: stream = " << iContext.streamID()
0423                 << " run = " << iContext.eventID().run() << " lumi = " << iContext.eventID().luminosityBlock()
0424                 << " event = " << iContext.eventID().event();
0425           }
0426         }
0427         out << " : time = " << iContext.timestamp().value();
0428       });
0429   iRegistry.preGlobalEarlyTerminationSignal_.connect(
0430       [this](edm::GlobalContext const& iContext, edm::TerminationOrigin iOrigin) {
0431         LogAbsolute out("Tracer");
0432         out << TimeStamper(printTimestamps_);
0433         if (iContext.luminosityBlockID().value() == 0) {
0434           out << indention_ << indention_ << " early termination of global run " << iContext.luminosityBlockID().run();
0435         } else {
0436           out << indention_ << indention_
0437               << " early termination of global lumi run = " << iContext.luminosityBlockID().run()
0438               << " lumi = " << iContext.luminosityBlockID().luminosityBlock();
0439         }
0440         out << " : time = " << iContext.timestamp().value();
0441       });
0442 
0443   iRegistry.esSyncIOVQueuingSignal_.connect([this](edm::IOVSyncValue const& iSync) {
0444     LogAbsolute("Tracer") << TimeStamper(printTimestamps_) << indention_ << indention_
0445                           << " queuing: EventSetup synchronization " << iSync.eventID();
0446   });
0447   iRegistry.preESSyncIOVSignal_.connect([this](edm::IOVSyncValue const& iSync) {
0448     LogAbsolute("Tracer") << TimeStamper(printTimestamps_) << indention_ << indention_
0449                           << " pre: EventSetup synchronizing " << iSync.eventID();
0450   });
0451   iRegistry.postESSyncIOVSignal_.connect([this](edm::IOVSyncValue const& iSync) {
0452     LogAbsolute("Tracer") << TimeStamper(printTimestamps_) << indention_ << indention_
0453                           << " post: EventSetup synchronizing " << iSync.eventID();
0454   });
0455 }
0456 
0457 void Tracer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0458   edm::ParameterSetDescription desc;
0459   desc.addUntracked<std::string>("indention", "++")
0460       ->setComment("Prefix characters for output. The characters are repeated to form the indentation.");
0461   desc.addUntracked<std::vector<std::string>>("dumpContextForLabels", std::vector<std::string>{})
0462       ->setComment(
0463           "Prints context information to cout for the module transitions associated with these modules' labels");
0464   desc.addUntracked<bool>("dumpNonModuleContext", false)
0465       ->setComment("Prints context information to cout for the transitions not associated with any module label");
0466   desc.addUntracked<bool>("dumpPathsAndConsumes", false)
0467       ->setComment(
0468           "Prints information to cout about paths, endpaths, products consumed by modules and the dependencies between "
0469           "modules created by the products they consume");
0470   desc.addUntracked<bool>("printTimestamps", false)->setComment("Prints a time stamp for every transition");
0471   desc.addUntracked<bool>("dumpEventSetupInfo", false)
0472       ->setComment(
0473           "Prints info 3 times when an event setup cache is filled, before the lock, after the lock, and after "
0474           "filling");
0475   descriptions.add("Tracer", desc);
0476   descriptions.setComment(
0477       "This service prints each phase the framework is processing, e.g. constructing a module,running a module, etc.");
0478 }
0479 
0480 void Tracer::preallocate(service::SystemBounds const& bounds) {
0481   LogAbsolute("Tracer") << TimeStamper(printTimestamps_) << indention_
0482                         << " preallocate: " << bounds.maxNumberOfConcurrentRuns() << " concurrent runs, "
0483                         << bounds.maxNumberOfConcurrentLuminosityBlocks() << " concurrent luminosity sections, "
0484                         << bounds.maxNumberOfStreams() << " streams";
0485 }
0486 
0487 void Tracer::preBeginJob(PathsAndConsumesOfModulesBase const& pathsAndConsumes, ProcessContext const& pc) {
0488   LogAbsolute out("Tracer");
0489   out << TimeStamper(printTimestamps_) << indention_ << " starting: begin job";
0490   if (dumpPathsAndConsumes_) {
0491     out << "\n"
0492         << "Process name = " << pc.processName() << "\n";
0493     out << "paths:\n";
0494     std::vector<std::string> const& paths = pathsAndConsumes.paths();
0495     for (auto const& path : paths) {
0496       out << "  " << path << "\n";
0497     }
0498     out << "end paths:\n";
0499     std::vector<std::string> const& endpaths = pathsAndConsumes.endPaths();
0500     for (auto const& endpath : endpaths) {
0501       out << "  " << endpath << "\n";
0502     }
0503     for (unsigned int j = 0; j < paths.size(); ++j) {
0504       std::vector<ModuleDescription const*> const& modulesOnPath = pathsAndConsumes.modulesOnPath(j);
0505       out << "modules on path " << paths.at(j) << ":\n";
0506       for (auto const& desc : modulesOnPath) {
0507         out << "  " << desc->moduleLabel() << "\n";
0508       }
0509     }
0510     for (unsigned int j = 0; j < endpaths.size(); ++j) {
0511       std::vector<ModuleDescription const*> const& modulesOnEndPath = pathsAndConsumes.modulesOnEndPath(j);
0512       out << "modules on end path " << endpaths.at(j) << ":\n";
0513       for (auto const& desc : modulesOnEndPath) {
0514         out << "  " << desc->moduleLabel() << "\n";
0515       }
0516     }
0517     std::vector<ModuleDescription const*> const& allModules = pathsAndConsumes.allModules();
0518     out << "All modules and modules in the current process whose products they consume:\n";
0519     out << "(This does not include modules from previous processes or the source)\n";
0520     out << "(Exclusively considers Event products, not Run, Lumi, or ProcessBlock products)\n";
0521     for (auto const& module : allModules) {
0522       out << "  " << module->moduleName() << "/\'" << module->moduleLabel() << "\'";
0523       unsigned int moduleID = module->id();
0524       if (pathsAndConsumes.moduleDescription(moduleID) != module) {
0525         throw cms::Exception("TestFailure") << "Tracer::preBeginJob, moduleDescription returns incorrect value";
0526       }
0527       std::vector<ModuleDescription const*> const& modulesWhoseProductsAreConsumedBy =
0528           pathsAndConsumes.modulesWhoseProductsAreConsumedBy(moduleID);
0529       if (!modulesWhoseProductsAreConsumedBy.empty()) {
0530         out << " consumes products from these modules:\n";
0531         for (auto const& producingModule : modulesWhoseProductsAreConsumedBy) {
0532           out << "    " << producingModule->moduleName() << "/\'" << producingModule->moduleLabel() << "\'\n";
0533         }
0534       } else {
0535         out << "\n";
0536       }
0537     }
0538     out << "All modules (listed by class and label) and all their consumed products.\n";
0539     out << "Consumed products are listed by type, label, instance, process.\n";
0540     out << "For products not in the event, \'processBlock\', \'run\' or \'lumi\' is added to indicate the TTree they "
0541            "are from.\n";
0542     out << "For products that are declared with mayConsume, \'may consume\' is added.\n";
0543     out << "For products consumed for Views, \'element type\' is added\n";
0544     out << "For products only read from previous processes, \'skip current process\' is added\n";
0545     for (auto const* module : allModules) {
0546       out << "  " << module->moduleName() << "/\'" << module->moduleLabel() << "\'";
0547       std::vector<ConsumesInfo> consumesInfo = pathsAndConsumes.consumesInfo(module->id());
0548       if (!consumesInfo.empty()) {
0549         out << " consumes:\n";
0550         for (auto const& info : consumesInfo) {
0551           out << "    " << info.type() << " \'" << info.label() << "\' \'" << info.instance();
0552           out << "\' \'" << info.process() << "\'";
0553           if (info.branchType() == InLumi) {
0554             out << ", lumi";
0555           } else if (info.branchType() == InRun) {
0556             out << ", run";
0557           } else if (info.branchType() == InProcess) {
0558             out << ", processBlock";
0559           }
0560           if (!info.alwaysGets()) {
0561             out << ", may consume";
0562           }
0563           if (info.kindOfType() == ELEMENT_TYPE) {
0564             out << ", element type";
0565           }
0566           if (info.skipCurrentProcess()) {
0567             out << ", skip current process";
0568           }
0569           out << "\n";
0570         }
0571       } else {
0572         out << "\n";
0573       }
0574     }
0575   }
0576 }
0577 
0578 void Tracer::postBeginJob() {
0579   LogAbsolute("Tracer") << TimeStamper(printTimestamps_) << indention_ << " finished: begin job";
0580 }
0581 
0582 void Tracer::postEndJob() {
0583   LogAbsolute("Tracer") << TimeStamper(printTimestamps_) << indention_ << " finished: end job";
0584 }
0585 
0586 void Tracer::preSourceEvent(StreamID sid) {
0587   LogAbsolute("Tracer") << TimeStamper(printTimestamps_) << indention_ << indention_ << " starting: source event";
0588 }
0589 
0590 void Tracer::postSourceEvent(StreamID sid) {
0591   LogAbsolute("Tracer") << TimeStamper(printTimestamps_) << indention_ << indention_ << " finished: source event";
0592 }
0593 
0594 void Tracer::preSourceLumi(LuminosityBlockIndex index) {
0595   LogAbsolute("Tracer") << TimeStamper(printTimestamps_) << indention_ << indention_ << " starting: source lumi";
0596 }
0597 
0598 void Tracer::postSourceLumi(LuminosityBlockIndex index) {
0599   LogAbsolute("Tracer") << TimeStamper(printTimestamps_) << indention_ << indention_ << " finished: source lumi";
0600 }
0601 
0602 void Tracer::preSourceRun(RunIndex index) {
0603   LogAbsolute("Tracer") << TimeStamper(printTimestamps_) << indention_ << indention_ << " starting: source run";
0604 }
0605 
0606 void Tracer::postSourceRun(RunIndex index) {
0607   LogAbsolute("Tracer") << TimeStamper(printTimestamps_) << indention_ << indention_ << " finished: source run";
0608 }
0609 
0610 void Tracer::preSourceProcessBlock() {
0611   LogAbsolute("Tracer") << TimeStamper(printTimestamps_) << indention_ << indention_
0612                         << " starting: source process block";
0613 }
0614 
0615 void Tracer::postSourceProcessBlock(std::string const& processName) {
0616   LogAbsolute("Tracer") << TimeStamper(printTimestamps_) << indention_ << indention_
0617                         << " finished: source process block " << processName;
0618 }
0619 
0620 void Tracer::preOpenFile(std::string const& lfn) {
0621   LogAbsolute out("Tracer");
0622   out << TimeStamper(printTimestamps_);
0623   out << indention_ << indention_ << " starting: open input file: lfn = " << lfn;
0624 }
0625 
0626 void Tracer::postOpenFile(std::string const& lfn) {
0627   LogAbsolute out("Tracer");
0628   out << TimeStamper(printTimestamps_);
0629   out << indention_ << indention_ << " finished: open input file: lfn = " << lfn;
0630 }
0631 
0632 void Tracer::preCloseFile(std::string const& lfn) {
0633   LogAbsolute out("Tracer");
0634   out << TimeStamper(printTimestamps_);
0635   out << indention_ << indention_ << " starting: close input file: lfn = " << lfn;
0636 }
0637 void Tracer::postCloseFile(std::string const& lfn) {
0638   LogAbsolute out("Tracer");
0639   out << TimeStamper(printTimestamps_);
0640   out << indention_ << indention_ << " finished: close input file: lfn = " << lfn;
0641 }
0642 
0643 void Tracer::preModuleBeginStream(StreamContext const& sc, ModuleCallingContext const& mcc) {
0644   ModuleDescription const& desc = *mcc.moduleDescription();
0645   LogAbsolute out("Tracer");
0646   out << TimeStamper(printTimestamps_);
0647   out << indention_ << indention_ << " starting: begin stream for module: stream = " << sc.streamID() << " label = '"
0648       << desc.moduleLabel() << "' id = " << desc.id();
0649   if (dumpContextForLabels_.find(desc.moduleLabel()) != dumpContextForLabels_.end()) {
0650     out << "\n" << sc;
0651     out << mcc;
0652   }
0653 }
0654 
0655 void Tracer::postModuleBeginStream(StreamContext const& sc, ModuleCallingContext const& mcc) {
0656   ModuleDescription const& desc = *mcc.moduleDescription();
0657   LogAbsolute out("Tracer");
0658   out << TimeStamper(printTimestamps_);
0659   out << indention_ << indention_ << " finished: begin stream for module: stream = " << sc.streamID() << " label = '"
0660       << desc.moduleLabel() << "' id = " << desc.id();
0661   if (dumpContextForLabels_.find(desc.moduleLabel()) != dumpContextForLabels_.end()) {
0662     out << "\n" << sc;
0663     out << mcc;
0664   }
0665 }
0666 
0667 void Tracer::preModuleEndStream(StreamContext const& sc, ModuleCallingContext const& mcc) {
0668   ModuleDescription const& desc = *mcc.moduleDescription();
0669   LogAbsolute out("Tracer");
0670   out << TimeStamper(printTimestamps_);
0671   out << indention_ << indention_ << " starting: end stream for module: stream = " << sc.streamID() << " label = '"
0672       << desc.moduleLabel() << "' id = " << desc.id();
0673   if (dumpContextForLabels_.find(desc.moduleLabel()) != dumpContextForLabels_.end()) {
0674     out << "\n" << sc;
0675     out << mcc;
0676   }
0677 }
0678 
0679 void Tracer::postModuleEndStream(StreamContext const& sc, ModuleCallingContext const& mcc) {
0680   ModuleDescription const& desc = *mcc.moduleDescription();
0681   LogAbsolute out("Tracer");
0682   out << TimeStamper(printTimestamps_);
0683   out << indention_ << indention_ << " finished: end stream for module: stream = " << sc.streamID() << " label = '"
0684       << desc.moduleLabel() << "' id = " << desc.id();
0685   if (dumpContextForLabels_.find(desc.moduleLabel()) != dumpContextForLabels_.end()) {
0686     out << "\n" << sc;
0687     out << mcc;
0688   }
0689 }
0690 
0691 void Tracer::preBeginProcessBlock(GlobalContext const& gc) {
0692   LogAbsolute out("Tracer");
0693   out << indention_ << indention_ << " starting: begin process block";
0694   if (dumpNonModuleContext_) {
0695     out << "\n" << gc;
0696   }
0697 }
0698 
0699 void Tracer::postBeginProcessBlock(GlobalContext const& gc) {
0700   LogAbsolute out("Tracer");
0701   out << indention_ << indention_ << " finished: begin process block";
0702   if (dumpNonModuleContext_) {
0703     out << "\n" << gc;
0704   }
0705 }
0706 
0707 void Tracer::preAccessInputProcessBlock(GlobalContext const& gc) {
0708   LogAbsolute out("Tracer");
0709   out << indention_ << indention_ << " starting: access input process block";
0710   if (dumpNonModuleContext_) {
0711     out << "\n" << gc;
0712   }
0713 }
0714 
0715 void Tracer::postAccessInputProcessBlock(GlobalContext const& gc) {
0716   LogAbsolute out("Tracer");
0717   out << indention_ << indention_ << " finished: access input process block";
0718   if (dumpNonModuleContext_) {
0719     out << "\n" << gc;
0720   }
0721 }
0722 
0723 void Tracer::preEndProcessBlock(GlobalContext const& gc) {
0724   LogAbsolute out("Tracer");
0725   out << indention_ << indention_ << " starting: end process block";
0726   if (dumpNonModuleContext_) {
0727     out << "\n" << gc;
0728   }
0729 }
0730 
0731 void Tracer::postEndProcessBlock(GlobalContext const& gc) {
0732   LogAbsolute out("Tracer");
0733   out << indention_ << indention_ << " finished: end process block";
0734   if (dumpNonModuleContext_) {
0735     out << "\n" << gc;
0736   }
0737 }
0738 
0739 void Tracer::preWriteProcessBlock(GlobalContext const& gc) {
0740   LogAbsolute out("Tracer");
0741   out << indention_ << indention_ << " starting: write process block";
0742   if (dumpNonModuleContext_) {
0743     out << "\n" << gc;
0744   }
0745 }
0746 
0747 void Tracer::postWriteProcessBlock(GlobalContext const& gc) {
0748   LogAbsolute out("Tracer");
0749   out << indention_ << indention_ << " finished: write process block";
0750   if (dumpNonModuleContext_) {
0751     out << "\n" << gc;
0752   }
0753 }
0754 
0755 void Tracer::preGlobalBeginRun(GlobalContext const& gc) {
0756   LogAbsolute out("Tracer");
0757   out << TimeStamper(printTimestamps_);
0758   out << indention_ << indention_ << " starting: global begin run " << gc.luminosityBlockID().run()
0759       << " : time = " << gc.timestamp().value();
0760   if (dumpNonModuleContext_) {
0761     out << "\n" << gc;
0762   }
0763 }
0764 
0765 void Tracer::postGlobalBeginRun(GlobalContext const& gc) {
0766   LogAbsolute out("Tracer");
0767   out << TimeStamper(printTimestamps_);
0768   out << indention_ << indention_ << " finished: global begin run " << gc.luminosityBlockID().run()
0769       << " : time = " << gc.timestamp().value();
0770   if (dumpNonModuleContext_) {
0771     out << "\n" << gc;
0772   }
0773 }
0774 
0775 void Tracer::preGlobalEndRun(GlobalContext const& gc) {
0776   LogAbsolute out("Tracer");
0777   out << TimeStamper(printTimestamps_);
0778   out << indention_ << indention_ << " starting: global end run " << gc.luminosityBlockID().run()
0779       << " : time = " << gc.timestamp().value();
0780   if (dumpNonModuleContext_) {
0781     out << "\n" << gc;
0782   }
0783 }
0784 
0785 void Tracer::postGlobalEndRun(GlobalContext const& gc) {
0786   LogAbsolute out("Tracer");
0787   out << TimeStamper(printTimestamps_);
0788   out << indention_ << indention_ << " finished: global end run " << gc.luminosityBlockID().run()
0789       << " : time = " << gc.timestamp().value();
0790   if (dumpNonModuleContext_) {
0791     out << "\n" << gc;
0792   }
0793 }
0794 
0795 void Tracer::preGlobalWriteRun(GlobalContext const& gc) {
0796   LogAbsolute out("Tracer");
0797   out << TimeStamper(printTimestamps_);
0798   out << indention_ << indention_ << " starting: global write run " << gc.luminosityBlockID().run()
0799       << " : time = " << gc.timestamp().value();
0800   if (dumpNonModuleContext_) {
0801     out << "\n" << gc;
0802   }
0803 }
0804 
0805 void Tracer::postGlobalWriteRun(GlobalContext const& gc) {
0806   LogAbsolute out("Tracer");
0807   out << TimeStamper(printTimestamps_);
0808   out << indention_ << indention_ << " finished: global write run " << gc.luminosityBlockID().run()
0809       << " : time = " << gc.timestamp().value();
0810   if (dumpNonModuleContext_) {
0811     out << "\n" << gc;
0812   }
0813 }
0814 
0815 void Tracer::preStreamBeginRun(StreamContext const& sc) {
0816   LogAbsolute out("Tracer");
0817   out << TimeStamper(printTimestamps_);
0818   out << indention_ << indention_ << " starting: begin run: stream = " << sc.streamID()
0819       << " run = " << sc.eventID().run() << " time = " << sc.timestamp().value();
0820   if (dumpNonModuleContext_) {
0821     out << "\n" << sc;
0822   }
0823 }
0824 
0825 void Tracer::postStreamBeginRun(StreamContext const& sc) {
0826   LogAbsolute out("Tracer");
0827   out << TimeStamper(printTimestamps_);
0828   out << indention_ << indention_ << " finished: begin run: stream = " << sc.streamID()
0829       << " run = " << sc.eventID().run() << " time = " << sc.timestamp().value();
0830   if (dumpNonModuleContext_) {
0831     out << "\n" << sc;
0832   }
0833 }
0834 
0835 void Tracer::preStreamEndRun(StreamContext const& sc) {
0836   LogAbsolute out("Tracer");
0837   out << TimeStamper(printTimestamps_);
0838   out << indention_ << indention_ << " starting: end run: stream = " << sc.streamID() << " run = " << sc.eventID().run()
0839       << " time = " << sc.timestamp().value();
0840   if (dumpNonModuleContext_) {
0841     out << "\n" << sc;
0842   }
0843 }
0844 
0845 void Tracer::postStreamEndRun(StreamContext const& sc) {
0846   LogAbsolute out("Tracer");
0847   out << TimeStamper(printTimestamps_);
0848   out << indention_ << indention_ << " finished: end run: stream = " << sc.streamID() << " run = " << sc.eventID().run()
0849       << " time = " << sc.timestamp().value();
0850   if (dumpNonModuleContext_) {
0851     out << "\n" << sc;
0852   }
0853 }
0854 
0855 void Tracer::preGlobalBeginLumi(GlobalContext const& gc) {
0856   LogAbsolute out("Tracer");
0857   out << TimeStamper(printTimestamps_);
0858   out << indention_ << indention_ << " starting: global begin lumi: run = " << gc.luminosityBlockID().run()
0859       << " lumi = " << gc.luminosityBlockID().luminosityBlock() << " time = " << gc.timestamp().value();
0860   if (dumpNonModuleContext_) {
0861     out << "\n" << gc;
0862   }
0863 }
0864 
0865 void Tracer::postGlobalBeginLumi(GlobalContext const& gc) {
0866   LogAbsolute out("Tracer");
0867   out << TimeStamper(printTimestamps_);
0868   out << indention_ << indention_ << " finished: global begin lumi: run = " << gc.luminosityBlockID().run()
0869       << " lumi = " << gc.luminosityBlockID().luminosityBlock() << " time = " << gc.timestamp().value();
0870   if (dumpNonModuleContext_) {
0871     out << "\n" << gc;
0872   }
0873 }
0874 
0875 void Tracer::preGlobalEndLumi(GlobalContext const& gc) {
0876   LogAbsolute out("Tracer");
0877   out << TimeStamper(printTimestamps_);
0878   out << indention_ << indention_ << " starting: global end lumi: run = " << gc.luminosityBlockID().run()
0879       << " lumi = " << gc.luminosityBlockID().luminosityBlock() << " time = " << gc.timestamp().value();
0880   if (dumpNonModuleContext_) {
0881     out << "\n" << gc;
0882   }
0883 }
0884 
0885 void Tracer::postGlobalEndLumi(GlobalContext const& gc) {
0886   LogAbsolute out("Tracer");
0887   out << TimeStamper(printTimestamps_);
0888   out << indention_ << indention_ << " finished: global end lumi: run = " << gc.luminosityBlockID().run()
0889       << " lumi = " << gc.luminosityBlockID().luminosityBlock() << " time = " << gc.timestamp().value();
0890   if (dumpNonModuleContext_) {
0891     out << "\n" << gc;
0892   }
0893 }
0894 
0895 void Tracer::preGlobalWriteLumi(GlobalContext const& gc) {
0896   LogAbsolute out("Tracer");
0897   out << TimeStamper(printTimestamps_);
0898   out << indention_ << indention_ << " starting: global write lumi: run = " << gc.luminosityBlockID().run()
0899       << " lumi = " << gc.luminosityBlockID().luminosityBlock() << " time = " << gc.timestamp().value();
0900   if (dumpNonModuleContext_) {
0901     out << "\n" << gc;
0902   }
0903 }
0904 
0905 void Tracer::postGlobalWriteLumi(GlobalContext const& gc) {
0906   LogAbsolute out("Tracer");
0907   out << TimeStamper(printTimestamps_);
0908   out << indention_ << indention_ << " finished: global write lumi: run = " << gc.luminosityBlockID().run()
0909       << " lumi = " << gc.luminosityBlockID().luminosityBlock() << " time = " << gc.timestamp().value();
0910   if (dumpNonModuleContext_) {
0911     out << "\n" << gc;
0912   }
0913 }
0914 
0915 void Tracer::preStreamBeginLumi(StreamContext const& sc) {
0916   LogAbsolute out("Tracer");
0917   out << TimeStamper(printTimestamps_);
0918   out << indention_ << indention_ << " starting: begin lumi: stream = " << sc.streamID()
0919       << " run = " << sc.eventID().run() << " lumi = " << sc.eventID().luminosityBlock()
0920       << " time = " << sc.timestamp().value();
0921   if (dumpNonModuleContext_) {
0922     out << "\n" << sc;
0923   }
0924 }
0925 
0926 void Tracer::postStreamBeginLumi(StreamContext const& sc) {
0927   LogAbsolute out("Tracer");
0928   out << TimeStamper(printTimestamps_);
0929   out << indention_ << indention_ << " finished: begin lumi: stream = " << sc.streamID()
0930       << " run = " << sc.eventID().run() << " lumi = " << sc.eventID().luminosityBlock()
0931       << " time = " << sc.timestamp().value();
0932   if (dumpNonModuleContext_) {
0933     out << "\n" << sc;
0934   }
0935 }
0936 
0937 void Tracer::preStreamEndLumi(StreamContext const& sc) {
0938   LogAbsolute out("Tracer");
0939   out << TimeStamper(printTimestamps_);
0940   out << indention_ << indention_ << " starting: end lumi: stream = " << sc.streamID()
0941       << " run = " << sc.eventID().run() << " lumi = " << sc.eventID().luminosityBlock()
0942       << " time = " << sc.timestamp().value();
0943   if (dumpNonModuleContext_) {
0944     out << "\n" << sc;
0945   }
0946 }
0947 
0948 void Tracer::postStreamEndLumi(StreamContext const& sc) {
0949   LogAbsolute out("Tracer");
0950   out << TimeStamper(printTimestamps_);
0951   out << indention_ << indention_ << " finished: end lumi: stream = " << sc.streamID()
0952       << " run = " << sc.eventID().run() << " lumi = " << sc.eventID().luminosityBlock()
0953       << " time = " << sc.timestamp().value();
0954   if (dumpNonModuleContext_) {
0955     out << "\n" << sc;
0956   }
0957 }
0958 
0959 void Tracer::preEvent(StreamContext const& sc) {
0960   LogAbsolute out("Tracer");
0961   out << TimeStamper(printTimestamps_);
0962   out << indention_ << indention_ << " starting: processing event : stream = " << sc.streamID()
0963       << " run = " << sc.eventID().run() << " lumi = " << sc.eventID().luminosityBlock()
0964       << " event = " << sc.eventID().event() << " time = " << sc.timestamp().value();
0965   if (dumpNonModuleContext_) {
0966     out << "\n" << sc;
0967   }
0968 }
0969 
0970 void Tracer::postEvent(StreamContext const& sc) {
0971   LogAbsolute out("Tracer");
0972   out << TimeStamper(printTimestamps_);
0973   out << indention_ << indention_ << " finished: processing event : stream = " << sc.streamID()
0974       << " run = " << sc.eventID().run() << " lumi = " << sc.eventID().luminosityBlock()
0975       << " event = " << sc.eventID().event() << " time = " << sc.timestamp().value();
0976   if (dumpNonModuleContext_) {
0977     out << "\n" << sc;
0978   }
0979 }
0980 
0981 void Tracer::prePathEvent(StreamContext const& sc, PathContext const& pc) {
0982   LogAbsolute out("Tracer");
0983   out << TimeStamper(printTimestamps_);
0984   out << indention_ << indention_ << indention_ << " starting: processing path '" << pc.pathName()
0985       << "' : stream = " << sc.streamID();
0986   if (dumpNonModuleContext_) {
0987     out << "\n" << sc;
0988     out << pc;
0989   }
0990 }
0991 
0992 void Tracer::postPathEvent(StreamContext const& sc, PathContext const& pc, HLTPathStatus const& hlts) {
0993   LogAbsolute out("Tracer");
0994   out << TimeStamper(printTimestamps_);
0995   out << indention_ << indention_ << indention_ << " finished: processing path '" << pc.pathName()
0996       << "' : stream = " << sc.streamID();
0997   if (dumpNonModuleContext_) {
0998     out << "\n" << sc;
0999     out << pc;
1000   }
1001 }
1002 
1003 void Tracer::preModuleConstruction(ModuleDescription const& desc) {
1004   LogAbsolute out("Tracer");
1005   out << TimeStamper(printTimestamps_);
1006   out << indention_ << indention_ << " starting: constructing module with label '" << desc.moduleLabel()
1007       << "' id = " << desc.id();
1008   if (dumpContextForLabels_.find(desc.moduleLabel()) != dumpContextForLabels_.end()) {
1009     out << "\n" << desc;
1010   }
1011 }
1012 
1013 void Tracer::postModuleConstruction(ModuleDescription const& desc) {
1014   LogAbsolute out("Tracer");
1015   out << TimeStamper(printTimestamps_);
1016   out << indention_ << indention_ << " finished: constructing module with label '" << desc.moduleLabel()
1017       << "' id = " << desc.id();
1018   if (dumpContextForLabels_.find(desc.moduleLabel()) != dumpContextForLabels_.end()) {
1019     out << "\n" << desc;
1020   }
1021 }
1022 
1023 void Tracer::preModuleDestruction(ModuleDescription const& desc) {
1024   LogAbsolute out("Tracer");
1025   out << TimeStamper(printTimestamps_);
1026   out << indention_ << indention_ << " starting: destructing module with label '" << desc.moduleLabel()
1027       << "' id = " << desc.id();
1028   if (dumpContextForLabels_.find(desc.moduleLabel()) != dumpContextForLabels_.end()) {
1029     out << "\n" << desc;
1030   }
1031 }
1032 
1033 void Tracer::postModuleDestruction(ModuleDescription const& desc) {
1034   LogAbsolute out("Tracer");
1035   out << TimeStamper(printTimestamps_);
1036   out << indention_ << indention_ << " finished: destructing module with label '" << desc.moduleLabel()
1037       << "' id = " << desc.id();
1038   if (dumpContextForLabels_.find(desc.moduleLabel()) != dumpContextForLabels_.end()) {
1039     out << "\n" << desc;
1040   }
1041 }
1042 
1043 void Tracer::preModuleBeginJob(ModuleDescription const& desc) {
1044   LogAbsolute out("Tracer");
1045   out << TimeStamper(printTimestamps_);
1046   out << indention_ << indention_;
1047   out << " starting: begin job for module with label '" << desc.moduleLabel() << "' id = " << desc.id();
1048   if (dumpContextForLabels_.find(desc.moduleLabel()) != dumpContextForLabels_.end()) {
1049     out << "\n" << desc;
1050   }
1051 }
1052 
1053 void Tracer::postModuleBeginJob(ModuleDescription const& desc) {
1054   LogAbsolute out("Tracer");
1055   out << TimeStamper(printTimestamps_);
1056   out << indention_ << indention_;
1057   out << " finished: begin job for module with label '" << desc.moduleLabel() << "' id = " << desc.id();
1058   if (dumpContextForLabels_.find(desc.moduleLabel()) != dumpContextForLabels_.end()) {
1059     out << "\n" << desc;
1060   }
1061 }
1062 
1063 void Tracer::preModuleEndJob(ModuleDescription const& desc) {
1064   LogAbsolute out("Tracer");
1065   out << TimeStamper(printTimestamps_);
1066   out << indention_ << indention_;
1067   out << " starting: end job for module with label '" << desc.moduleLabel() << "' id = " << desc.id();
1068   if (dumpContextForLabels_.find(desc.moduleLabel()) != dumpContextForLabels_.end()) {
1069     out << "\n" << desc;
1070   }
1071 }
1072 
1073 void Tracer::postModuleEndJob(ModuleDescription const& desc) {
1074   LogAbsolute out("Tracer");
1075   out << TimeStamper(printTimestamps_);
1076   out << indention_ << indention_;
1077   out << " finished: end job for module with label '" << desc.moduleLabel() << "' id = " << desc.id();
1078   if (dumpContextForLabels_.find(desc.moduleLabel()) != dumpContextForLabels_.end()) {
1079     out << "\n" << desc;
1080   }
1081 }
1082 
1083 void Tracer::preModuleEventPrefetching(StreamContext const& sc, ModuleCallingContext const& mcc) {
1084   LogAbsolute out("Tracer");
1085   out << TimeStamper(printTimestamps_);
1086   unsigned int nIndents = mcc.depth() + 4;
1087   for (unsigned int i = 0; i < nIndents; ++i) {
1088     out << indention_;
1089   }
1090   out << " starting: prefetching before processing event for module: stream = " << sc.streamID() << " label = '"
1091       << mcc.moduleDescription()->moduleLabel() << "' id = " << mcc.moduleDescription()->id();
1092   if (dumpContextForLabels_.find(mcc.moduleDescription()->moduleLabel()) != dumpContextForLabels_.end()) {
1093     out << "\n" << sc;
1094     out << mcc;
1095   }
1096 }
1097 
1098 void Tracer::postModuleEventPrefetching(StreamContext const& sc, ModuleCallingContext const& mcc) {
1099   LogAbsolute out("Tracer");
1100   out << TimeStamper(printTimestamps_);
1101   unsigned int nIndents = mcc.depth() + 4;
1102   for (unsigned int i = 0; i < nIndents; ++i) {
1103     out << indention_;
1104   }
1105   out << " finished: prefetching before processing event for module: stream = " << sc.streamID() << " label = '"
1106       << mcc.moduleDescription()->moduleLabel() << "' id = " << mcc.moduleDescription()->id();
1107   if (dumpContextForLabels_.find(mcc.moduleDescription()->moduleLabel()) != dumpContextForLabels_.end()) {
1108     out << "\n" << sc;
1109     out << mcc;
1110   }
1111 }
1112 
1113 void Tracer::preModuleEvent(StreamContext const& sc, ModuleCallingContext const& mcc) {
1114   LogAbsolute out("Tracer");
1115   out << TimeStamper(printTimestamps_);
1116   unsigned int nIndents = mcc.depth() + 4;
1117   for (unsigned int i = 0; i < nIndents; ++i) {
1118     out << indention_;
1119   }
1120   out << " starting: processing event for module: stream = " << sc.streamID() << " label = '"
1121       << mcc.moduleDescription()->moduleLabel() << "' id = " << mcc.moduleDescription()->id();
1122   if (dumpContextForLabels_.find(mcc.moduleDescription()->moduleLabel()) != dumpContextForLabels_.end()) {
1123     out << "\n" << sc;
1124     out << mcc;
1125   }
1126 }
1127 
1128 void Tracer::postModuleEvent(StreamContext const& sc, ModuleCallingContext const& mcc) {
1129   LogAbsolute out("Tracer");
1130   out << TimeStamper(printTimestamps_);
1131   unsigned int nIndents = mcc.depth() + 4;
1132   for (unsigned int i = 0; i < nIndents; ++i) {
1133     out << indention_;
1134   }
1135   out << " finished: processing event for module: stream = " << sc.streamID() << " label = '"
1136       << mcc.moduleDescription()->moduleLabel() << "' id = " << mcc.moduleDescription()->id();
1137   if (dumpContextForLabels_.find(mcc.moduleDescription()->moduleLabel()) != dumpContextForLabels_.end()) {
1138     out << "\n" << sc;
1139     out << mcc;
1140   }
1141 }
1142 
1143 void Tracer::preModuleEventAcquire(StreamContext const& sc, ModuleCallingContext const& mcc) {
1144   LogAbsolute out("Tracer");
1145   out << TimeStamper(printTimestamps_);
1146   unsigned int nIndents = mcc.depth() + 4;
1147   for (unsigned int i = 0; i < nIndents; ++i) {
1148     out << indention_;
1149   }
1150   out << " starting: processing event acquire for module: stream = " << sc.streamID() << " label = '"
1151       << mcc.moduleDescription()->moduleLabel() << "' id = " << mcc.moduleDescription()->id();
1152 }
1153 
1154 void Tracer::postModuleEventAcquire(StreamContext const& sc, ModuleCallingContext const& mcc) {
1155   LogAbsolute out("Tracer");
1156   out << TimeStamper(printTimestamps_);
1157   unsigned int nIndents = mcc.depth() + 4;
1158   for (unsigned int i = 0; i < nIndents; ++i) {
1159     out << indention_;
1160   }
1161   out << " finished: processing event acquire for module: stream = " << sc.streamID() << " label = '"
1162       << mcc.moduleDescription()->moduleLabel() << "' id = " << mcc.moduleDescription()->id();
1163 }
1164 
1165 void Tracer::preModuleEventDelayedGet(StreamContext const& sc, ModuleCallingContext const& mcc) {
1166   LogAbsolute out("Tracer");
1167   out << TimeStamper(printTimestamps_);
1168   unsigned int nIndents = mcc.depth() + 4;
1169   for (unsigned int i = 0; i < nIndents; ++i) {
1170     out << indention_;
1171   }
1172   out << " starting: delayed processing event for module: stream = " << sc.streamID() << " label = '"
1173       << mcc.moduleDescription()->moduleLabel() << "' id = " << mcc.moduleDescription()->id();
1174   if (dumpContextForLabels_.find(mcc.moduleDescription()->moduleLabel()) != dumpContextForLabels_.end()) {
1175     out << "\n" << sc;
1176     out << mcc;
1177   }
1178 }
1179 
1180 void Tracer::postModuleEventDelayedGet(StreamContext const& sc, ModuleCallingContext const& mcc) {
1181   LogAbsolute out("Tracer");
1182   out << TimeStamper(printTimestamps_);
1183   unsigned int nIndents = mcc.depth() + 4;
1184   for (unsigned int i = 0; i < nIndents; ++i) {
1185     out << indention_;
1186   }
1187   out << " finished: delayed processing event for module: stream = " << sc.streamID() << " label = '"
1188       << mcc.moduleDescription()->moduleLabel() << "' id = " << mcc.moduleDescription()->id();
1189   if (dumpContextForLabels_.find(mcc.moduleDescription()->moduleLabel()) != dumpContextForLabels_.end()) {
1190     out << "\n" << sc;
1191     out << mcc;
1192   }
1193 }
1194 
1195 void Tracer::preEventReadFromSource(StreamContext const& sc, ModuleCallingContext const& mcc) {
1196   LogAbsolute out("Tracer");
1197   out << TimeStamper(printTimestamps_);
1198   unsigned int nIndents = mcc.depth() + 5;
1199   for (unsigned int i = 0; i < nIndents; ++i) {
1200     out << indention_;
1201   }
1202   out << " starting: event delayed read from source: stream = " << sc.streamID() << " label = '"
1203       << mcc.moduleDescription()->moduleLabel() << "' id = " << mcc.moduleDescription()->id();
1204 }
1205 
1206 void Tracer::postEventReadFromSource(StreamContext const& sc, ModuleCallingContext const& mcc) {
1207   LogAbsolute out("Tracer");
1208   out << TimeStamper(printTimestamps_);
1209   unsigned int nIndents = mcc.depth() + 5;
1210   for (unsigned int i = 0; i < nIndents; ++i) {
1211     out << indention_;
1212   }
1213   out << " finished: event delayed read from source: stream = " << sc.streamID() << " label = '"
1214       << mcc.moduleDescription()->moduleLabel() << "' id = " << mcc.moduleDescription()->id();
1215 }
1216 
1217 void Tracer::preModuleStreamBeginRun(StreamContext const& sc, ModuleCallingContext const& mcc) {
1218   LogAbsolute out("Tracer");
1219   out << TimeStamper(printTimestamps_);
1220   unsigned int nIndents = mcc.depth() + 3;
1221   for (unsigned int i = 0; i < nIndents; ++i) {
1222     out << indention_;
1223   }
1224   out << " starting: begin run for module: stream = " << sc.streamID() << " label = '"
1225       << mcc.moduleDescription()->moduleLabel() << "' id = " << mcc.moduleDescription()->id();
1226   if (dumpContextForLabels_.find(mcc.moduleDescription()->moduleLabel()) != dumpContextForLabels_.end()) {
1227     out << "\n" << sc;
1228     out << mcc;
1229   }
1230 }
1231 
1232 void Tracer::postModuleStreamBeginRun(StreamContext const& sc, ModuleCallingContext const& mcc) {
1233   LogAbsolute out("Tracer");
1234   out << TimeStamper(printTimestamps_);
1235   unsigned int nIndents = mcc.depth() + 3;
1236   for (unsigned int i = 0; i < nIndents; ++i) {
1237     out << indention_;
1238   }
1239   out << " finished: begin run for module: stream = " << sc.streamID() << " label = '"
1240       << mcc.moduleDescription()->moduleLabel() << "' id = " << mcc.moduleDescription()->id();
1241   if (dumpContextForLabels_.find(mcc.moduleDescription()->moduleLabel()) != dumpContextForLabels_.end()) {
1242     out << "\n" << sc;
1243     out << mcc;
1244   }
1245 }
1246 
1247 void Tracer::preModuleStreamEndRun(StreamContext const& sc, ModuleCallingContext const& mcc) {
1248   LogAbsolute out("Tracer");
1249   out << TimeStamper(printTimestamps_);
1250   unsigned int nIndents = mcc.depth() + 3;
1251   for (unsigned int i = 0; i < nIndents; ++i) {
1252     out << indention_;
1253   }
1254   out << " starting: end run for module: stream = " << sc.streamID() << " label = '"
1255       << mcc.moduleDescription()->moduleLabel() << "' id = " << mcc.moduleDescription()->id();
1256   if (dumpContextForLabels_.find(mcc.moduleDescription()->moduleLabel()) != dumpContextForLabels_.end()) {
1257     out << "\n" << sc;
1258     out << mcc;
1259   }
1260 }
1261 
1262 void Tracer::postModuleStreamEndRun(StreamContext const& sc, ModuleCallingContext const& mcc) {
1263   LogAbsolute out("Tracer");
1264   out << TimeStamper(printTimestamps_);
1265   unsigned int nIndents = mcc.depth() + 3;
1266   for (unsigned int i = 0; i < nIndents; ++i) {
1267     out << indention_;
1268   }
1269   out << " finished: end run for module: stream = " << sc.streamID() << " label = '"
1270       << mcc.moduleDescription()->moduleLabel() << "' id = " << mcc.moduleDescription()->id();
1271   if (dumpContextForLabels_.find(mcc.moduleDescription()->moduleLabel()) != dumpContextForLabels_.end()) {
1272     out << "\n" << sc;
1273     out << mcc;
1274   }
1275 }
1276 
1277 void Tracer::preModuleStreamBeginLumi(StreamContext const& sc, ModuleCallingContext const& mcc) {
1278   LogAbsolute out("Tracer");
1279   out << TimeStamper(printTimestamps_);
1280   unsigned int nIndents = mcc.depth() + 3;
1281   for (unsigned int i = 0; i < nIndents; ++i) {
1282     out << indention_;
1283   }
1284   out << " starting: begin lumi for module: stream = " << sc.streamID() << " label = '"
1285       << mcc.moduleDescription()->moduleLabel() << "' id = " << mcc.moduleDescription()->id();
1286   if (dumpContextForLabels_.find(mcc.moduleDescription()->moduleLabel()) != dumpContextForLabels_.end()) {
1287     out << "\n" << sc;
1288     out << mcc;
1289   }
1290 }
1291 
1292 void Tracer::postModuleStreamBeginLumi(StreamContext const& sc, ModuleCallingContext const& mcc) {
1293   LogAbsolute out("Tracer");
1294   out << TimeStamper(printTimestamps_);
1295   unsigned int nIndents = mcc.depth() + 3;
1296   for (unsigned int i = 0; i < nIndents; ++i) {
1297     out << indention_;
1298   }
1299   out << " finished: begin lumi for module: stream = " << sc.streamID() << " label = '"
1300       << mcc.moduleDescription()->moduleLabel() << "' id = " << mcc.moduleDescription()->id();
1301   if (dumpContextForLabels_.find(mcc.moduleDescription()->moduleLabel()) != dumpContextForLabels_.end()) {
1302     out << "\n" << sc;
1303     out << mcc;
1304   }
1305 }
1306 
1307 void Tracer::preModuleStreamEndLumi(StreamContext const& sc, ModuleCallingContext const& mcc) {
1308   LogAbsolute out("Tracer");
1309   out << TimeStamper(printTimestamps_);
1310   unsigned int nIndents = mcc.depth() + 3;
1311   for (unsigned int i = 0; i < nIndents; ++i) {
1312     out << indention_;
1313   }
1314   out << " starting: end lumi for module: stream = " << sc.streamID() << " label = '"
1315       << mcc.moduleDescription()->moduleLabel() << "' id = " << mcc.moduleDescription()->id();
1316   if (dumpContextForLabels_.find(mcc.moduleDescription()->moduleLabel()) != dumpContextForLabels_.end()) {
1317     out << "\n" << sc;
1318     out << mcc;
1319   }
1320 }
1321 
1322 void Tracer::postModuleStreamEndLumi(StreamContext const& sc, ModuleCallingContext const& mcc) {
1323   LogAbsolute out("Tracer");
1324   out << TimeStamper(printTimestamps_);
1325   unsigned int nIndents = mcc.depth() + 3;
1326   for (unsigned int i = 0; i < nIndents; ++i) {
1327     out << indention_;
1328   }
1329   out << " finished: end lumi for module: stream = " << sc.streamID() << " label = '"
1330       << mcc.moduleDescription()->moduleLabel() << "' id = " << mcc.moduleDescription()->id();
1331   if (dumpContextForLabels_.find(mcc.moduleDescription()->moduleLabel()) != dumpContextForLabels_.end()) {
1332     out << "\n" << sc;
1333     out << mcc;
1334   }
1335 }
1336 
1337 void Tracer::preModuleBeginProcessBlock(GlobalContext const& gc, ModuleCallingContext const& mcc) {
1338   LogAbsolute out("Tracer");
1339   unsigned int nIndents = mcc.depth() + 3;
1340   for (unsigned int i = 0; i < nIndents; ++i) {
1341     out << indention_;
1342   }
1343   out << " starting: begin process block for module: label = '" << mcc.moduleDescription()->moduleLabel()
1344       << "' id = " << mcc.moduleDescription()->id();
1345   if (dumpContextForLabels_.find(mcc.moduleDescription()->moduleLabel()) != dumpContextForLabels_.end()) {
1346     out << "\n" << gc;
1347     out << mcc;
1348   }
1349 }
1350 
1351 void Tracer::postModuleBeginProcessBlock(GlobalContext const& gc, ModuleCallingContext const& mcc) {
1352   LogAbsolute out("Tracer");
1353   unsigned int nIndents = mcc.depth() + 3;
1354   for (unsigned int i = 0; i < nIndents; ++i) {
1355     out << indention_;
1356   }
1357   out << " finished: begin process block for module: label = '" << mcc.moduleDescription()->moduleLabel()
1358       << "' id = " << mcc.moduleDescription()->id();
1359   if (dumpContextForLabels_.find(mcc.moduleDescription()->moduleLabel()) != dumpContextForLabels_.end()) {
1360     out << "\n" << gc;
1361     out << mcc;
1362   }
1363 }
1364 
1365 void Tracer::preModuleAccessInputProcessBlock(GlobalContext const& gc, ModuleCallingContext const& mcc) {
1366   LogAbsolute out("Tracer");
1367   unsigned int nIndents = mcc.depth() + 3;
1368   for (unsigned int i = 0; i < nIndents; ++i) {
1369     out << indention_;
1370   }
1371   out << " starting: access input process block for module: label = '" << mcc.moduleDescription()->moduleLabel()
1372       << "' id = " << mcc.moduleDescription()->id();
1373   if (dumpContextForLabels_.find(mcc.moduleDescription()->moduleLabel()) != dumpContextForLabels_.end()) {
1374     out << "\n" << gc;
1375     out << mcc;
1376   }
1377 }
1378 
1379 void Tracer::postModuleAccessInputProcessBlock(GlobalContext const& gc, ModuleCallingContext const& mcc) {
1380   LogAbsolute out("Tracer");
1381   unsigned int nIndents = mcc.depth() + 3;
1382   for (unsigned int i = 0; i < nIndents; ++i) {
1383     out << indention_;
1384   }
1385   out << " finished: access input process block for module: label = '" << mcc.moduleDescription()->moduleLabel()
1386       << "' id = " << mcc.moduleDescription()->id();
1387   if (dumpContextForLabels_.find(mcc.moduleDescription()->moduleLabel()) != dumpContextForLabels_.end()) {
1388     out << "\n" << gc;
1389     out << mcc;
1390   }
1391 }
1392 
1393 void Tracer::preModuleEndProcessBlock(GlobalContext const& gc, ModuleCallingContext const& mcc) {
1394   LogAbsolute out("Tracer");
1395   unsigned int nIndents = mcc.depth() + 3;
1396   for (unsigned int i = 0; i < nIndents; ++i) {
1397     out << indention_;
1398   }
1399   out << " starting: end process block for module: label = '" << mcc.moduleDescription()->moduleLabel()
1400       << "' id = " << mcc.moduleDescription()->id();
1401   if (dumpContextForLabels_.find(mcc.moduleDescription()->moduleLabel()) != dumpContextForLabels_.end()) {
1402     out << "\n" << gc;
1403     out << mcc;
1404   }
1405 }
1406 
1407 void Tracer::postModuleEndProcessBlock(GlobalContext const& gc, ModuleCallingContext const& mcc) {
1408   LogAbsolute out("Tracer");
1409   unsigned int nIndents = mcc.depth() + 3;
1410   for (unsigned int i = 0; i < nIndents; ++i) {
1411     out << indention_;
1412   }
1413   out << " finished: end process block for module: label = '" << mcc.moduleDescription()->moduleLabel()
1414       << "' id = " << mcc.moduleDescription()->id();
1415   if (dumpContextForLabels_.find(mcc.moduleDescription()->moduleLabel()) != dumpContextForLabels_.end()) {
1416     out << "\n" << gc;
1417     out << mcc;
1418   }
1419 }
1420 
1421 void Tracer::preModuleGlobalBeginRun(GlobalContext const& gc, ModuleCallingContext const& mcc) {
1422   LogAbsolute out("Tracer");
1423   out << TimeStamper(printTimestamps_);
1424   unsigned int nIndents = mcc.depth() + 3;
1425   for (unsigned int i = 0; i < nIndents; ++i) {
1426     out << indention_;
1427   }
1428   out << " starting: global begin run for module: label = '" << mcc.moduleDescription()->moduleLabel()
1429       << "' id = " << mcc.moduleDescription()->id();
1430   if (dumpContextForLabels_.find(mcc.moduleDescription()->moduleLabel()) != dumpContextForLabels_.end()) {
1431     out << "\n" << gc;
1432     out << mcc;
1433   }
1434 }
1435 
1436 void Tracer::postModuleGlobalBeginRun(GlobalContext const& gc, ModuleCallingContext const& mcc) {
1437   LogAbsolute out("Tracer");
1438   out << TimeStamper(printTimestamps_);
1439   unsigned int nIndents = mcc.depth() + 3;
1440   for (unsigned int i = 0; i < nIndents; ++i) {
1441     out << indention_;
1442   }
1443   out << " finished: global begin run for module: label = '" << mcc.moduleDescription()->moduleLabel()
1444       << "' id = " << mcc.moduleDescription()->id();
1445   if (dumpContextForLabels_.find(mcc.moduleDescription()->moduleLabel()) != dumpContextForLabels_.end()) {
1446     out << "\n" << gc;
1447     out << mcc;
1448   }
1449 }
1450 
1451 void Tracer::preModuleGlobalEndRun(GlobalContext const& gc, ModuleCallingContext const& mcc) {
1452   LogAbsolute out("Tracer");
1453   out << TimeStamper(printTimestamps_);
1454   unsigned int nIndents = mcc.depth() + 3;
1455   for (unsigned int i = 0; i < nIndents; ++i) {
1456     out << indention_;
1457   }
1458   out << " starting: global end run for module: label = '" << mcc.moduleDescription()->moduleLabel()
1459       << "' id = " << mcc.moduleDescription()->id();
1460   if (dumpContextForLabels_.find(mcc.moduleDescription()->moduleLabel()) != dumpContextForLabels_.end()) {
1461     out << "\n" << gc;
1462     out << mcc;
1463   }
1464 }
1465 
1466 void Tracer::postModuleGlobalEndRun(GlobalContext const& gc, ModuleCallingContext const& mcc) {
1467   LogAbsolute out("Tracer");
1468   out << TimeStamper(printTimestamps_);
1469   unsigned int nIndents = mcc.depth() + 3;
1470   for (unsigned int i = 0; i < nIndents; ++i) {
1471     out << indention_;
1472   }
1473   out << " finished: global end run for module: label = '" << mcc.moduleDescription()->moduleLabel()
1474       << "' id = " << mcc.moduleDescription()->id();
1475   if (dumpContextForLabels_.find(mcc.moduleDescription()->moduleLabel()) != dumpContextForLabels_.end()) {
1476     out << "\n" << gc;
1477     out << mcc;
1478   }
1479 }
1480 
1481 void Tracer::preModuleGlobalBeginLumi(GlobalContext const& gc, ModuleCallingContext const& mcc) {
1482   LogAbsolute out("Tracer");
1483   out << TimeStamper(printTimestamps_);
1484   unsigned int nIndents = mcc.depth() + 3;
1485   for (unsigned int i = 0; i < nIndents; ++i) {
1486     out << indention_;
1487   }
1488   out << " starting: global begin lumi for module: label = '" << mcc.moduleDescription()->moduleLabel()
1489       << "' id = " << mcc.moduleDescription()->id();
1490   if (dumpContextForLabels_.find(mcc.moduleDescription()->moduleLabel()) != dumpContextForLabels_.end()) {
1491     out << "\n" << gc;
1492     out << mcc;
1493   }
1494 }
1495 
1496 void Tracer::postModuleGlobalBeginLumi(GlobalContext const& gc, ModuleCallingContext const& mcc) {
1497   LogAbsolute out("Tracer");
1498   out << TimeStamper(printTimestamps_);
1499   unsigned int nIndents = mcc.depth() + 3;
1500   for (unsigned int i = 0; i < nIndents; ++i) {
1501     out << indention_;
1502   }
1503   out << " finished: global begin lumi for module: label = '" << mcc.moduleDescription()->moduleLabel()
1504       << "' id = " << mcc.moduleDescription()->id();
1505   if (dumpContextForLabels_.find(mcc.moduleDescription()->moduleLabel()) != dumpContextForLabels_.end()) {
1506     out << "\n" << gc;
1507     out << mcc;
1508   }
1509 }
1510 
1511 void Tracer::preModuleGlobalEndLumi(GlobalContext const& gc, ModuleCallingContext const& mcc) {
1512   LogAbsolute out("Tracer");
1513   out << TimeStamper(printTimestamps_);
1514   unsigned int nIndents = mcc.depth() + 3;
1515   for (unsigned int i = 0; i < nIndents; ++i) {
1516     out << indention_;
1517   }
1518   out << " starting: global end lumi for module: label = '" << mcc.moduleDescription()->moduleLabel()
1519       << "' id = " << mcc.moduleDescription()->id();
1520   if (dumpContextForLabels_.find(mcc.moduleDescription()->moduleLabel()) != dumpContextForLabels_.end()) {
1521     out << "\n" << gc;
1522     out << mcc;
1523   }
1524 }
1525 
1526 void Tracer::postModuleGlobalEndLumi(GlobalContext const& gc, ModuleCallingContext const& mcc) {
1527   LogAbsolute out("Tracer");
1528   out << TimeStamper(printTimestamps_);
1529   unsigned int nIndents = mcc.depth() + 3;
1530   for (unsigned int i = 0; i < nIndents; ++i) {
1531     out << indention_;
1532   }
1533   out << " finished: global end lumi for module: label = '" << mcc.moduleDescription()->moduleLabel()
1534       << "' id = " << mcc.moduleDescription()->id();
1535   if (dumpContextForLabels_.find(mcc.moduleDescription()->moduleLabel()) != dumpContextForLabels_.end()) {
1536     out << "\n" << gc;
1537     out << mcc;
1538   }
1539 }
1540 
1541 void Tracer::preModuleWriteProcessBlock(GlobalContext const& gc, ModuleCallingContext const& mcc) {
1542   LogAbsolute out("Tracer");
1543   unsigned int nIndents = mcc.depth() + 3;
1544   for (unsigned int i = 0; i < nIndents; ++i) {
1545     out << indention_;
1546   }
1547   out << " starting: write process block for module: label = '" << mcc.moduleDescription()->moduleLabel()
1548       << "' id = " << mcc.moduleDescription()->id();
1549   if (dumpContextForLabels_.find(mcc.moduleDescription()->moduleLabel()) != dumpContextForLabels_.end()) {
1550     out << "\n" << gc;
1551     out << mcc;
1552   }
1553 }
1554 
1555 void Tracer::postModuleWriteProcessBlock(GlobalContext const& gc, ModuleCallingContext const& mcc) {
1556   LogAbsolute out("Tracer");
1557   unsigned int nIndents = mcc.depth() + 3;
1558   for (unsigned int i = 0; i < nIndents; ++i) {
1559     out << indention_;
1560   }
1561   out << " finished: write process block for module: label = '" << mcc.moduleDescription()->moduleLabel()
1562       << "' id = " << mcc.moduleDescription()->id();
1563   if (dumpContextForLabels_.find(mcc.moduleDescription()->moduleLabel()) != dumpContextForLabels_.end()) {
1564     out << "\n" << gc;
1565     out << mcc;
1566   }
1567 }
1568 
1569 void Tracer::preModuleWriteRun(GlobalContext const& gc, ModuleCallingContext const& mcc) {
1570   LogAbsolute out("Tracer");
1571   out << TimeStamper(printTimestamps_);
1572   unsigned int nIndents = mcc.depth() + 3;
1573   for (unsigned int i = 0; i < nIndents; ++i) {
1574     out << indention_;
1575   }
1576   out << " starting: write run for module: label = '" << mcc.moduleDescription()->moduleLabel()
1577       << "' id = " << mcc.moduleDescription()->id();
1578   if (dumpContextForLabels_.find(mcc.moduleDescription()->moduleLabel()) != dumpContextForLabels_.end()) {
1579     out << "\n" << gc;
1580     out << mcc;
1581   }
1582 }
1583 
1584 void Tracer::postModuleWriteRun(GlobalContext const& gc, ModuleCallingContext const& mcc) {
1585   LogAbsolute out("Tracer");
1586   out << TimeStamper(printTimestamps_);
1587   unsigned int nIndents = mcc.depth() + 3;
1588   for (unsigned int i = 0; i < nIndents; ++i) {
1589     out << indention_;
1590   }
1591   out << " finished: write run for module: label = '" << mcc.moduleDescription()->moduleLabel()
1592       << "' id = " << mcc.moduleDescription()->id();
1593   if (dumpContextForLabels_.find(mcc.moduleDescription()->moduleLabel()) != dumpContextForLabels_.end()) {
1594     out << "\n" << gc;
1595     out << mcc;
1596   }
1597 }
1598 
1599 void Tracer::preModuleWriteLumi(GlobalContext const& gc, ModuleCallingContext const& mcc) {
1600   LogAbsolute out("Tracer");
1601   out << TimeStamper(printTimestamps_);
1602   unsigned int nIndents = mcc.depth() + 3;
1603   for (unsigned int i = 0; i < nIndents; ++i) {
1604     out << indention_;
1605   }
1606   out << " starting: write lumi for module: label = '" << mcc.moduleDescription()->moduleLabel()
1607       << "' id = " << mcc.moduleDescription()->id();
1608   if (dumpContextForLabels_.find(mcc.moduleDescription()->moduleLabel()) != dumpContextForLabels_.end()) {
1609     out << "\n" << gc;
1610     out << mcc;
1611   }
1612 }
1613 
1614 void Tracer::postModuleWriteLumi(GlobalContext const& gc, ModuleCallingContext const& mcc) {
1615   LogAbsolute out("Tracer");
1616   out << TimeStamper(printTimestamps_);
1617   unsigned int nIndents = mcc.depth() + 3;
1618   for (unsigned int i = 0; i < nIndents; ++i) {
1619     out << indention_;
1620   }
1621   out << " finished: write lumi for module: label = '" << mcc.moduleDescription()->moduleLabel()
1622       << "' id = " << mcc.moduleDescription()->id();
1623   if (dumpContextForLabels_.find(mcc.moduleDescription()->moduleLabel()) != dumpContextForLabels_.end()) {
1624     out << "\n" << gc;
1625     out << mcc;
1626   }
1627 }
1628 
1629 void Tracer::preSourceConstruction(ModuleDescription const& desc) {
1630   LogAbsolute out("Tracer");
1631   out << TimeStamper(printTimestamps_);
1632   out << indention_;
1633   out << " starting: constructing source: " << desc.moduleName();
1634   if (dumpNonModuleContext_) {
1635     out << "\n" << desc;
1636   }
1637 }
1638 
1639 void Tracer::postSourceConstruction(ModuleDescription const& desc) {
1640   LogAbsolute out("Tracer");
1641   out << TimeStamper(printTimestamps_);
1642   out << indention_;
1643   out << " finished: constructing source: " << desc.moduleName();
1644   if (dumpNonModuleContext_) {
1645     out << "\n" << desc;
1646   }
1647 }
1648 
1649 void Tracer::preESModulePrefetching(eventsetup::EventSetupRecordKey const& iKey, ESModuleCallingContext const& mcc) {
1650   LogAbsolute out("Tracer");
1651   out << TimeStamper(printTimestamps_);
1652   unsigned int nIndents = mcc.depth() + 4;
1653   for (unsigned int i = 0; i < nIndents; ++i) {
1654     out << indention_;
1655   }
1656   out << " starting: prefetching for esmodule: label = '" << mcc.componentDescription()->label_
1657       << "' type = " << mcc.componentDescription()->type_ << " in record = " << iKey.name();
1658 }
1659 
1660 void Tracer::postESModulePrefetching(eventsetup::EventSetupRecordKey const& iKey, ESModuleCallingContext const& mcc) {
1661   LogAbsolute out("Tracer");
1662   out << TimeStamper(printTimestamps_);
1663   unsigned int nIndents = mcc.depth() + 4;
1664   for (unsigned int i = 0; i < nIndents; ++i) {
1665     out << indention_;
1666   }
1667   out << " finished: prefetching for esmodule: label = '" << mcc.componentDescription()->label_
1668       << "' type = " << mcc.componentDescription()->type_ << " in record = " << iKey.name();
1669 }
1670 
1671 void Tracer::preESModule(eventsetup::EventSetupRecordKey const& iKey, ESModuleCallingContext const& mcc) {
1672   LogAbsolute out("Tracer");
1673   out << TimeStamper(printTimestamps_);
1674   unsigned int nIndents = mcc.depth() + 4;
1675   for (unsigned int i = 0; i < nIndents; ++i) {
1676     out << indention_;
1677   }
1678   out << " starting: processing esmodule: label = '" << mcc.componentDescription()->label_
1679       << "' type = " << mcc.componentDescription()->type_ << " in record = " << iKey.name();
1680 }
1681 
1682 void Tracer::postESModule(eventsetup::EventSetupRecordKey const& iKey, ESModuleCallingContext const& mcc) {
1683   LogAbsolute out("Tracer");
1684   out << TimeStamper(printTimestamps_);
1685   unsigned int nIndents = mcc.depth() + 4;
1686   for (unsigned int i = 0; i < nIndents; ++i) {
1687     out << indention_;
1688   }
1689   out << " finished: processing esmodule: label = '" << mcc.componentDescription()->label_
1690       << "' type = " << mcc.componentDescription()->type_ << " in record = " << iKey.name();
1691 }
1692 
1693 using edm::service::Tracer;
1694 DEFINE_FWK_SERVICE(Tracer);