CMS 3D CMS Logo

IgProfService.h
Go to the documentation of this file.
1 #ifndef IgTools_IgProf_IgProfService_h
2 #define IgTools_IgProf_IgProfService_h
3 
4 //
5 // Description: FWK service to implement hook for igprof memory profile
6 // dump functionality
7 //
8 // Peter Elmer, Princeton University 18 Nov, 2008
9 //
10 
14 
15 namespace edm {
16  class GlobalContext;
17  class StreamContext;
18 
19  namespace service {
20  class IgProfService {
21  public:
23 
24  void postBeginJob();
25 
26  void postBeginRun(GlobalContext const &gc);
27 
28  void postBeginLumi(GlobalContext const &gc);
29 
30  void preEvent(StreamContext const &sc);
31  void postEvent(StreamContext const &sc);
32 
33  void postEndLumi(GlobalContext const &gc);
34 
35  void postEndRun(GlobalContext const &gc);
36 
37  void postEndJob();
38 
39  void postOpenFile(std::string const &, bool);
40 
41  void postCloseFile(std::string const &, bool);
42 
43  inline bool isProcessWideService(IgProfService const *) { return true; }
44 
45  private:
46  void makeDump(const std::string &format);
47  static std::string replace(const std::string &s, const char *pat, int val);
48  static std::string replaceU64(const std::string &s, const char *pat, unsigned long long val);
49 
50  void (*dump_)(const char *);
51 
55 
58 
62 
65 
67  int prescale_;
68  int nrecord_; // counter
72  int nfileopened_; // counter of files opened thus far
73  int nfileclosed_; // counter of files closed thus far
74  };
75  } // namespace service
76 } // namespace edm
77 
78 #endif
bool isProcessWideService(IgProfService const *)
Definition: IgProfService.h:43
void postCloseFile(std::string const &, bool)
unsigned long long EventNumber_t
IgProfService(const ParameterSet &, ActivityRegistry &)
void postEndRun(GlobalContext const &gc)
edm::LuminosityBlockNumber_t nlumi_
Definition: IgProfService.h:71
unsigned int LuminosityBlockNumber_t
Definition: HeavyIon.h:7
static std::string replaceU64(const std::string &s, const char *pat, unsigned long long val)
void postEvent(StreamContext const &sc)
void postOpenFile(std::string const &, bool)
void(* dump_)(const char *)
Definition: IgProfService.h:50
void postBeginLumi(GlobalContext const &gc)
void postEndLumi(GlobalContext const &gc)
edm::EventNumber_t nevent_
Definition: IgProfService.h:69
HLT enums.
void preEvent(StreamContext const &sc)
unsigned int RunNumber_t
void makeDump(const std::string &format)
static std::string replace(const std::string &s, const char *pat, int val)
void postBeginRun(GlobalContext const &gc)