ROOT logo
// @(#)root/treeviewer:$Id: TMemStatShow.h 37300 2010-12-05 17:25:20Z brun $
// Author: Rene Brun   21/09/2010

/*************************************************************************
 * Copyright (C) 1995-2010, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TMemStatShow
#define ROOT_TMemStatShow



//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TMemStatShow                                                         //
//                                                                      //
// class to visualize the results of TMemStat                           //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TObject
#include "TObject.h"
#endif

class TTree;
class TH1D;
class TH1I;
class TGToolTip;
class TObjArray;
class TCanvas;

class TMemStatShow : public TObject {
   
protected:
   static TTree     *fgT;        //TMemStat Tree
   static TH1D      *fgHalloc;   //histogram with allocations
   static TH1D      *fgHfree;    //histogram with frees
   static TH1D      *fgH;        //histogram with allocations - frees
   static TH1I      *fgHleaks;   //histogram with leaks
   static TH1I      *fgHentry;   //histogram with entry numbers in the TObjArray
   static TH1I      *fgHdiff;    //histogram with diff of entry number between alloc/free
   
   static TGToolTip *fgTip1;     //pointer to tool tip for canvas 1
   static TGToolTip *fgTip2;     //pointer to tool tip for canvas 2
   static TObjArray *fgBtidlist; //list of back trace ids
   static Double_t  *fgV1;       //pointer to V1 array of TTree::Draw (pos)
   static Double_t  *fgV2;       //pointer to V2 array of TTree::Draw (nbytes)
   static Double_t  *fgV3;       //pointer to V3 array of TTree::Draw (time)
   static Double_t  *fgV4;       //pointer to V4 array of TTree::Draw (btid)
   static TCanvas   *fgC1;       //pointer to canvas showing allocs/deallocs vs time
   static TCanvas   *fgC2;       //pointer to canvas with leaks in decreasing order
   static TCanvas   *fgC3;       //pointer to canvas showing the main leaks
   
   static Long64_t fgAddressFirst; //first address to process
   static Long64_t fgAddressN;     //number of addresses in bytes to process
   static Long64_t fgEntryFirst;   //first entry to process
   static Long64_t fgEntryN;       //number of entries to process

public:
   TMemStatShow() {;}
   virtual   ~TMemStatShow() {;}
   static void EventInfo1(Int_t event, Int_t px, Int_t py, TObject *selected);
   static void EventInfo2(Int_t event, Int_t px, Int_t py, TObject *selected);
   static void FillBTString(Int_t bin, Int_t mode, TString &btstring);
   
   static void SetAddressRange(Long64_t nbytes=0, Long64_t first=0);
   static void SetEntryRange(Long64_t nentries=0, Long64_t first=0);
   static void Show(Double_t update=0.1, Int_t nbigleaks=20, const char* fname="*");

   ClassDef(TMemStatShow,0)  //class to visualize the results of TMemStat 
};

#endif
 TMemStatShow.h:1
 TMemStatShow.h:2
 TMemStatShow.h:3
 TMemStatShow.h:4
 TMemStatShow.h:5
 TMemStatShow.h:6
 TMemStatShow.h:7
 TMemStatShow.h:8
 TMemStatShow.h:9
 TMemStatShow.h:10
 TMemStatShow.h:11
 TMemStatShow.h:12
 TMemStatShow.h:13
 TMemStatShow.h:14
 TMemStatShow.h:15
 TMemStatShow.h:16
 TMemStatShow.h:17
 TMemStatShow.h:18
 TMemStatShow.h:19
 TMemStatShow.h:20
 TMemStatShow.h:21
 TMemStatShow.h:22
 TMemStatShow.h:23
 TMemStatShow.h:24
 TMemStatShow.h:25
 TMemStatShow.h:26
 TMemStatShow.h:27
 TMemStatShow.h:28
 TMemStatShow.h:29
 TMemStatShow.h:30
 TMemStatShow.h:31
 TMemStatShow.h:32
 TMemStatShow.h:33
 TMemStatShow.h:34
 TMemStatShow.h:35
 TMemStatShow.h:36
 TMemStatShow.h:37
 TMemStatShow.h:38
 TMemStatShow.h:39
 TMemStatShow.h:40
 TMemStatShow.h:41
 TMemStatShow.h:42
 TMemStatShow.h:43
 TMemStatShow.h:44
 TMemStatShow.h:45
 TMemStatShow.h:46
 TMemStatShow.h:47
 TMemStatShow.h:48
 TMemStatShow.h:49
 TMemStatShow.h:50
 TMemStatShow.h:51
 TMemStatShow.h:52
 TMemStatShow.h:53
 TMemStatShow.h:54
 TMemStatShow.h:55
 TMemStatShow.h:56
 TMemStatShow.h:57
 TMemStatShow.h:58
 TMemStatShow.h:59
 TMemStatShow.h:60
 TMemStatShow.h:61
 TMemStatShow.h:62
 TMemStatShow.h:63
 TMemStatShow.h:64
 TMemStatShow.h:65
 TMemStatShow.h:66
 TMemStatShow.h:67
 TMemStatShow.h:68
 TMemStatShow.h:69
 TMemStatShow.h:70
 TMemStatShow.h:71
 TMemStatShow.h:72
 TMemStatShow.h:73
 TMemStatShow.h:74
 TMemStatShow.h:75
 TMemStatShow.h:76
 TMemStatShow.h:77