CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ProfilerService.h
Go to the documentation of this file.
1 #ifndef ProfilerService_H
2 #define ProfilerService_H
3 
4 
5 //FIXME only forward declarations???
9 
10 #include <vector>
11 #include <string>
12 
13 
20 public:
21 
24  edm::ActivityRegistry& activity);
25 
28 
29 
30  // ---- Public Interface -----
31 
32 
34  bool startInstrumentation();
35 
37  bool stopInstrumentation();
38 
41 
42  // pause instrumentation (if active)
43  bool pauseInstrumentation();
44 
45  // resume instrumentation (if paused)
46  bool resumeInstrumentation();
47 
49  void dumpStat() const;
50 
52  bool doEvent() const { return m_doEvent;}
53 
55  bool active() const { return m_active>0;}
56 
57 
58  // ---- Service Interface: to be called only by the Framework ----
59 
61  fullEvent();
62  }
63 
64  void beginEventI(edm::StreamContext const& stream) {
65  beginEvent();
66  }
67 
68  void endEventI(edm::StreamContext const& stream) {
69  endEvent();
70  }
71  void beginPathI(edm::StreamContext const& stream, edm::PathContext const& path) {
72  beginPath(path.pathName());
73  }
74  void endPathI(edm::StreamContext const& stream, edm::PathContext const& path, edm::HLTPathStatus const&) {
75  endPath(path.pathName());
76  }
77 
78 private:
79 
80  void fullEvent();
81 
82  void beginEvent();
83  void endEvent();
84 
85  void beginPath(std::string const& path);
86  void endPath(std::string const& path);
87 
88  void newEvent();
89 
90  // configurable
94  std::vector<std::string> m_paths;
95  std::vector<std::string> m_excludedPaths;
96  bool m_allPaths;
97 
98  // internal state
100  int m_counts;
101  bool m_doEvent;
102  int m_active;
103  bool m_paused;
105 
106 };
107 
108 #endif // ProfilerService_H
std::string const & pathName() const
Definition: PathContext.h:37
bool active() const
true if instrumentation is active
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)
void endPath(std::string const &path)
std::string m_activePath
~ProfilerService()
Destructor.
bool stopInstrumentation()
stop instrumentation if not active anymore; true if stopped now
void preSourceI(edm::StreamID)
tuple path
else: Piece not in the list, fine.
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)
void dumpStat() const
dump profiling information
void beginPathI(edm::StreamContext const &stream, edm::PathContext const &path)
ProfilerService(edm::ParameterSet const &pset, edm::ActivityRegistry &activity)
Standard Service Constructor.
bool doEvent() const
true if the current event has to be instrumented
void beginEventI(edm::StreamContext const &stream)