ATLAS Offline Software
Classes | Functions | Variables
python.AthDsoLogger Namespace Reference

Classes

class  DsoEvent
 
class  DsoLogger
 

Functions

def __del__ (self)
 
def default_cb_fct (self, evt, usrdata)
 

Variables

string __doc__ = "log the vmem usage at each dso being dlopen'd"
 
string __version__ = "$Revision: 1.3 $"
 
string __author__ = "Sebastien Binet <binet@cern.ch>"
 
 _cb_fct_type
 self.lib.fetch_vmem.argtypes = None self.lib.fetch_vmem.restype = ctypes.c_float More...
 
 fct = self.lib.ath_dso_cbk_register
 
 argtypes
 
 restype
 
 _data
 
 msg
 
 cb_fct = self.default_cb_fct
 
string fname = 'vmem-dso.csv'
 
 _fd
 
 out
 
 delimiter
 

Function Documentation

◆ __del__()

def python.AthDsoLogger.__del__ (   self)

Definition at line 81 of file AthDsoLogger.py.

81  def __del__ (self):
82  # release library
83  self.lib.ath_dso_cbk_unregister(self.cb_fct)
84  self._fd.close()
85 

◆ default_cb_fct()

def python.AthDsoLogger.default_cb_fct (   self,
  evt,
  usrdata 
)

Definition at line 87 of file AthDsoLogger.py.

87  def default_cb_fct (self, evt, usrdata):
88  libname = evt.contents.fname
89  step = evt.contents.step
90 
91  if libname is None:
92  return 0
93  n = _basename (_realpath (libname))
94 
95  pid = os.getpid()
96  def vmem():
97  from os import sysconf
98  PAGE_SIZE = sysconf ('SC_PAGE_SIZE') # in bytes
99 
100  from string import split as ssplit
101  m = 0
102  with open('/proc/self/statm') as f:
103  m = int(ssplit (f.readlines()[0])[0])
104  return m * PAGE_SIZE # in bytes
105 
106  if step == 0:
107  self._data[pid][n] = [vmem(), None]
108  else:
109  data = self._data[pid][n]
110  data[1] = vmem()
111  vmem_start = data[0]/1024.
112  vmem_stop = data[1]/1024.
113  dvmem = vmem_stop - vmem_start
114  self.msg.info (
115  "[%d] loading lib: vmem=(%10.1f + %10.1f) kb [%s]",
116  pid, vmem_start, dvmem, n
117  )
118  self.out.writerow ([pid, n, vmem_start, vmem_stop, dvmem])
119  #del self._data[pid][n]
120  return 0

Variable Documentation

◆ __author__

string python.AthDsoLogger.__author__ = "Sebastien Binet <binet@cern.ch>"
private

Definition at line 10 of file AthDsoLogger.py.

◆ __doc__

string python.AthDsoLogger.__doc__ = "log the vmem usage at each dso being dlopen'd"
private

Definition at line 8 of file AthDsoLogger.py.

◆ __version__

string python.AthDsoLogger.__version__ = "$Revision: 1.3 $"
private

Definition at line 9 of file AthDsoLogger.py.

◆ _cb_fct_type

python.AthDsoLogger._cb_fct_type
private

self.lib.fetch_vmem.argtypes = None self.lib.fetch_vmem.restype = ctypes.c_float

Definition at line 39 of file AthDsoLogger.py.

◆ _data

python.AthDsoLogger._data
private

Definition at line 51 of file AthDsoLogger.py.

◆ _fd

python.AthDsoLogger._fd
private

Definition at line 69 of file AthDsoLogger.py.

◆ argtypes

python.AthDsoLogger.argtypes

Definition at line 43 of file AthDsoLogger.py.

◆ cb_fct

python.AthDsoLogger.cb_fct = self.default_cb_fct

Definition at line 58 of file AthDsoLogger.py.

◆ delimiter

python.AthDsoLogger.delimiter

Definition at line 70 of file AthDsoLogger.py.

◆ fct

python.AthDsoLogger.fct = self.lib.ath_dso_cbk_register

Definition at line 42 of file AthDsoLogger.py.

◆ fname

string python.AthDsoLogger.fname = 'vmem-dso.csv'

Definition at line 66 of file AthDsoLogger.py.

◆ msg

python.AthDsoLogger.msg

Definition at line 54 of file AthDsoLogger.py.

◆ out

python.AthDsoLogger.out

Definition at line 70 of file AthDsoLogger.py.

◆ restype

python.AthDsoLogger.restype

Definition at line 44 of file AthDsoLogger.py.

python.AthDsoLogger.default_cb_fct
def default_cb_fct(self, evt, usrdata)
Definition: AthDsoLogger.py:87
Trk::open
@ open
Definition: BinningType.h:40
python.CaloAddPedShiftConfig.int
int
Definition: CaloAddPedShiftConfig.py:45
python.AthDsoLogger.__del__
def __del__(self)
Definition: AthDsoLogger.py:81
ath_dso_cbk_unregister
int ath_dso_cbk_unregister(ath_dso_event_cbk_t cbk)