ATLAS Offline Software
CallGraphAuditor.cxx
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // CallGraphAuditor.cxx
8 // Implementation file for class PerfMon::CallGraphAuditor
9 // Author: S.Binet<binet@cern.ch>
11 
12 
13 // STL includes
14 
15 // FrameWork includes
16 #include "GaudiKernel/INamedInterface.h"
17 
18 // PerfMonKernel includes
20 
21 // PerfMonComps includes
22 #include "CallGraphAuditor.h"
23 
24 namespace PerfMon {
25 
27 // Public methods:
29 
30 // Constructors
33  ISvcLocator* pSvcLocator ) :
34  Auditor ( name, pSvcLocator ),
35  m_callGraphSvc( "PerfMon::CallGraphBuilderSvc/CallGraphSvc", name )
36 {
37  //
38  // Property declaration
39  //
40  //declareProperty( "Property", m_nProperty, "descr" );
41 
42  // for AuditorHandle ? someday ?
43  //declareInterface<ICallGraphAuditor>(this);
44 }
45 
46 // Destructor
49 {
50  //m_msg << MSG::DEBUG << "Calling destructor" << endmsg;
51 }
52 
53 
55 // Non-const methods:
57 
60 {
61  // retrieve the callgraph service
62  if ( !m_callGraphSvc.retrieve().isSuccess() ) {
63  // FIXME: use a datamember MsgStream !
64  MsgStream msg( msgSvc(), name() );
65  msg << MSG::ERROR
66  << "Could not retrieve [" << m_callGraphSvc.typeAndName() << "] !!"
67  << endmsg;
68  return StatusCode::FAILURE;
69  }
70 
71  return StatusCode::SUCCESS;
72 }
73 
74 void CallGraphAuditor::beforeInitialize( INamedInterface* alg )
75 {
76  m_callGraphSvc->openNode( alg->name() + ":initialize" );
77  return;
78 }
79 
80 void CallGraphAuditor::afterInitialize( INamedInterface* alg )
81 {
82  m_callGraphSvc->closeNode( alg->name() + ":initialize" );
83  return;
84 }
85 
86 void CallGraphAuditor::beforeReinitialize( INamedInterface* alg )
87 {
88  m_callGraphSvc->openNode( alg->name() + ":reinitialize" );
89  return;
90 }
91 
92 void CallGraphAuditor::afterReinitialize( INamedInterface* alg )
93 {
94  m_callGraphSvc->closeNode( alg->name() + ":reinitialize" );
95  return;
96 }
97 
98 void CallGraphAuditor::beforeExecute( INamedInterface* alg )
99 {
100  m_callGraphSvc->openNode( alg->name() + ":execute" );
101  return;
102 }
103 
104 void CallGraphAuditor::afterExecute( INamedInterface* alg, const StatusCode& )
105 {
106  m_callGraphSvc->closeNode( alg->name() + ":execute" );
107  return;
108 }
109 
110 void CallGraphAuditor::beforeFinalize( INamedInterface* alg )
111 {
112  m_callGraphSvc->openNode( alg->name() + ":finalize" );
113  return;
114 }
115 
116 void CallGraphAuditor::afterFinalize( INamedInterface* alg )
117 {
118  m_callGraphSvc->closeNode( alg->name() + ":finalize" );
119  return;
120 }
121 
122 
123 } // end namespace PerfMon
PerfMon::CallGraphAuditor::beforeReinitialize
virtual void beforeReinitialize(INamedInterface *alg)
Definition: CallGraphAuditor.cxx:86
SGout2dot.alg
alg
Definition: SGout2dot.py:243
PerfMon::CallGraphAuditor::initialize
virtual StatusCode initialize()
Gaudi hooks.
Definition: CallGraphAuditor.cxx:59
PerfMon::CallGraphAuditor::beforeInitialize
virtual void beforeInitialize(INamedInterface *alg)
Definition: CallGraphAuditor.cxx:74
PerfMon::CallGraphAuditor::beforeExecute
virtual void beforeExecute(INamedInterface *alg)
Definition: CallGraphAuditor.cxx:98
PerfMon::CallGraphAuditor::afterReinitialize
virtual void afterReinitialize(INamedInterface *alg)
Definition: CallGraphAuditor.cxx:92
PerfMon
a simple malloc wrapper that keeps track of the amount of memory allocated on the heap.
Definition: CallGraphAuditor.cxx:24
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
PerfMon::CallGraphAuditor::afterFinalize
virtual void afterFinalize(INamedInterface *alg)
Definition: CallGraphAuditor.cxx:116
ICallGraphBuilderSvc.h
PerfMon::CallGraphAuditor::afterExecute
virtual void afterExecute(INamedInterface *alg, const StatusCode &)
Definition: CallGraphAuditor.cxx:104
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
PerfMon::CallGraphAuditor::m_callGraphSvc
ICallGraphSvc_t m_callGraphSvc
Handle to the ICallGraphSvc service which will build the call graph tree (and annotate it)
Definition: CallGraphAuditor.h:65
PerfMon::CallGraphAuditor::beforeFinalize
virtual void beforeFinalize(INamedInterface *alg)
Definition: CallGraphAuditor.cxx:110
PerfMon::CallGraphAuditor::afterInitialize
virtual void afterInitialize(INamedInterface *alg)
Definition: CallGraphAuditor.cxx:80
CallGraphAuditor.h
PerfMon::CallGraphAuditor::CallGraphAuditor
CallGraphAuditor(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition: CallGraphAuditor.cxx:32
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
PerfMon::CallGraphAuditor::~CallGraphAuditor
virtual ~CallGraphAuditor()
Destructor.
Definition: CallGraphAuditor.cxx:48