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???
8 
9 #include <vector>
10 #include <string>
11 
12 
19 public:
20 
23  edm::ActivityRegistry & activity);
24 
27 
28 
29  // ---- Public Interface -----
30 
31 
33  bool startInstrumentation();
34 
36  bool stopInstrumentation();
37 
40 
41  // pause instrumentation (if active)
42  bool pauseInstrumentation();
43 
44  // resume instrumentation (if paused)
45  bool resumeInstrumentation();
46 
48  void dumpStat() const;
49 
51  bool doEvent() const { return m_doEvent;}
52 
54  bool active() const { return m_active>0;}
55 
56 
57  // ---- Service Interface: to be called only by the Framework ----
58 
59  void preSourceI() {
60  fullEvent();
61  }
62 
63  void beginEventI(const edm::EventID&, const edm::Timestamp&) {
64  beginEvent();
65  }
66 
67  void endEventI(const edm::Event&, const edm::EventSetup&) {
68  endEvent();
69  }
70  void beginPathI(std::string const & path) {
71  beginPath(path);
72  }
73  void endPathI(std::string const & path, const edm::HLTPathStatus&) {
74  endPath(path);
75  }
76 
77 private:
78 
79  void fullEvent();
80 
81  void beginEvent();
82  void endEvent();
83 
84  void beginPath(std::string const & path);
85  void endPath(std::string const & path);
86 
87  void newEvent();
88 
89  // configurable
93  std::vector<std::string> m_paths;
94  std::vector<std::string> m_excludedPaths;
95  bool m_allPaths;
96 
97  // internal state
99  int m_counts;
100  bool m_doEvent;
101  int m_active;
102  bool m_paused;
103  std::string m_activePath;
104 
105 };
106 
107 #endif // ProfilerService_H
bool active() const
true if instrumentation is active
std::vector< std::string > m_excludedPaths
bool resumeInstrumentation()
std::vector< std::string > m_paths
void beginPath(std::string const &path)
void endPath(std::string const &path)
std::string m_activePath
~ProfilerService()
Destructor.
void endEventI(const edm::Event &, const edm::EventSetup &)
bool stopInstrumentation()
stop instrumentation if not active anymore; true if stopped now
list path
Definition: scaleCards.py:51
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 beginEventI(const edm::EventID &, const edm::Timestamp &)
void dumpStat() const
dump profiling information
void beginPathI(std::string const &path)
void endPathI(std::string const &path, const edm::HLTPathStatus &)
ProfilerService(edm::ParameterSet const &pset, edm::ActivityRegistry &activity)
Standard Service Constructor.
bool doEvent() const
true if the current event has to be instrumented