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 
15 
16 namespace edm {
17  class GlobalContext;
18  class StreamContext;
19 
20  namespace service {
21  class IgProfService {
22  public:
24 
25  void postBeginJob();
26 
27  void postBeginRun(GlobalContext const &gc);
28 
29  void postBeginLumi(GlobalContext const &gc);
30 
31  void preEvent(StreamContext const &sc);
32  void postEvent(StreamContext const &sc);
33 
34  void preModuleEvent(StreamContext const &sc, ModuleCallingContext const &mcc);
35  void postModuleEvent(StreamContext const &sc, ModuleCallingContext const &mcc);
36 
37  void postEndLumi(GlobalContext const &gc);
38 
39  void preEndRun(GlobalContext const &gc);
40  void postEndRun(GlobalContext const &gc);
41 
42  void preEndProcessBlock(GlobalContext const &gc);
43  void postEndProcessBlock(GlobalContext const &gc);
44 
45  void preEndJob();
46  void postEndJob();
47 
48  void postOpenFile(std::string const &);
49 
50  void postCloseFile(std::string const &);
51 
52  static void fillDescriptions(edm::ConfigurationDescriptions &descriptions);
53 
54  private:
55  void makeDump(const std::string &format, std::string_view moduleLabel = "");
56  static std::string replace(const std::string &s, const char *pat, int val);
57  static std::string replaceU64(const std::string &s, const char *pat, unsigned long long val);
58  static std::string replace(const std::string &s, const char *pat, std::string_view val);
59 
60  void (*dump_)(const char *);
61 
65 
68 
69  std::vector<std::string> modules_;
70  std::vector<std::string> moduleTypes_;
73 
81 
84 
86  int prescale_;
87  int nrecord_; // counter
91  int nfileopened_; // counter of files opened thus far
92  int nfileclosed_; // counter of files closed thus far
93  };
94  inline bool isProcessWideService(IgProfService const *) { return true; }
95  } // namespace service
96 } // namespace edm
97 
98 #endif
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void postOpenFile(std::string const &)
bool isProcessWideService(TFileService const *)
Definition: TFileService.h:98
unsigned long long EventNumber_t
IgProfService(const ParameterSet &, ActivityRegistry &)
void postEndRun(GlobalContext const &gc)
edm::LuminosityBlockNumber_t nlumi_
Definition: IgProfService.h:90
unsigned int LuminosityBlockNumber_t
void preEndRun(GlobalContext const &gc)
void preModuleEvent(StreamContext const &sc, ModuleCallingContext const &mcc)
TEMPL(T2) struct Divides void
Definition: Factorize.h:24
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 makeDump(const std::string &format, std::string_view moduleLabel="")
std::vector< std::string > modules_
Definition: IgProfService.h:69
std::string atPostEndProcessBlock_
Definition: IgProfService.h:78
void preEndProcessBlock(GlobalContext const &gc)
void postCloseFile(std::string const &)
void(* dump_)(const char *)
Definition: IgProfService.h:60
void postBeginLumi(GlobalContext const &gc)
std::vector< std::string > moduleTypes_
Definition: IgProfService.h:70
void postEndLumi(GlobalContext const &gc)
edm::EventNumber_t nevent_
Definition: IgProfService.h:88
HLT enums.
void postModuleEvent(StreamContext const &sc, ModuleCallingContext const &mcc)
void preEvent(StreamContext const &sc)
unsigned int RunNumber_t
void postEndProcessBlock(GlobalContext const &gc)
static std::string replace(const std::string &s, const char *pat, int val)
void postBeginRun(GlobalContext const &gc)