TMemStatManager Class Reference

#include <TMemStatManager.h>

Inheritance diagram for TMemStatManager:

TObject List of all members.

Public Types

enum  EStatusBits
enum  EDumpTo
typedef std::vector< TMemStatCodeInfoCodeInfoContainer_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)
TMemStatInfoStampAddStamp ()
TMemStatCodeInfoGetCodeInfo (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 TMemStatManagerGetInstance ()
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< TMemStatStackInfofStackVector
std::vector< TMemStatInfoStampfStampVector
std::vector< TTimeStampfStampTime
CodeInfoContainer_t fCodeInfoArray
std::map< const void *, UInt_tfCodeInfoMap
Int_t fDebugLevel
 map of code information
TMemStatManager::StampCallback_t fStampCallBack
 debug level

Protected Member Functions

void Init ()
 old free function
TMemStatStackInfoSTAddInfo (Int_t size, void **stackptrs)
TMemStatStackInfoSTFindInfo (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
TTreefDumpTree
 file to dump current information
TTreefDumpSysTree
 tree to dump information
Bool_t fUseGNUBuildinBacktrace

Static Protected Attributes

static TMemStatManagerfgInstance
 tree to dump information
static void * fgStackTop

Classes

struct  TDeleteTable_t
struct  TMemInfo_t
struct  TMemTable_t

Detailed Description

Definition at line 48 of file TMemStatManager.h.


Member Typedef Documentation

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.


Member Enumeration Documentation

enum TMemStatManager::EStatusBits

Reimplemented from TObject.

Definition at line 73 of file TMemStatManager.h.

enum TMemStatManager::EDumpTo

Definition at line 78 of file TMemStatManager.h.


Constructor & Destructor Documentation

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().


Member Function Documentation

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().

void TMemStatManager::SetAutoStamp ( UInt_t  sizeMem,
UInt_t  n,
UInt_t  max 
) [inline]

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]

Definition at line 277 of file TMemStatManager.cxx.

References AddStamps(), and GetInstance().

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]

Definition at line 97 of file TMemStatManager.h.

References fCodeInfoMap.

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().


Member Data Documentation

IntVector_t TMemStatManager::fSTHashTable

Definition at line 105 of file TMemStatManager.h.

Referenced by STAddInfo(), and STFindInfo().

Int_t TMemStatManager::fCount

pointer to the hash table

Definition at line 106 of file TMemStatManager.h.

Referenced by Init(), and STAddInfo().

Int_t TMemStatManager::fStampNumber

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 110 of file TMemStatManager.h.

Referenced by AddStamps(), and Init().

CodeInfoContainer_t TMemStatManager::fCodeInfoArray

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().

Int_t TMemStatManager::fDebugLevel

map of code information

Definition at line 113 of file TMemStatManager.h.

TMemStatManager::StampCallback_t TMemStatManager::fStampCallBack

debug level

Definition at line 114 of file TMemStatManager.h.

TMemStatDepend::MallocHookFunc_t TMemStatManager::fPreviousMallocHook [protected]

Definition at line 120 of file TMemStatManager.h.

Referenced by AllocHook(), and Disable().

TMemStatDepend::FreeHookFunc_t TMemStatManager::fPreviousFreeHook [protected]

old malloc function

Definition at line 121 of file TMemStatManager.h.

Referenced by Disable(), and FreeHook().

TMemStatInfoStamp TMemStatManager::fLastStamp [protected]

Definition at line 130 of file TMemStatManager.h.

Referenced by AddPointer().

TMemStatInfoStamp TMemStatManager::fCurrentStamp [protected]

Definition at line 131 of file TMemStatManager.h.

Referenced by AddPointer(), AddStamps(), DumpTo(), and FreePointer().

UInt_t TMemStatManager::fAutoStampSize [protected]

Definition at line 132 of file TMemStatManager.h.

Referenced by AddPointer(), and SetAutoStamp().

UInt_t TMemStatManager::fAutoStampN [protected]

Definition at line 133 of file TMemStatManager.h.

Referenced by AddPointer(), and SetAutoStamp().

UInt_t TMemStatManager::fAutoStampDumpSize [protected]

Definition at line 134 of file TMemStatManager.h.

Referenced by AddStamps(), and SetAutoStamp().

Int_t TMemStatManager::fMinStampSize [protected]

Definition at line 135 of file TMemStatManager.h.

Referenced by AddStamps().

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]

pointer to the table

Definition at line 141 of file TMemStatManager.h.

Referenced by DumpTo().

TTree* TMemStatManager::fDumpTree [protected]

file to dump current information

Definition at line 142 of file TMemStatManager.h.

Referenced by DumpTo().

TTree* TMemStatManager::fDumpSysTree [protected]

tree to dump information

Definition at line 143 of file TMemStatManager.h.

Referenced by DumpTo().

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().


The documentation for this class was generated from the following files:
Generated on Tue Jul 5 16:42:56 2011 for ROOT_528-00b_version by  doxygen 1.5.1