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 11 of file lsprofcalltree.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 12 of file lsprofcalltree.py.

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

Member Function Documentation

◆ _entry()

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

Definition at line 30 of file lsprofcalltree.py.

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

◆ _print_summary()

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

Definition at line 23 of file lsprofcalltree.py.

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

◆ _subentry()

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

Definition at line 57 of file lsprofcalltree.py.

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

◆ output()

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

Definition at line 16 of file lsprofcalltree.py.

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

Member Data Documentation

◆ data

python.ext.lsprofcalltree.KCacheGrind.data

Definition at line 13 of file lsprofcalltree.py.

◆ out_file

python.ext.lsprofcalltree.KCacheGrind.out_file

Definition at line 14 of file lsprofcalltree.py.


The documentation for this class was generated from the following file:
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
python.ext.lsprofcalltree.label
def label(code)
Definition: lsprofcalltree.py:3
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:25
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
python.CaloAddPedShiftConfig.int
int
Definition: CaloAddPedShiftConfig.py:45