CMS 3D CMS Logo

ProfilerService.h
Go to the documentation of this file.
1 #ifndef ProfilerService_H
2 #define ProfilerService_H
3 
4 //FIXME only forward declarations???
8 
9 #include <vector>
10 #include <string>
11 
12 // Unit test for ProfilerService
13 namespace test {
14  class TestProfilerService;
15  struct CheckPaths;
16 } // namespace test
17 
24  // For tests
26  friend struct test::CheckPaths;
27 
28 public:
31 
34 
35  // ---- Public Interface -----
36 
38  bool startInstrumentation();
39 
41  bool stopInstrumentation();
42 
45 
46  // pause instrumentation (if active)
47  bool pauseInstrumentation();
48 
49  // resume instrumentation (if paused)
50  bool resumeInstrumentation();
51 
53  void dumpStat() const;
54 
56  bool doEvent() const { return m_doEvent; }
57 
59  bool active() const { return m_active > 0; }
60 
61  // ---- Service Interface: to be called only by the Framework ----
62 
64 
66 
68  void beginPathI(edm::StreamContext const& stream, edm::PathContext const& path) { beginPath(path.pathName()); }
70  endPath(path.pathName());
71  }
72 
73 private:
74  void fullEvent();
75 
76  void beginEvent();
77  void endEvent();
78 
79  void beginPath(std::string const& path);
80  void endPath(std::string const& path);
81 
82  void newEvent();
83 
84  // configurable
88  std::vector<std::string> m_paths;
89  std::vector<std::string> m_excludedPaths;
90  bool m_allPaths;
91 
92  // internal state
94  int m_counts;
95  bool m_doEvent;
96  int m_active;
97  bool m_paused;
99 };
100 
101 #endif // ProfilerService_H
edm::StreamID
Definition: StreamID.h:30
ProfilerService::stopInstrumentation
bool stopInstrumentation()
stop instrumentation if not active anymore; true if stopped now
Definition: ProfilerService.cc:62
ProfilerService::fullEvent
void fullEvent()
Definition: ProfilerService.cc:107
ProfilerService::CheckPaths
friend struct test::CheckPaths
Definition: ProfilerService.h:26
ProfilerService::m_firstEvent
int m_firstEvent
Definition: ProfilerService.h:85
ProfilerService::endEventI
void endEventI(edm::StreamContext const &stream)
Definition: ProfilerService.h:67
cms::cuda::stream
uint32_t const T *__restrict__ const uint32_t *__restrict__ int32_t int Histo::index_type cudaStream_t stream
Definition: HistoContainer.h:51
ProfilerService::startInstrumentation
bool startInstrumentation()
start instrumentation if not active. true if started now
Definition: ProfilerService.cc:46
ProfilerService::endPath
void endPath(std::string const &path)
Definition: ProfilerService.cc:147
ProfilerService::m_active
int m_active
Definition: ProfilerService.h:96
ProfilerService::~ProfilerService
~ProfilerService()
Destructor.
Definition: ProfilerService.cc:42
ActivityRegistry.h
test
Definition: SmallWORMDict.h:13
edm::StreamContext
Definition: StreamContext.h:31
edm::ActivityRegistry
Definition: ActivityRegistry.h:134
ProfilerService::m_dumpInterval
int m_dumpInterval
Definition: ProfilerService.h:87
ProfilerService::beginEvent
void beginEvent()
Definition: ProfilerService.cc:119
ProfilerService::TestProfilerService
friend class test::TestProfilerService
Definition: ProfilerService.h:25
ProfilerService
Definition: ProfilerService.h:23
ProfilerService::ProfilerService
ProfilerService(edm::ParameterSet const &pset, edm::ActivityRegistry &activity)
Standard Service Constructor.
Definition: ProfilerService.cc:12
ProfilerService::beginEventI
void beginEventI(edm::StreamContext const &stream)
Definition: ProfilerService.h:65
ProfilerService::m_excludedPaths
std::vector< std::string > m_excludedPaths
Definition: ProfilerService.h:89
ProfilerService::resumeInstrumentation
bool resumeInstrumentation()
Definition: ProfilerService.cc:88
ProfilerService::m_doEvent
bool m_doEvent
Definition: ProfilerService.h:95
edm::ParameterSet
Definition: ParameterSet.h:47
ProfilerService::active
bool active() const
true if instrumentation is active
Definition: ProfilerService.h:59
ProfilerService::beginPath
void beginPath(std::string const &path)
Definition: ProfilerService.cc:133
ProfilerService::beginPathI
void beginPathI(edm::StreamContext const &stream, edm::PathContext const &path)
Definition: ProfilerService.h:68
edm::PathContext
Definition: PathContext.h:24
ProfilerService::endPathI
void endPathI(edm::StreamContext const &stream, edm::PathContext const &path, edm::HLTPathStatus const &)
Definition: ProfilerService.h:69
ProfilerService::m_counts
int m_counts
Definition: ProfilerService.h:94
ProfilerService::pauseInstrumentation
bool pauseInstrumentation()
Definition: ProfilerService.cc:80
edm::HLTPathStatus
Definition: HLTPathStatus.h:33
ProfilerService::m_lastEvent
int m_lastEvent
Definition: ProfilerService.h:86
ProfilerService::m_activePath
std::string m_activePath
Definition: ProfilerService.h:98
PathContext.h
ProfilerService::m_evtCount
int m_evtCount
Definition: ProfilerService.h:93
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ProfilerService::newEvent
void newEvent()
Definition: ProfilerService.cc:102
ProfilerService::m_paths
std::vector< std::string > m_paths
Definition: ProfilerService.h:88
ProfilerService::doEvent
bool doEvent() const
true if the current event has to be instrumented
Definition: ProfilerService.h:56
ProfilerService::m_paused
bool m_paused
Definition: ProfilerService.h:97
ProfilerService::forceStopInstrumentation
bool forceStopInstrumentation()
forced stop instrumentation independenly of activity status; true if stopped now
Definition: ProfilerService.cc:71
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
ParameterSet.h
ProfilerService::endEvent
void endEvent()
Definition: ProfilerService.cc:127
ProfilerService::preSourceI
void preSourceI(edm::StreamID)
Definition: ProfilerService.h:63
ProfilerService::m_allPaths
bool m_allPaths
Definition: ProfilerService.h:90
ProfilerService::dumpStat
void dumpStat() const
dump profiling information
Definition: ProfilerService.cc:99
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27