ATLAS Offline Software
Public Types | Public Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
CoWTools::CoWRecordStats Class Reference

#include <CoWRecordStats.h>

Collaboration diagram for CoWTools::CoWRecordStats:

Public Types

enum  ValueIdx {
  Size =0, Rss =1, Pss =2, Shared_Clean =3,
  Shared_Dirty =4, Private_Clean =5, Private_Dirty =6, Referenced =7,
  Anonymous =8, AnonHugePages =9, Swap =10, KernelPageSize =11,
  MMUPageSize =12, Locked =13, VmFlags =14
}
 

Public Member Functions

 CoWRecordStats (bool summary=true)
 
CoWRecordStatsoperator+= (const CoWRecordStats &rhs)
 
CoWRecordStatsoperator-= (const CoWRecordStats &rhs)
 
CoWRecordStats operator- () const
 
 operator bool () const
 
void parseRecord (std::istream &in)
 
long long * getValueArray ()
 
const long long * getValueArray () const
 

Private Attributes

long long m_vals [20]
 
bool m_summary
 

Static Private Attributes

static const std::map< std::string, int > s_vmFlags
 

Friends

CoWRecordStats operator+ (const CoWRecordStats &lhs, const CoWRecordStats &rhs)
 
CoWRecordStats operator- (const CoWRecordStats &lhs, const CoWRecordStats &rhs)
 
bool operator< (const CoWRecordStats &a, const CoWRecordStats &b)
 
std::ostream & operator<< (std::ostream &, const CoWTools::CoWRecordStats &m)
 

Detailed Description

Definition at line 13 of file CoWRecordStats.h.

Member Enumeration Documentation

◆ ValueIdx

Enumerator
Size 
Rss 
Pss 
Shared_Clean 
Shared_Dirty 
Private_Clean 
Private_Dirty 
Referenced 
Anonymous 
AnonHugePages 
Swap 
KernelPageSize 
MMUPageSize 
Locked 
VmFlags 

Definition at line 16 of file CoWRecordStats.h.

16  {
17  Size=0,
18  Rss=1,
19  Pss=2,
20  Shared_Clean=3,
21  Shared_Dirty=4,
22  Private_Clean=5,
23  Private_Dirty=6,
24  Referenced=7,
25  Anonymous=8,
26  AnonHugePages=9,
27  Swap=10,
28  KernelPageSize=11,
29  MMUPageSize=12,
30  Locked=13,
31  VmFlags=14
32  };

Constructor & Destructor Documentation

◆ CoWRecordStats()

CoWTools::CoWRecordStats::CoWRecordStats ( bool  summary = true)
inline

Definition at line 15 of file CoWRecordStats.h.

15 :m_summary(summary){};

Member Function Documentation

◆ getValueArray() [1/2]

long long* CoWTools::CoWRecordStats::getValueArray ( )
inline

Definition at line 94 of file CoWRecordStats.h.

94 {return m_vals;}

◆ getValueArray() [2/2]

const long long* CoWTools::CoWRecordStats::getValueArray ( ) const
inline

Definition at line 95 of file CoWRecordStats.h.

95 {return m_vals;}

◆ operator bool()

CoWTools::CoWRecordStats::operator bool ( ) const
inlineexplicit

Definition at line 74 of file CoWRecordStats.h.

74  {
75  for(int i=0;i<11;i++){
76  if(m_vals[i])return true;
77  }
78  return false;
79  }

◆ operator+=()

CoWRecordStats& CoWTools::CoWRecordStats::operator+= ( const CoWRecordStats rhs)
inline

Definition at line 35 of file CoWRecordStats.h.

35  {
36  for(int i=0;i<11;i++){
37  m_vals[i]+=rhs.m_vals[i];
38  }
39  m_vals[13]+=rhs.m_vals[13];
40  //needed only for very detailed
41  //m_vals[14]|=rhs.m_vals[14];
42  return *this;
43  }

◆ operator-()

CoWRecordStats CoWTools::CoWRecordStats::operator- ( ) const
inline

Definition at line 55 of file CoWRecordStats.h.

55  {
57  for(int i=0;i<11;i++){
58  m.m_vals[i]=-m_vals[i];
59  }
60  m.m_vals[11]=m_vals[11];
61  m.m_vals[12]=m_vals[12];
62  m.m_vals[13]=-m_vals[13];
63  m.m_vals[14]=m_vals[14];
64  //needed only for very detailed
65  //m_vals[14]|=rhs.m_vals[14];
66  return m;
67  }

