PerfTools
Callgrind
plugins
ProfilerAnalyzer.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// Package: PerfTools/Callgrind
4
// Class: ProfilerAnalyzer
5
//
18
//
19
// Original Author: Andrea Rizzi
20
// Created: Thu Jan 18 10:34:18 CET 2007
21
22
// system include files
23
24
// user include files
25
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
26
#include "
FWCore/Framework/interface/EDAnalyzer.h
"
27
28
#include "
FWCore/Framework/interface/MakerMacros.h
"
29
30
#include "
FWCore/ServiceRegistry/interface/Service.h
"
31
#include "
PerfTools/Callgrind/interface/ProfilerService.h
"
32
33
//
34
// class declaration
35
//
36
class
ProfilerAnalyzer
:
public
edm::EDAnalyzer
{
37
public
:
38
explicit
ProfilerAnalyzer
(
const
edm::ParameterSet
&);
39
~ProfilerAnalyzer
()
override
;
40
41
private
:
42
void
beginJob
()
override
;
43
void
analyze
(
const
edm::Event
&,
const
edm::EventSetup
&)
override
= 0;
44
void
endJob
()
override
;
45
};
46
47
class
StartProfilerAnalyzer
:
public
ProfilerAnalyzer
{
48
public
:
49
explicit
StartProfilerAnalyzer
(
const
edm::ParameterSet
&
pset
) :
ProfilerAnalyzer
(
pset
) {}
50
~StartProfilerAnalyzer
()
override
{}
51
52
private
:
53
void
analyze
(
const
edm::Event
&,
const
edm::EventSetup
&)
override
;
54
};
55
56
class
StopProfilerAnalyzer
:
public
ProfilerAnalyzer
{
57
public
:
58
explicit
StopProfilerAnalyzer
(
const
edm::ParameterSet
&
pset
) :
ProfilerAnalyzer
(
pset
) {}
59
~StopProfilerAnalyzer
()
override
{}
60
61
private
:
62
void
analyze
(
const
edm::Event
&,
const
edm::EventSetup
&)
override
;
63
};
64
65
//
66
// constants, enums and typedefs
67
//
68
69
//
70
// static data member definitions
71
//
72
73
//
74
// constructors and destructor
75
//
76
ProfilerAnalyzer::ProfilerAnalyzer
(
const
edm::ParameterSet
&) {}
77
78
ProfilerAnalyzer::~ProfilerAnalyzer
() {
79
// do anything here that needs to be done at desctruction time
80
// (e.g. close files, deallocate resources etc.)
81
}
82
83
//
84
// member functions
85
//
86
87
// ------------ method called to for each event ------------
88
void
StartProfilerAnalyzer::analyze
(
const
edm::Event
&,
const
edm::EventSetup
&) {
89
edm::Service<ProfilerService>
()->startInstrumentation();
90
}
91
void
StopProfilerAnalyzer::analyze
(
const
edm::Event
&,
const
edm::EventSetup
&) {
92
edm::Service<ProfilerService>
()->stopInstrumentation();
93
}
94
95
// ------------ method called once each job just before starting event loop ------------
96
void
ProfilerAnalyzer::beginJob
() {}
97
98
// ------------ method called once each job just after ending the event loop ------------
99
void
ProfilerAnalyzer::endJob
() {}
100
101
//define this as a plug-in
102
DEFINE_FWK_MODULE
(
StartProfilerAnalyzer
);
103
DEFINE_FWK_MODULE
(
StopProfilerAnalyzer
);
ProfilerService.h
ProfilerAnalyzer
Definition:
ProfilerAnalyzer.cc:36
StartProfilerAnalyzer::StartProfilerAnalyzer
StartProfilerAnalyzer(const edm::ParameterSet &pset)
Definition:
ProfilerAnalyzer.cc:49
StopProfilerAnalyzer::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition:
ProfilerAnalyzer.cc:91
EDAnalyzer.h
StartProfilerAnalyzer::~StartProfilerAnalyzer
~StartProfilerAnalyzer() override
Definition:
ProfilerAnalyzer.cc:50
edm::EDAnalyzer
Definition:
EDAnalyzer.h:29
ProfilerAnalyzer::~ProfilerAnalyzer
~ProfilerAnalyzer() override
Definition:
ProfilerAnalyzer.cc:78
StopProfilerAnalyzer
Definition:
ProfilerAnalyzer.cc:56
MakerMacros.h
StartProfilerAnalyzer::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition:
ProfilerAnalyzer.cc:88
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
Service.h
edm::ParameterSet
Definition:
ParameterSet.h:36
edm::Service
Definition:
Service.h:30
StopProfilerAnalyzer::~StopProfilerAnalyzer
~StopProfilerAnalyzer() override
Definition:
ProfilerAnalyzer.cc:59
edm::EventSetup
Definition:
EventSetup.h:57
ProfilerAnalyzer::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override=0
StartProfilerAnalyzer
Definition:
ProfilerAnalyzer.cc:47
Frameworkfwd.h
ProfilerAnalyzer::endJob
void endJob() override
Definition:
ProfilerAnalyzer.cc:99
ProfilerAnalyzer::beginJob
void beginJob() override
Definition:
ProfilerAnalyzer.cc:96
ProfilerAnalyzer::ProfilerAnalyzer
ProfilerAnalyzer(const edm::ParameterSet &)
Definition:
ProfilerAnalyzer.cc:76
edm::Event
Definition:
Event.h:73
StopProfilerAnalyzer::StopProfilerAnalyzer
StopProfilerAnalyzer(const edm::ParameterSet &pset)
Definition:
ProfilerAnalyzer.cc:58
muonDTDigis_cfi.pset
pset
Definition:
muonDTDigis_cfi.py:27
Generated for CMSSW Reference Manual by
1.8.16