#include <TMemStatManager.h>
Inheritance diagram for TMemStatManager:
Public Types | |
enum | EStatusBits |
enum | EDumpTo |
typedef std::vector< TMemStatCodeInfo > | CodeInfoContainer_t |
typedef void(*) | StampCallback_t (const Char_t *desription) |
Public Member Functions | |
TMemStatManager () | |
virtual | ~TMemStatManager () |
void | Enable () |
void | Disable () |
void | SetAutoStamp (UInt_t sizeMem, UInt_t n, UInt_t max) |
void | AddStamps (const char *stampname=0) |
TMemStatInfoStamp & | AddStamp () |
TMemStatCodeInfo & | GetCodeInfo (void *address) |
UInt_t | GetCodeInfoIndex (void *address) |
void | DumpTo (EDumpTo _DumpTo, Bool_t _clearStamps=kTRUE, const char *_stampName=0) |
void | SetUseGNUBuildinBacktrace (Bool_t _NewVal) |
call back function | |
Static Public Member Functions | |
static void | SAddStamps (const Char_t *stampname) |
static TMemStatManager * | GetInstance () |
static void | Close () |
Public Attributes | |
IntVector_t | fSTHashTable |
Int_t | fCount |
pointer to the hash table | |
Int_t | fStampNumber |
number of entries in table | |
std::vector< TMemStatStackInfo > | fStackVector |
std::vector< TMemStatInfoStamp > | fStampVector |
std::vector< TTimeStamp > | fStampTime |
CodeInfoContainer_t | fCodeInfoArray |
std::map< const void *, UInt_t > | fCodeInfoMap |
Int_t | fDebugLevel |
map of code information | |
TMemStatManager::StampCallback_t | fStampCallBack |
debug level | |
Protected Member Functions | |
void | Init () |
old free function | |
TMemStatStackInfo * | STAddInfo (Int_t size, void **stackptrs) |
TMemStatStackInfo * | STFindInfo (Int_t size, void **stackptrs) |
void | RehashLeak (Int_t newSize) |
void * | AddPointer (size_t size, void *ptr=0) |
void | FreePointer (void *p) |
void | FreeHashtable () |
Static Protected Member Functions | |
static void * | AllocHook (size_t size, const void *) |
static void | FreeHook (void *ptr, const void *) |
Protected Attributes | |
TMemStatDepend::MallocHookFunc_t | fPreviousMallocHook |
TMemStatDepend::FreeHookFunc_t | fPreviousFreeHook |
old malloc function | |
TMemStatInfoStamp | fLastStamp |
TMemStatInfoStamp | fCurrentStamp |
UInt_t | fAutoStampSize |
UInt_t | fAutoStampN |
UInt_t | fAutoStampDumpSize |
Int_t | fMinStampSize |
Int_t | fSize |
TMemTable_t ** | fLeak |
size of hash table | |
Int_t | fAllocCount |
pointer to the hash table | |
TDeleteTable_t | fMultDeleteTable |
number of memory allocation blocks | |
TFilePtr_t | fDumpFile |
pointer to the table | |
TTree * | fDumpTree |
file to dump current information | |
TTree * | fDumpSysTree |
tree to dump information | |
Bool_t | fUseGNUBuildinBacktrace |
Static Protected Attributes | |
static TMemStatManager * | fgInstance |
tree to dump information | |
static void * | fgStackTop |
Classes | |
struct | TDeleteTable_t |
struct | TMemInfo_t |
struct | TMemTable_t |
Definition at line 48 of file TMemStatManager.h.
typedef std::vector<TMemStatCodeInfo> TMemStatManager::CodeInfoContainer_t |
Definition at line 71 of file TMemStatManager.h.
typedef void(*) TMemStatManager::StampCallback_t(const Char_t *desription) |
Definition at line 103 of file TMemStatManager.h.
Definition at line 78 of file TMemStatManager.h.
TMemStatManager::TMemStatManager | ( | ) |
TMemStatManager::~TMemStatManager | ( | ) | [virtual] |
Definition at line 147 of file TMemStatManager.cxx.
References AddStamps(), Disable(), DumpTo(), FreeHashtable(), GetInstance(), kStatDisable, kSysTree, kTree, kTRUE, and TObject::SetBit().
void TMemStatManager::Enable | ( | ) |
Definition at line 165 of file TMemStatManager.cxx.
References AllocHook(), FreeHook(), GetInstance(), kFALSE, kUserDisable, TObject::SetBit(), TMemStatDepend::SetFreeHook(), and TMemStatDepend::SetMallocHook().
Referenced by TMemStat::TMemStat().
void TMemStatManager::Disable | ( | ) |
Definition at line 179 of file TMemStatManager.cxx.
References fPreviousFreeHook, fPreviousMallocHook, GetInstance(), kTRUE, kUserDisable, TObject::SetBit(), TMemStatDepend::SetFreeHook(), and TMemStatDepend::SetMallocHook().
Referenced by AddPointer(), and ~TMemStatManager().
Definition at line 85 of file TMemStatManager.h.
References fAutoStampDumpSize, fAutoStampN, and fAutoStampSize.
Referenced by TMemStat::SetAutoStamp().
void TMemStatManager::AddStamps | ( | const char * | stampname = 0 |
) |
Definition at line 287 of file TMemStatManager.cxx.
References AddStamp(), DumpTo(), TMemStatInfoStamp::fAllocSize, fAutoStampDumpSize, fCodeInfoArray, fCurrentStamp, TMemStatInfoStamp::fID, fMinStampSize, fStackVector, fStampNumber, TMemStatInfoStamp::fStampNumber, fStampTime, fStampVector, i, kSysTree, kTree, and kTRUE.
Referenced by AddPointer(), TMemStat::AddStamp(), SAddStamps(), and ~TMemStatManager().
void TMemStatManager::SAddStamps | ( | const Char_t * | stampname | ) | [static] |
TMemStatManager * TMemStatManager::GetInstance | ( | ) | [static] |
Definition at line 125 of file TMemStatManager.cxx.
References fgInstance, and Init().
Referenced by AddPointer(), TMemStat::AddStamp(), AllocHook(), Disable(), Enable(), FreeHook(), TMemStatCodeInfo::MakeStamp(), TMemStatStackInfo::MakeStamp(), SAddStamps(), TMemStat::SetAutoStamp(), TMemStat::TMemStat(), and ~TMemStatManager().
void TMemStatManager::Close | ( | ) | [static] |
Definition at line 138 of file TMemStatManager.cxx.
References fgInstance, and NULL.
Referenced by AddPointer().
TMemStatInfoStamp & TMemStatManager::AddStamp | ( | ) |
Definition at line 315 of file TMemStatManager.cxx.
References fStampNumber, TMemStatInfoStamp::fStampNumber, fStampVector, and size.
Referenced by AddStamps(), TMemStatCodeInfo::MakeStamp(), and TMemStatStackInfo::MakeStamp().
TMemStatCodeInfo & TMemStatManager::GetCodeInfo | ( | void * | address | ) |
Definition at line 327 of file TMemStatManager.cxx.
References fCodeInfoArray, fCodeInfoMap, info, NULL, and size.
Referenced by TMemStatStackInfo::Init().
UInt_t TMemStatManager::GetCodeInfoIndex | ( | void * | address | ) | [inline] |
void TMemStatManager::DumpTo | ( | EDumpTo | _DumpTo, | |
Bool_t | _clearStamps = kTRUE , |
|||
const char * | _stampName = 0 | |||
) |
Definition at line 558 of file TMemStatManager.cxx.
References TTree::AutoSave(), TTree::Branch(), fCurrentStamp, fDumpFile, fDumpSysTree, fDumpTree, TTree::Fill(), ProcInfo_t::fMemResident, MemInfo_t::fMemUsed, ProcInfo_t::fMemVirtual, Form(), fStampNumber, fStampVector, MemInfo_t::fSwapUsed, g_cszFileName(), TSystem::GetMemInfo(), TSystem::GetProcInfo(), gSystem, kStatDisable, kSysTree, kTree, kTRUE, NULL, TFile::Open(), TObject::SetBit(), TTree::SetBranchAddress(), and TObject::TestBit().
Referenced by AddStamps(), and ~TMemStatManager().
void TMemStatManager::SetUseGNUBuildinBacktrace | ( | Bool_t | _NewVal | ) | [inline] |
call back function
Definition at line 115 of file TMemStatManager.h.
References fUseGNUBuildinBacktrace.
Referenced by TMemStat::TMemStat().
void TMemStatManager::Init | ( | ) | [protected] |
old free function
Definition at line 92 of file TMemStatManager.cxx.
References TMemStatManager::TMemTable_t::fAllocCount, TMemStatManager::TDeleteTable_t::fAllocCount, fAllocCount, fCodeInfoArray, fCount, TMemStatManager::TMemTable_t::fFirstFreeSpot, fLeak, TMemStatManager::TMemTable_t::fLeaks, TMemStatManager::TDeleteTable_t::fLeaks, TMemStatManager::TMemTable_t::fMemSize, fMultDeleteTable, FreeHashtable(), fSize, fStackVector, fStampNumber, fStampTime, fStampVector, TMemStatManager::TMemTable_t::fTableSize, TMemStatManager::TDeleteTable_t::fTableSize, i, kTRUE, kUserDisable, malloc(), and TObject::SetBit().
Referenced by AddPointer(), and GetInstance().
TMemStatStackInfo * TMemStatManager::STAddInfo | ( | Int_t | size, | |
void ** | stackptrs | |||
) | [protected] |
Definition at line 216 of file TMemStatManager.cxx.
References fCount, TMemStatStackInfo::fNextHash, fStackVector, fSTHashTable, g_STHashSize(), hash, info, int, and NULL.
Referenced by STFindInfo().
TMemStatStackInfo * TMemStatManager::STFindInfo | ( | Int_t | size, | |
void ** | stackptrs | |||
) | [protected] |
Definition at line 253 of file TMemStatManager.cxx.
References fStackVector, fSTHashTable, g_STHashSize(), hash, TMemStatStackInfo::HashStack(), info, int, NULL, and STAddInfo().
Referenced by AddPointer().
void TMemStatManager::RehashLeak | ( | Int_t | newSize | ) | [protected] |
Definition at line 348 of file TMemStatManager.cxx.
References TObject::Error(), TMemStatManager::TMemTable_t::fAllocCount, TMemStatManager::TMemTable_t::fFirstFreeSpot, fLeak, TMemStatManager::TMemTable_t::fLeaks, TMemStatManager::TMemTable_t::fMemSize, fSize, TMemStatManager::TMemTable_t::fTableSize, hash, TString::Hash(), i, if(), malloc(), and realloc().
Referenced by AddPointer().
void * TMemStatManager::AddPointer | ( | size_t | size, | |
void * | ptr = 0 | |||
) | [protected] |
Definition at line 400 of file TMemStatManager.cxx.
References AddStamps(), TMemStatDepend::Backtrace(), Close(), Disable(), TObject::Error(), TMemStatManager::TMemInfo_t::fAddress, TMemStatManager::TMemTable_t::fAllocCount, TMemStatInfoStamp::fAllocCount, fAllocCount, TMemStatInfoStamp::fAllocSize, fAutoStampN, fAutoStampSize, fCurrentStamp, TMemStatManager::TMemTable_t::fFirstFreeSpot, fLastStamp, fLeak, TMemStatManager::TMemTable_t::fLeaks, TMemStatManager::TMemTable_t::fMemSize, fSize, TMemStatManager::TMemInfo_t::fSize, TMemStatManager::TMemInfo_t::fStackIndex, fStampNumber, TMemStatManager::TMemTable_t::fTableSize, TMemStatInfoStamp::fTotalAllocCount, TMemStatInfoStamp::fTotalAllocSize, fUseGNUBuildinBacktrace, GetInstance(), hash, TString::Hash(), i, if(), TMemStatInfoStamp::Inc(), info, Init(), int, TMemStatStackInfo::kStackHistorySize, kStatDisable, kStatRoutine, kTRUE, kUserDisable, malloc(), NULL, p, realloc(), RehashLeak(), TObject::SetBit(), STFindInfo(), and TObject::TestBit().
Referenced by AllocHook().
void TMemStatManager::FreePointer | ( | void * | p | ) | [protected] |
Definition at line 492 of file TMemStatManager.cxx.
References TMemStatInfoStamp::Dec(), TMemStatManager::TMemInfo_t::fAddress, TMemStatManager::TMemTable_t::fAllocCount, fAllocCount, fCurrentStamp, TMemStatManager::TMemTable_t::fFirstFreeSpot, fLeak, TMemStatManager::TMemTable_t::fLeaks, TMemStatManager::TMemTable_t::fMemSize, free(), fSize, TMemStatManager::TMemInfo_t::fSize, TMemStatManager::TMemInfo_t::fStackIndex, fStackVector, TMemStatManager::TMemTable_t::fTableSize, hash, TString::Hash(), i, if(), info, kStatDisable, kStatRoutine, kTRUE, kUserDisable, TObject::SetBit(), and TObject::TestBit().
Referenced by FreeHook().
void * TMemStatManager::AllocHook | ( | size_t | size, | |
const void * | ||||
) | [static, protected] |
Definition at line 193 of file TMemStatManager.cxx.
References AddPointer(), fPreviousMallocHook, GetInstance(), p, and TMemStatDepend::SetMallocHook().
Referenced by Enable().
void TMemStatManager::FreeHook | ( | void * | ptr, | |
const void * | ||||
) | [static, protected] |
Definition at line 205 of file TMemStatManager.cxx.
References fPreviousFreeHook, FreePointer(), GetInstance(), and TMemStatDepend::SetFreeHook().
Referenced by Enable().
void TMemStatManager::FreeHashtable | ( | ) | [inline, protected] |
Definition at line 147 of file TMemStatManager.h.
References fLeak, free(), fSize, and i.
Referenced by Init(), and ~TMemStatManager().
pointer to the hash table
Definition at line 106 of file TMemStatManager.h.
Referenced by Init(), and STAddInfo().
number of entries in table
Definition at line 107 of file TMemStatManager.h.
Referenced by AddPointer(), AddStamp(), AddStamps(), DumpTo(), Init(), and TMemStat::MakeGraph().
std::vector<TMemStatStackInfo> TMemStatManager::fStackVector |
Definition at line 108 of file TMemStatManager.h.
Referenced by AddStamps(), FreePointer(), TMemStat::GetObjectInfo(), Init(), TMemStat::MakeGraphStack(), TMemStat::MakeStackArray(), TMemStat::PrintStackWithID(), TMemStat::SelectStack(), TMemStat::SortStack(), STAddInfo(), and STFindInfo().
std::vector<TMemStatInfoStamp> TMemStatManager::fStampVector |
Definition at line 109 of file TMemStatManager.h.
Referenced by AddStamp(), AddStamps(), DumpTo(), and Init().
std::vector<TTimeStamp> TMemStatManager::fStampTime |
Definition at line 111 of file TMemStatManager.h.
Referenced by AddStamps(), TMemStatStackInfo::Dec(), GetCodeInfo(), TMemStat::GetFillSelection(), TMemStat::GetObjectInfo(), TMemStatStackInfo::Inc(), Init(), TMemStat::MakeCodeArray(), TMemStat::MakeGraphCode(), TMemStat::MakeGraphStack(), TMemStat::PrintCode(), TMemStat::PrintCodeWithID(), TMemStat::PrintStackWithID(), TMemStat::SelectCode(), and TMemStat::SortCode().
std::map<const void*, UInt_t> TMemStatManager::fCodeInfoMap |
Definition at line 112 of file TMemStatManager.h.
Referenced by GetCodeInfo(), and GetCodeInfoIndex().
old malloc function
Definition at line 121 of file TMemStatManager.h.
Referenced by Disable(), and FreeHook().
TMemStatInfoStamp TMemStatManager::fLastStamp [protected] |
TMemStatInfoStamp TMemStatManager::fCurrentStamp [protected] |
Definition at line 131 of file TMemStatManager.h.
Referenced by AddPointer(), AddStamps(), DumpTo(), and FreePointer().
UInt_t TMemStatManager::fAutoStampSize [protected] |
UInt_t TMemStatManager::fAutoStampN [protected] |
UInt_t TMemStatManager::fAutoStampDumpSize [protected] |
Int_t TMemStatManager::fMinStampSize [protected] |
Int_t TMemStatManager::fSize [protected] |
Definition at line 137 of file TMemStatManager.h.
Referenced by AddPointer(), FreeHashtable(), FreePointer(), Init(), and RehashLeak().
TMemTable_t** TMemStatManager::fLeak [protected] |
size of hash table
Definition at line 138 of file TMemStatManager.h.
Referenced by AddPointer(), FreeHashtable(), FreePointer(), Init(), and RehashLeak().
Int_t TMemStatManager::fAllocCount [protected] |
pointer to the hash table
Definition at line 139 of file TMemStatManager.h.
Referenced by AddPointer(), FreePointer(), and Init().
TDeleteTable_t TMemStatManager::fMultDeleteTable [protected] |
number of memory allocation blocks
Definition at line 140 of file TMemStatManager.h.
Referenced by Init().
TFilePtr_t TMemStatManager::fDumpFile [protected] |
TTree* TMemStatManager::fDumpTree [protected] |
file to dump current information
Definition at line 142 of file TMemStatManager.h.
Referenced by DumpTo().
TTree* TMemStatManager::fDumpSysTree [protected] |
TMemStatManager* TMemStatManager::fgInstance [static, protected] |
tree to dump information
Definition at line 144 of file TMemStatManager.h.
Referenced by Close(), and GetInstance().
void* TMemStatManager::fgStackTop [static, protected] |
Definition at line 145 of file TMemStatManager.h.
Bool_t TMemStatManager::fUseGNUBuildinBacktrace [protected] |
Definition at line 156 of file TMemStatManager.h.
Referenced by AddPointer(), and SetUseGNUBuildinBacktrace().