CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 preModuleEvent(StreamContext const &sc, ModuleCallingContext const &mcc);
34  void postModuleEvent(StreamContext const &sc, ModuleCallingContext const &mcc);
35 
36  void postEndLumi(GlobalContext const &gc);
37 
38  void postEndRun(GlobalContext const &gc);
39 
40  void postEndJob();
41 
42  void postOpenFile(std::string const &);
43 
44  void postCloseFile(std::string const &);
45 
46  inline bool isProcessWideService(IgProfService const *) { return true; }
47 
48  private:
49  void makeDump(const std::string &format, std::string_view moduleLabel = "");
50  static std::string replace(const std::string &s, const char *pat, int val);
51  static std::string replaceU64(const std::string &s, const char *pat, unsigned long long val);
52  static std::string replace(const std::string &s, const char *pat, std::string_view val);
53 
54  void (*dump_)(const char *);
55 
59 
62 
63  std::vector<std::string> modules_;
64  std::vector<std::string> moduleTypes_;
67 
71 
74 
76  int prescale_;
77  int nrecord_; // counter
81  int nfileopened_; // counter of files opened thus far
82  int nfileclosed_; // counter of files closed thus far
83  };
84  } // namespace service
85 } // namespace edm
86 
87 #endif
void postOpenFile(std::string const &)
bool isProcessWideService(IgProfService const *)
Definition: IgProfService.h:46
unsigned long long EventNumber_t
IgProfService(const ParameterSet &, ActivityRegistry &)
void postEndRun(GlobalContext const &gc)
edm::LuminosityBlockNumber_t nlumi_
Definition: IgProfService.h:80
unsigned int LuminosityBlockNumber_t
void preModuleEvent(StreamContext const &sc, ModuleCallingContext const &mcc)
static std::string replaceU64(const std::string &s, const char *pat, unsigned long long val)
void postEvent(StreamContext const &sc)
void makeDump(const std::string &format, std::string_view moduleLabel="")
std::vector< std::string > modules_
Definition: IgProfService.h:63
void postCloseFile(std::string const &)
void(* dump_)(const char *)
Definition: IgProfService.h:54
void postBeginLumi(GlobalContext const &gc)
std::vector< std::string > moduleTypes_
Definition: IgProfService.h:64
void postEndLumi(GlobalContext const &gc)
edm::EventNumber_t nevent_
Definition: IgProfService.h:78
void postModuleEvent(StreamContext const &sc, ModuleCallingContext const &mcc)
void preEvent(StreamContext const &sc)
unsigned int RunNumber_t
static std::string replace(const std::string &s, const char *pat, int val)
void postBeginRun(GlobalContext const &gc)