All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PerfCount.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <cvmx.h>
4 #include "logging.h"
5 
7 {
8 public:
9 
10  virtual int NrOfCounters()
11  {
12  return 0;
13  }
14 
15  virtual const char *ToName(int iIndex)
16  {
17  return "Empty";
18  }
19 
20  virtual const char *ToFilter(int iIndex)
21  {
22  return "Empty";
23  }
24 
25  virtual const char *UniqueMemName()
26  {
27  return "Empty";
28  }
29 };
30 
31 
32 
33 
35 {
36 public:
37 
38  void Reset ();
39  void Add (int iIndex);
40  void Sub (int iIndex);
41  int64_t Get (int iIndex);
42  int64_t Count (const char *sFilter, bool bInvert = false);
43  int64_t Count (const char *sFilter1, bool bNot1, const char *sFilter2, bool bNot2);
44  int GetNrOfCounters(void);
45  void Show (const char *sTitle);
46  void Show (const char *sTitle, const char *sFilter, bool bInvert = false);
47  void ShowNonZero (const char *sTitle);
48  void ShowNonZero (const char *sTitle, const char *sFilter, bool bInvert = false);
50 
51  private:
52 
53  void Filter (const char *sTitle, const char *sFilter, bool bUseWildCard, bool bInvertWildCard,
54  bool bOnlyNonZero);
55  int64_t FilterCount (const char *sFilter, bool bUseWildCard, bool bInvertWildCard);
56  bool WildCompare (const char *wildcard, const char *string);
57  virtual void Log (CLogging::EType eType, const char *pcMsg, ...);
58 
59 
60  CPerfCounterInterface *m_pPI;
61  int64_t *m_pMem;
62  int m_iNrOfCounters;
63  static CPerfCount *m_pInstance;
64 
65 
66 };
void Show(const char *sTitle)
virtual int NrOfCounters()
Definition: PerfCount.h:10
virtual const char * ToFilter(int iIndex)
Definition: PerfCount.h:20
CPerfCount(CPerfCounterInterface *pi)
virtual const char * UniqueMemName()
Definition: PerfCount.h:25
int64_t Get(int iIndex)
void Sub(int iIndex)
void Add(int iIndex)
int GetNrOfCounters(void)
int64_t Count(const char *sFilter, bool bInvert=false)
void ShowNonZero(const char *sTitle)
virtual const char * ToName(int iIndex)
Definition: PerfCount.h:15
void Reset()