◆ operator-=()

CoWRecordStats& CoWTools::CoWRecordStats::operator-= ( const CoWRecordStats rhs)
inline

Definition at line 45 of file CoWRecordStats.h.

45  {
46  for(int i=0;i<11;i++){
47  m_vals[i]-=rhs.m_vals[i];
48  }
49  m_vals[13]-=rhs.m_vals[13];
50  //needed only for very detailed
51  //m_vals[14]|=rhs.m_vals[14];
52  return *this;
53  }

◆ parseRecord()

void CoWTools::CoWRecordStats::parseRecord ( std::istream &  in)

Definition at line 40 of file CoWRecordStats.cxx.

40  {
41  std::string line;
42  int pos=0;
43  //std::cout<<"in MS"<<std::endl;
44  while(!(std::getline(in,line).eof())){
45  //std::cout<<"MS "<<line<<std::endl;
46  int len=0;
47  unsigned long val=0;
48  char buff[20];
49  sscanf(line.c_str(),"%19s%n",buff,&len);
50  if(strcmp(buff,"VmFlags:")==0){
51  len++;
52  while(len<(int)line.size()){
53  //std::cerr<<"substr="<<line.substr(len,2)<<std::endl;
54  val|=CoWTools::CoWRecordStats::s_vmFlags.at(line.substr(len,2));
55  len+=3;
56  }
57  }else{
58  sscanf(line.c_str()+len,"%8lu",&val);
59  }
60  m_vals[pos]=val;
61  pos++;
62  }
63 }

Friends And Related Function Documentation

◆ operator+

CoWRecordStats operator+ ( const CoWRecordStats lhs,
const CoWRecordStats rhs 
)
friend

Definition at line 68 of file CoWRecordStats.h.

68  {
69  return CoWRecordStats(lhs) += rhs;
70  }

◆ operator-

CoWRecordStats operator- ( const CoWRecordStats lhs,
const CoWRecordStats rhs 
)
friend

Definition at line 71 of file CoWRecordStats.h.

71  {
72  return CoWRecordStats(lhs) -= rhs;
73  }

◆ operator<

bool operator< ( const CoWRecordStats a,
const CoWRecordStats b 
)
friend

Definition at line 80 of file CoWRecordStats.h.

80  {
81  if((a.m_vals[5]+a.m_vals[6])<(b.m_vals[5]+b.m_vals[6])){
82  return true;
83  }else if((a.m_vals[5]+a.m_vals[6])==(b.m_vals[5]+b.m_vals[6])){
84  if((a.m_vals[3]+a.m_vals[4])<(b.m_vals[3]+b.m_vals[4])){
85  return true;
86  }else if((a.m_vals[3]+a.m_vals[4])==(b.m_vals[3]+b.m_vals[4])){
87  return (a.m_vals[1]<b.m_vals[1]);
88  }
89  return false;
90  }
91  return false;
92  }

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const CoWTools::CoWRecordStats m 
)
friend

Definition at line 67 of file CoWRecordStats.cxx.

67  {
68  if(m.m_summary){
69  char buff[2048];
70  snprintf(buff,2048,"VMem= %8lld, RSS= %8lld, PSS= %8lld, Shared= %8lld, Private= %8lld, Swap= %8lld Anon= %8lld",
71  m.m_vals[0],m.m_vals[1],m.m_vals[2],m.m_vals[3]+m.m_vals[4],m.m_vals[5]+m.m_vals[6],m.m_vals[10],m.m_vals[8]);
72  out<<buff;
73  }else{
74  char buff[4000];
75  snprintf(buff,4000,
76  "Size: %8lld kB\n" \
77  "Rss: %8lld kB\n" \
78  "Pss: %8lld kB\n" \
79  "Shared_Clean: %8lld kB\n" \
80  "Shared_Dirty: %8lld kB\n" \
81  "Private_Clean: %8lld kB\n" \
82  "Private_Dirty: %8lld kB\n" \
83  "Referenced: %8lld kB\n" \
84  "Anonymous: %8lld kB\n" \
85  "AnonHugePages: %8lld kB\n" \
86  "Swap: %8lld kB\n" \
87  "KernelPageSize: %8lld kB\n" \
88  "MMUPageSize: %8lld kB\n" \
89  "Locked: %8lld kB\n",
90  m.m_vals[0],
91  m.m_vals[1],
92  m.m_vals[2],
93  m.m_vals[3],
94  m.m_vals[4],
95  m.m_vals[5],
96  m.m_vals[6],
97  m.m_vals[7],
98  m.m_vals[8],
99  m.m_vals[9],
100  m.m_vals[10],
101  m.m_vals[11],
102  m.m_vals[12],
103  m.m_vals[13]);
104  out<<buff;
105  }
106  return out;
107  }

