ATLAS Offline Software
Loading...
Searching...
No Matches
python.ext.lsprofcalltree.KCacheGrind Class Reference
Inheritance diagram for python.ext.lsprofcalltree.KCacheGrind:
Collaboration diagram for python.ext.lsprofcalltree.KCacheGrind:

Public Types

typedef HLT::TypeInformation::for_each_type_c< typenameEDMLIST::map, my_functor, my_result<>, my_arg< HLT::TypeInformation::get_cont, CONTAINER > >::type result

Public Member Functions

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

Public Attributes

 data = profiler.getstats()
 out_file = None

Protected Member Functions

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

Detailed Description

Definition at line 11 of file lsprofcalltree.py.

Member Typedef Documentation

◆ result

Definition at line 90 of file EDM_MasterSearch.h.

Constructor & Destructor Documentation

◆ __init__()

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()

python.ext.lsprofcalltree.KCacheGrind._entry ( self,
entry )
protected

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
void print(char *figname, TCanvas *c1)
std::string label(const std::string &format, int i)
Definition label.h:19

◆ _print_summary()

python.ext.lsprofcalltree.KCacheGrind._print_summary ( self)
protected

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
#define max(a, b)
Definition cfImp.cxx:41

◆ _subentry()

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

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()

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 = profiler.getstats()

Definition at line 13 of file lsprofcalltree.py.

◆ out_file

python.ext.lsprofcalltree.KCacheGrind.out_file = None

Definition at line 14 of file lsprofcalltree.py.


The documentation for this class was generated from the following file: