File indexing completed on 2024-04-06 12:23:20
0001 #ifndef ProfilerService_H
0002 #define ProfilerService_H
0003
0004
0005 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0006 #include "FWCore/ServiceRegistry/interface/ActivityRegistry.h"
0007 #include "FWCore/ServiceRegistry/interface/PathContext.h"
0008
0009 #include <vector>
0010 #include <string>
0011
0012
0013 namespace test {
0014 class TestProfilerService;
0015 struct CheckPaths;
0016 }
0017
0018
0019
0020
0021
0022
0023 class ProfilerService {
0024
0025 friend class test::TestProfilerService;
0026 friend struct test::CheckPaths;
0027
0028 public:
0029
0030 ProfilerService(edm::ParameterSet const& pset, edm::ActivityRegistry& activity);
0031
0032
0033 ~ProfilerService();
0034
0035
0036
0037
0038 bool startInstrumentation();
0039
0040
0041 bool stopInstrumentation();
0042
0043
0044 bool forceStopInstrumentation();
0045
0046
0047 bool pauseInstrumentation();
0048
0049
0050 bool resumeInstrumentation();
0051
0052
0053 void dumpStat() const;
0054
0055
0056 bool doEvent() const { return m_doEvent; }
0057
0058
0059 bool active() const { return m_active > 0; }
0060
0061
0062
0063 void preSourceI(edm::StreamID) { fullEvent(); }
0064
0065 void beginEventI(edm::StreamContext const& stream) { beginEvent(); }
0066
0067 void endEventI(edm::StreamContext const& stream) { endEvent(); }
0068 void beginPathI(edm::StreamContext const& stream, edm::PathContext const& path) { beginPath(path.pathName()); }
0069 void endPathI(edm::StreamContext const& stream, edm::PathContext const& path, edm::HLTPathStatus const&) {
0070 endPath(path.pathName());
0071 }
0072
0073 private:
0074 void fullEvent();
0075
0076 void beginEvent();
0077 void endEvent();
0078
0079 void beginPath(std::string const& path);
0080 void endPath(std::string const& path);
0081
0082 void newEvent();
0083
0084
0085 int m_firstEvent;
0086 int m_lastEvent;
0087 int m_dumpInterval;
0088 std::vector<std::string> m_paths;
0089 std::vector<std::string> m_excludedPaths;
0090 bool m_allPaths;
0091
0092
0093 int m_evtCount;
0094 int m_counts;
0095 bool m_doEvent;
0096 int m_active;
0097 bool m_paused;
0098 std::string m_activePath;
0099 };
0100
0101 #endif