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
std::vector< std::string > m_excludedPaths
bool resumeInstrumentation()
void endPathI(edm::StreamContext const &stream, edm::PathContext const &path, edm::HLTPathStatus const &)
std::vector< std::string > m_paths
void beginPath(std::string const &path)
friend class test::TestProfilerService
void endPath(std::string const &path)
std::string m_activePath
~ProfilerService()
Destructor.
void dumpStat() const
dump profiling information
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
bool stopInstrumentation()
stop instrumentation if not active anymore; true if stopped now
void preSourceI(edm::StreamID)
bool doEvent() const
true if the current event has to be instrumented
bool forceStopInstrumentation()
forced stop instrumentation independenly of activity status; true if stopped now
bool pauseInstrumentation()
bool startInstrumentation()
start instrumentation if not active. true if started now
void endEventI(edm::StreamContext const &stream)
friend struct test::CheckPaths
bool active() const
true if instrumentation is active
void beginPathI(edm::StreamContext const &stream, edm::PathContext const &path)
ProfilerService(edm::ParameterSet const &pset, edm::ActivityRegistry &activity)
Standard Service Constructor.
void beginEventI(edm::StreamContext const &stream)