ATLAS Offline Software
Loading...
Searching...
No Matches
Control/Hephaestus/python/__init__.py
Go to the documentation of this file.
1# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
2
3# File: Hephaestus/__init__.py
4# Author Wim Lavrijsen (WLavrijsen@lbl.gov)
5
6__version__ = '2.0.0'
7__author__ = 'Wim Lavrijsen (WLavrijsen@lbl.gov)'
8
9def setup():
10 import atexit, os
11 __path__.append( os.path.join( __path__[0], os.environ[ 'CMTCONFIG' ] ) )
12
13 # make sure that 3rd party libraries can see Hephaestus symbols by letting
14 # python load the memory tracker in "broadcast" mode
15 import sys
16 dlflags = sys.getdlopenflags()
17 sys.setdlopenflags( os.RTLD_GLOBAL | os.RTLD_NOW )
18 import MemoryTracker
19 sys.setdlopenflags( dlflags )
20
21 # switch off profiling; do filter STL internal allocations
22 MemoryTracker.configure( MemoryTracker.LEAK_CHECK |
23 MemoryTracker.QUICK |
24 MemoryTracker.FILTER_STL )
25
26 # ignore muon common blocks in report
27 MemoryTracker.ignore( '__m_mb_' )
28
29 # ignore streamers and collections from ROOT I/O in report
30 MemoryTracker.ignore( 'TStreamerInfo' )
31 MemoryTracker.ignore( 'TGenCollectionProxy' )
32 MemoryTracker.ignore( 'TCollectionProxy' )
33 MemoryTracker.ignore( 'TStorage' )
34
35 # like STL, the following only leaks if the full object is leaked, so it's a dupe
36 MemoryTracker.ignore( 'TStringRef::GetRep' )
37 MemoryTracker.ignore( 'TString::Init' )
38 MemoryTracker.ignore( 'TString::Replace' )
39 MemoryTracker.ignore( 'TList::NewLink' )
40
41 # this was a known issue, no longer relevant, but leave ignore in
42 MemoryTracker.ignore( 'StoreGateSvc::setupProxy' )
43
44 # ignore unknowns, as they've never proven useful; they typically arise from file
45 # static functions (that for that reason have no linker symbol associated with
46 # them), which are usually in system libraries rather than in ATLAS code ...
47 MemoryTracker.ignore( '<unknown>' )
48
49 MemoryTracker.ignore ('THashTable::THashTable')
50 MemoryTracker.ignore ('InitCallFunc_')
51 MemoryTracker.ignore ('_PyObject_GenericSetAttrWithDict')
52 MemoryTracker.ignore ('_PyObject_GC_NewVar')
53 MemoryTracker.ignore ('PyType_GenericAlloc')
54 MemoryTracker.ignore ('PyDict_MergeFromSeq2')
55 MemoryTracker.ignore ('PyEval_EvalFrameEx')
56 MemoryTracker.ignore ('PyROOT::')
57 MemoryTracker.ignore ('ROOT::TSchemaRule::ProcessVersion')
58 MemoryTracker.ignore ('CLHEP::HepMatrix::invert')
59 MemoryTracker.ignore ('IncidentSvc::addListener')
60 MemoryTracker.ignore ('TClass::Init')
61 MemoryTracker.ignore ('_PyObject_GC_New')
62 MemoryTracker.ignore ('_PyObject_GC_Malloc')
63 MemoryTracker.ignore ('_PyObject_GC_Resize')
64 MemoryTracker.ignore ('TString::Clobber')
65 MemoryTracker.ignore ('PyString_FromStringAndSize')
66 MemoryTracker.ignore ('clang::')
67 MemoryTracker.ignore ('cling::')
68 MemoryTracker.ignore ('llvm::')
69 MemoryTracker.ignore ('TExMap::Expand')
70 MemoryTracker.ignore ('TExMap::TExMap')
71 MemoryTracker.ignore ('TCling::')
72 MemoryTracker.ignore ('TClingDataMemberInfo::TClingDataMemberInfo')
73 MemoryTracker.ignore ('TClingBaseClassInfo::TClingBaseClassInfo')
74 MemoryTracker.ignore ('TClingCallFunc::SetFuncProto')
75 MemoryTracker.ignore ('TClassTable::AddAlternate')
76 MemoryTracker.ignore ('ROOT::TMetaUtils::GetFileName')
77
78 MemoryTracker.ignore ('SvcFactory<SegMemSvc>::create')
79 MemoryTracker.ignore ('SvcFactory<JobIDSvc>::create')
80 MemoryTracker.ignore ('SvcFactory<MuonTGC_CablingSvc>::create')
81 MemoryTracker.ignore ('Service::Service')
82 MemoryTracker.ignore ('AthService::AthService')
83 MemoryTracker.ignore ('emplace_back_aux<Property')
84 MemoryTracker.ignore ('PluginService::Factory2')
85 MemoryTracker.ignore ('PropertyMgr::declareProperty')
86 MemoryTracker.ignore ('SCT_ByteStreamErrorsSvc')
87 MemoryTracker.ignore ('TClassTable::SortTable')
88 MemoryTracker.ignore ('TWebPalette::TWebPalette')
89 MemoryTracker.ignore ('Gaudi::PluginService::Factory')
90
91 # ???
92 MemoryTracker.ignoreCall ('TClass::GetClass')
93 MemoryTracker.ignoreCall ('TClass::TClass')
94 MemoryTracker.ignoreCall ('TClass::GetStreamerInfo')
95 MemoryTracker.ignoreCall ('uuid_generate')
96 MemoryTracker.ignoreCall ('TPluginManager::FindHandler')
97 MemoryTracker.ignoreCall ('TROOT::RegisterModule')
98 MemoryTracker.ignoreCall ('TStreamerInfo::TStreamerInfo')
99 MemoryTracker.ignoreCall ('TStreamerInfo::Build')
100 MemoryTracker.ignoreCall ('TClass::Property')
101 MemoryTracker.ignoreCall ('register_xAOD_')
102 MemoryTracker.ignoreCall ('xAOD::TDVCollectionProxy::TDVCollectionProxy')
103 MemoryTracker.ignoreCall ('Property* PropertyMgr::declareProperty')
104
105 # Come back to
106 MemoryTracker.ignore ('ServiceManager::service')
107 MemoryTracker.ignore ('TDVCollectionProxy')
108 MemoryTracker.ignore ('allocator<IOVRange>')
109 MemoryTracker.ignore ('ArenaCachingHandle')
110 MemoryTracker.ignore ('ArenaHandle')
111 MemoryTracker.ignore ('vector<SG::ArenaBase')
112 MemoryTracker.ignore ('TConverterRegistry::AddConverter')
113 MemoryTracker.ignore ('TEmulatedCollectionProxy::InitializeEx')
114 MemoryTracker.ignore ('FileMgr::open')
115 MemoryTracker.ignore ('FileMgr::close')
116 MemoryTracker.ignore ('TMVA::DataSetFactory::Build')
117 MemoryTracker.ignore ('SimpleProperty')
118 MemoryTracker.ignore ('TDVCollectionFuncs::create_env')
119 MemoryTracker.ignore ('PoolSvc::setObjPtr')
120 MemoryTracker.ignore ('LWPool')
121 MemoryTracker.ignore ('std::vector<LWPoolArea')
122
123 atexit.register( MemoryTracker.atexit )
124
125setup()
126del setup
127