39TMemStatMng::TMemStatMng():
41#if !defined(__APPLE__)
47 fUseGNUBuiltinBacktrace(
kFALSE),
96 fHbtids =
new TH1I(
"btids",
"table of btids", 10000, 0, 1);
197 Info(
"~TMemStatMng",
">>> All free/malloc calls count: %d",
fBTIDCount);
236#if defined(__APPLE__)
253#if defined(__APPLE__)
254 TMemStatHook::untrackZoneMalloc();
309 void *result =
malloc(size);
345 void **stackPointers)
347 static Int_t old_btid = -1;
351 bool startCheck(
false);
354 if(old_digest.
fValue[i] != CRCdigest[i]) {
369 CRCSet_t::const_iterator found =
fBTChecksums.find(CRCdigest);
375 if(
fBTCount + stackEntries + 1 >= nbins) {
383 if(stackEntries <= 0) {
385 "A number of stack entries is equal or less than zero. For btid %d", ret_val);
389 std::pair<CRCSet_t::iterator, bool> res =
fBTChecksums.insert(CRCSet_t::value_type(CRCdigest, ret_val));
391 Error(
"AddPointer",
"Can't added a new BTID to the container.");
394 for(
int i = 0; i < stackEntries; ++i) {
400 strFuncAddr += func_addr;
409 Error(
"AddPointer",
"Can't add a function return address to the container");
418 ret_val = found->second;
438 md5.
Update(
reinterpret_cast<UChar_t*
>(stptr),
sizeof(
void*) * stackentries);
448 Error(
"AddPointer",
"bad BT id");
483 if (posj != pos)
break;
484 if (indmin > indj) indmin = indj;
485 if (indmax < indj) indmax = indj;
495 for (i=0;i<
fBufN;i++) {
unsigned long long ULong64_t
char * Form(const char *fmt,...)
R__EXTERN TSystem * gSystem
bool add(ULong_t addr, Int_t idx)
Bool_t fUseGNUBuiltinBacktrace
Int_t generateBTID(UChar_t *CRCdigest, Int_t stackEntries, void **stackPointers)
An internal function, which returns a bitid for a corresponding CRC digest cache variables.
static void MacAllocHook(void *ptr, size_t size)
AllocHook - a static function a special memory hook for Mac OS X memory zones.
TMemStatHook::FreeHookFunc_t fPreviousFreeHook
old malloc function
static void FreeHook(void *ptr, const void *)
FreeHook - a static function A glibc memory deallocation hook.
static void MacFreeHook(void *ptr)
AllocHook - a static function a special memory hook for Mac OS X memory zones.
static TMemStatMng * fgInstance
tree to dump information
void Disable()
Disble memory hooks.
TMemStatFAddrContainer fFAddrs
static void * AllocHook(size_t size, const void *)
AllocHook - a static function A glibc memory allocation hook.
TTree * fDumpTree
file to dump current information
virtual ~TMemStatMng()
if an instance is destructed - the hooks are reseted to old hooks
void Init()
old free function
void Enable()
Enable memory hooks.
void SetBufferSize(Int_t buffersize)
Set the maximum number of alloc/free calls to be buffered.
TMemStatHook::MallocHookFunc_t fPreviousMallocHook
void AddPointer(void *ptr, Int_t size)
Add pointer to table.
static void Close()
Close - a static function This method stops the manager, flashes all the buffered data and closes the...
void SetMaxCalls(Int_t maxcalls)
Set the maximum number of new/delete registered in the output Tree.
void FillTree()
loop on all entries in the buffer and fill the output Tree entries with alloc and free in the buffer ...
static TMemStatMng * GetInstance()
GetInstance - a static function Initialize a singleton of MemStat manager.
const Int_t * GetArray() const
void SetName(const char *name)
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
virtual Long64_t GetEND() const
1-D histogram with an int per channel (see TH1 documentation)}
virtual void SetDirectory(TDirectory *dir)
By default when an histogram is created, it is added to the list of histogram objects in the current ...
virtual Int_t GetNbinsX() const
virtual void SetBins(Int_t nx, Double_t xmin, Double_t xmax)
Redefine x axis parameters.
virtual void Add(TObject *obj)
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
This code implements the MD5 message-digest algorithm.
void Update(const UChar_t *buf, UInt_t len)
Update TMD5 object to reflect the concatenation of another buffer full of bytes.
void Final()
MD5 finalization, ends an MD5 message-digest operation, writing the the message digest and zeroizing ...
static void SetMallocHook(MallocHookFunc_t p)
SetMallocHook - a static function Set pointer to function replacing alloc function.
static void SetFreeHook(FreeHookFunc_t p)
SetFreeHook - a static function Set pointer to function replacing free function.
The TNamed class is the base class for all named ROOT classes.
virtual const char * GetName() const
Returns name of object.
Int_t GetEntriesFast() const
Mother of all ROOT objects.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
virtual const char * GetBuildNode() const
Return the build node name.
virtual const char * GetBuildCompilerVersion() const
Return the build compiler version.
virtual int GetPid()
Get process id.
virtual const char * GetFlagsDebug() const
Return the debug flags.
virtual const char * GetFlagsOpt() const
Return the optimization flags.
void Set()
Set Date/Time to current time as reported by the system.
Double_t AsDouble() const
A TTree represents a columnar dataset.
virtual Int_t Fill()
Fill all branches.
virtual void SetAutoSave(Long64_t autos=-300000000)
This function may be called at the start of a program to change the default value for fAutoSave (and ...
virtual Long64_t GetEntries() const
virtual Long64_t AutoSave(Option_t *option="")
AutoSave tree header every fAutoSave bytes.
TBranch * Branch(const char *name, T *obj, Int_t bufsize=32000, Int_t splitlevel=99)
Add a new branch, and infer the data type from the type of obj being passed.
virtual TList * GetUserInfo()
Return a pointer to the list containing user objects associated to this tree.
const UShort_t g_digestSize
void getSymbolFullInfo(void *_pAddr, TString *_retInfo, const char *const _seporator=" | ")
size_t getBacktrace(void **_trace, size_t _size, Bool_t _bUseGNUBuiltinBacktrace=kFALSE)
Get the backtrace _trace - array of pointers _size - maximal deepness of stack information _bUseGNUBu...
const size_t g_BTStackLevel
static Roo_reg_AGKInteg1D instance
static constexpr double nm
void Sort(Index n, const Element *a, Index *index, Bool_t down=kTRUE)
UChar_t fValue[g_digestSize]