Member Data Documentation

◆ m_summary

bool CoWTools::CoWRecordStats::m_summary
private

Definition at line 102 of file CoWRecordStats.h.

◆ m_vals

long long CoWTools::CoWRecordStats::m_vals[20]
private
Initial value:
={0,0,0,0,0,
0,0,0,0,0,
0,0,0,0,0,
0,0,0,0,0}

Definition at line 97 of file CoWRecordStats.h.

◆ s_vmFlags

const std::map< std::string, int > CoWTools::CoWRecordStats::s_vmFlags
staticprivate
Initial value:
={
{"rd",0x00000001},
{"wr",0x00000002},
{"ex",0x00000004},
{"sh",0x00000008},
{"mr",0x00000010},
{"mw",0x00000020},
{"me",0x00000040},
{"ms",0x00000060},
{"gd",0x00000080},
{"pf",0x00000100},
{"dw",0x00000200},
{"lo",0x00000400},
{"io",0x00000800},
{"sr",0x00001000},
{"rr",0x00002000},
{"dc",0x00004000},
{"de",0x00008000},
{"ac",0x00010000},
{"nr",0x00020000},
{"ht",0x00040000},
{"nl",0x00080000},
{"ar",0x00100000},
{"dd",0x00200000},
{"sd",0x00400000},
{"mm",0x00800000},
{"hg",0x01000000},
{"nh",0x02000000},
{"mg",0x04000000}
}

Definition at line 103 of file CoWRecordStats.h.


The documentation for this class was generated from the following files:
get_hdefs.buff
buff
Definition: get_hdefs.py:61
checkFileSG.line
line
Definition: checkFileSG.py:75
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
CoWTools::CoWRecordStats::Rss
@ Rss
Definition: CoWRecordStats.h:18
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
CoWTools::CoWRecordStats::AnonHugePages
@ AnonHugePages
Definition: CoWRecordStats.h:26
CoWTools::CoWRecordStats::m_vals
long long m_vals[20]
Definition: CoWRecordStats.h:97
CoWTools::CoWRecordStats::Size
@ Size
Definition: CoWRecordStats.h:17
CoWTools::CoWRecordStats::Shared_Dirty
@ Shared_Dirty
Definition: CoWRecordStats.h:21
CoWTools::CoWRecordStats::Private_Clean
@ Private_Clean
Definition: CoWRecordStats.h:22
CoWTools::CoWRecordStats::s_vmFlags
static const std::map< std::string, int > s_vmFlags
Definition: CoWRecordStats.h:103
lumiFormat.i
int i
Definition: lumiFormat.py:85
CoWTools::CoWRecordStats::VmFlags
@ VmFlags
Definition: CoWRecordStats.h:31
CoWTools::CoWRecordStats::Anonymous
@ Anonymous
Definition: CoWRecordStats.h:25
CoWTools::CoWRecordStats::Swap
@ Swap
Definition: CoWRecordStats.h:27
CoWTools::CoWRecordStats::m_summary
bool m_summary
Definition: CoWRecordStats.h:102
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
CoWTools::CoWRecordStats::Locked
@ Locked
Definition: CoWRecordStats.h:30
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
a
TList * a
Definition: liststreamerinfos.cxx:10
CoWTools::CoWRecordStats::CoWRecordStats
CoWRecordStats(bool summary=true)
Definition: CoWRecordStats.h:15
CoWTools::CoWRecordStats::Pss
@ Pss
Definition: CoWRecordStats.h:19
CoWTools::CoWRecordStats::KernelPageSize
@ KernelPageSize
Definition: CoWRecordStats.h:28
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
CoWTools::CoWRecordStats::Private_Dirty
@ Private_Dirty
Definition: CoWRecordStats.h:23
CoWTools::CoWRecordStats::MMUPageSize
@ MMUPageSize
Definition: CoWRecordStats.h:29
CoWTools::CoWRecordStats::Shared_Clean
@ Shared_Clean
Definition: CoWRecordStats.h:20
CoWTools::CoWRecordStats::Referenced
@ Referenced
Definition: CoWRecordStats.h:24
SCT_Monitoring::summary
@ summary
Definition: SCT_MonitoringNumbers.h:65