ATLAS Offline Software
Public Member Functions | Public Attributes | Private Member Functions | List of all members
python.ext.lsprofcalltree.KCacheGrind Class Reference
Inheritance diagram for python.ext.lsprofcalltree.KCacheGrind:
Collaboration diagram for python.ext.lsprofcalltree.KCacheGrind:

Public Member Functions

def __init__ (self, profiler)
 
def output (self, out_file)
 

Public Attributes

 data
 
 out_file
 

Private Member Functions

def _print_summary (self)
 
def _entry (self, entry)
 
def _subentry (self, lineno, subentry)
 

Detailed Description

Definition at line 13 of file lsprofcalltree.py.

Constructor & Destructor Documentation

◆ __init__()

def python.ext.lsprofcalltree.KCacheGrind.__init__ (   self,
  profiler 
)

Definition at line 14 of file lsprofcalltree.py.

14  def __init__(self, profiler):
15  self.data = profiler.getstats()
16  self.out_file = None
17 

Member Function Documentation

◆ _entry()

def python.ext.lsprofcalltree.KCacheGrind._entry (   self,
  entry 
)
private

Definition at line 32 of file lsprofcalltree.py.

32  def _entry(self, entry):
33  out_file = self.out_file
34  code = entry.code
35  inlinetime = int(entry.inlinetime * 1000)
36  #print >> out_file, 'ob=%s' % (code.co_filename,)
37  if isinstance(code, str):
38  print_('fi=~', file=out_file)
39  else:
40  print_('fi=%s' % (code.co_filename,), file=out_file)
41  print_('fn=%s' % (label(code),), file=out_file)
42  if isinstance(code, str):
43  print_('0 ', inlinetime, file=out_file)
44  else:
45  print_('%d %d' % (code.co_firstlineno, inlinetime), file=out_file)
46  # recursive calls are counted in entry.calls
47  if entry.calls:
48  calls = entry.calls
49  else:
50  calls = []
51  if isinstance(code, str):
52  lineno = 0
53  else:
54  lineno = code.co_firstlineno
55  for subentry in calls:
56  self._subentry(lineno, subentry)
57  print_(file=out_file)
58 

◆ _print_summary()

def python.ext.lsprofcalltree.KCacheGrind._print_summary (   self)
private

Definition at line 25 of file lsprofcalltree.py.

25  def _print_summary(self):
26  max_cost = 0
27  for entry in self.data:
28  totaltime = int(entry.totaltime * 1000)
29  max_cost = max(max_cost, totaltime)
30  print_('summary: %d' % (max_cost,), file=self.out_file)
31 

◆ _subentry()

def python.ext.lsprofcalltree.KCacheGrind._subentry (   self,
  lineno,
  subentry 
)
private

Definition at line 59 of file lsprofcalltree.py.

59  def _subentry(self, lineno, subentry):
60  out_file = self.out_file
61  code = subentry.code
62  totaltime = int(subentry.totaltime * 1000)
63  #print >> out_file, 'cob=%s' % (code.co_filename,)
64  print_('cfn=%s' % (label(code),), file=out_file)
65  if isinstance(code, str):
66  print_('cfi=~', file=out_file)
67  print_('calls=%d 0' % (subentry.callcount,), file=out_file)
68  else:
69  print_('cfi=%s' % (code.co_filename,), file=out_file)
70  print_('calls=%d %d' % (
71  subentry.callcount, code.co_firstlineno), file=out_file)
72  print_('%d %d' % (lineno, totaltime), file=out_file)

◆ output()

def python.ext.lsprofcalltree.KCacheGrind.output (   self,
  out_file 
)

Definition at line 18 of file lsprofcalltree.py.

18  def output(self, out_file):
19  self.out_file = out_file
20  print_('events: Ticks', file=out_file)
21  self._print_summary()
22  for entry in self.data:
23  self._entry(entry)
24 

Member Data Documentation

◆ data

python.ext.lsprofcalltree.KCacheGrind.data

Definition at line 15 of file lsprofcalltree.py.

◆ out_file

python.ext.lsprofcalltree.KCacheGrind.out_file

Definition at line 16 of file lsprofcalltree.py.


The documentation for this class was generated from the following file:
max
#define max(a, b)
Definition: cfImp.cxx:41
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
python.ext.lsprofcalltree.label
def label(code)
Definition: lsprofcalltree.py:5
merge.output
output
Definition: merge.py:17
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18