QPanda3  0.1.0
Supported by OriginQ
Loading...
Searching...
No Matches
pyqpanda3.profiling.gprof2dot Namespace Reference

Generate a dot graph from the output of several profilers. More...

Classes

class  AXEParser
 
class  Call
 A call between functions. More...
 
class  CallgrindParser
 Parser for valgrind's callgrind tool. More...
 
class  CollapseParser
 Parser for the output of stackcollapse. More...
 
class  Cycle
 A cycle made from recursive function calls. More...
 
class  DotWriter
 Writer for the DOT language. More...
 
class  DtraceParser
 Parser for linux perf callgraph output. More...
 
class  Event
 Describe a kind of event, and its basic operations. More...
 
class  Function
 A function. More...
 
class  GprofParser
 Parser for GNU gprof output. More...
 
class  HProfParser
 Parser for java hprof output. More...
 
class  JsonParser
 Parser for a custom JSON representation of profile data. More...
 
class  LineParser
 Base class for parsers that read line-based formats. More...
 
class  Object
 Base class for all objects in profile which can store events. More...
 
class  OprofileParser
 Parser for oprofile callgraph output. More...
 
class  ParseError
 Raised when parsing to signal mismatches. More...
 
class  Parser
 Parser interface. More...
 
class  PerfParser
 Parser for linux perf callgraph output. More...
 
class  Profile
 The whole profile. More...
 
class  PstatsParser
 Parser python profiling statistics saved with te pstats module. More...
 
class  SleepyParser
 Parser for GNU gprof output. More...
 
class  Struct
 Masquerade a dictionary with a structure-like behavior. More...
 
class  SysprofParser
 
class  Theme
 Output. More...
 
class  UndefinedEvent
 Raised when attempting to get an event which is undefined. More...
 
class  XmlParser
 Base XML document parser. More...
 
class  XmlToken
 
class  XmlTokenizer
 Expat based XML tokenizer. More...
 
class  XmlTokenMismatch
 
class  XPerfParser
 Parser for CSVs generated by XPerf, from Microsoft Windows Performance Tools. More...
 

Functions

 times (x)
 
 percentage (p)
 
 add (a, b)
 
 fail (a, b)
 
 ratio (numerator, denominator)
 
 sorted_iteritems (d)
 
 naturalJoin (values)
 
str gprof2dot (str gprof_str)
 
 main (argv=sys.argv[1:])
 Main program.
 

Variables

 MULTIPLICATION_SIGN = chr(0xd7)
 Model.
 
int tol = 2 ** -23
 
 CALLS = Event("Calls", 0, add, times)
 
 SAMPLES = Event("Samples", 0, add, times)
 
 SAMPLES2 = Event("Samples", 0, add, times)
 
 TOTAL_SAMPLES = Event("Samples", 0, add, times)
 
 TIME = Event("Time", 0.0, add, lambda x: '(' + str(x) + ')')
 
 TIME_RATIO = Event("Time ratio", 0.0, add, lambda x: '(' + percentage(x) + ')')
 
 TOTAL_TIME = Event("Total time", 0.0, fail)
 
 TOTAL_TIME_RATIO = Event("Total time ratio", 0.0, fail, percentage)
 
dict labels
 
list defaultLabelNames = ['total-time-percentage', 'self-time-percentage']
 
str totalMethod = 'callratios'
 
dict formats
 
 TEMPERATURE_COLORMAP
 
 PINK_COLORMAP
 
 GRAY_COLORMAP
 
 BW_COLORMAP
 
 PRINT_COLORMAP
 
dict themes
 
str content = ""
 

Detailed Description

Generate a dot graph from the output of several profilers.

Function Documentation

◆ add()

pyqpanda3.profiling.gprof2dot.add ( a,
b )

◆ fail()

pyqpanda3.profiling.gprof2dot.fail ( a,
b )

◆ gprof2dot()

str pyqpanda3.profiling.gprof2dot.gprof2dot ( str gprof_str)

◆ main()

pyqpanda3.profiling.gprof2dot.main ( argv = sys.argv[1:])

Main program.

◆ naturalJoin()

pyqpanda3.profiling.gprof2dot.naturalJoin ( values)

◆ percentage()

pyqpanda3.profiling.gprof2dot.percentage ( p)

◆ ratio()

pyqpanda3.profiling.gprof2dot.ratio ( numerator,
denominator )

◆ sorted_iteritems()

pyqpanda3.profiling.gprof2dot.sorted_iteritems ( d)

◆ times()

pyqpanda3.profiling.gprof2dot.times ( x)

Variable Documentation

◆ BW_COLORMAP

pyqpanda3.profiling.gprof2dot.BW_COLORMAP
Initial value:
1= Theme(
2 minfontsize=8.0,
3 maxfontsize=24.0,
4 mincolor=(0.0, 0.0, 0.0), # black
5 maxcolor=(0.0, 0.0, 0.0), # black
6 minpenwidth=0.1,
7 maxpenwidth=8.0,
8)

◆ CALLS

pyqpanda3.profiling.gprof2dot.CALLS = Event("Calls", 0, add, times)

◆ content

str pyqpanda3.profiling.gprof2dot.content = ""

◆ defaultLabelNames

list pyqpanda3.profiling.gprof2dot.defaultLabelNames = ['total-time-percentage', 'self-time-percentage']

◆ formats

dict pyqpanda3.profiling.gprof2dot.formats
Initial value:
1= {
2 "axe": AXEParser,
3 "callgrind": CallgrindParser,
4 "collapse": CollapseParser,
5 "hprof": HProfParser,
6 "json": JsonParser,
7 "oprofile": OprofileParser,
8 "perf": PerfParser,
9 "prof": GprofParser,
10 "pstats": PstatsParser,
11 "sleepy": SleepyParser,
12 "sysprof": SysprofParser,
13 "xperf": XPerfParser,
14 "dtrace": DtraceParser,
15}

◆ GRAY_COLORMAP

pyqpanda3.profiling.gprof2dot.GRAY_COLORMAP
Initial value:
1= Theme(
2 mincolor=(0.0, 0.0, 0.85), # light gray
3 maxcolor=(0.0, 0.0, 0.0), # black
4)

◆ labels

dict pyqpanda3.profiling.gprof2dot.labels
Initial value:
1= {
2 #'self-time': TIME,
3 #'self-time-percentage': TIME_RATIO,
4 #'total-time': TOTAL_TIME,
5 'total-time-percentage': TOTAL_TIME_RATIO,
6}

◆ MULTIPLICATION_SIGN

pyqpanda3.profiling.gprof2dot.MULTIPLICATION_SIGN = chr(0xd7)

Model.

◆ PINK_COLORMAP

pyqpanda3.profiling.gprof2dot.PINK_COLORMAP
Initial value:
1= Theme(
2 mincolor=(0.0, 1.0, 0.90), # pink
3 maxcolor=(0.0, 1.0, 0.5), # satured red
4)

◆ PRINT_COLORMAP

pyqpanda3.profiling.gprof2dot.PRINT_COLORMAP
Initial value:
1= Theme(
2 minfontsize=18.0,
3 maxfontsize=30.0,
4 fontcolor="black",
5 nodestyle="solid",
6 mincolor=(0.0, 0.0, 0.0), # black
7 maxcolor=(0.0, 0.0, 0.0), # black
8 minpenwidth=0.1,
9 maxpenwidth=8.0,
10)

◆ SAMPLES

pyqpanda3.profiling.gprof2dot.SAMPLES = Event("Samples", 0, add, times)

◆ SAMPLES2

pyqpanda3.profiling.gprof2dot.SAMPLES2 = Event("Samples", 0, add, times)

◆ TEMPERATURE_COLORMAP

pyqpanda3.profiling.gprof2dot.TEMPERATURE_COLORMAP
Initial value:
1= Theme(
2 mincolor=(2.0 / 3.0, 0.80, 0.25), # dark blue
3 maxcolor=(0.0, 1.0, 0.5), # satured red
4 gamma=1.0
5)

◆ themes

dict pyqpanda3.profiling.gprof2dot.themes
Initial value:
1= {
2 "color": TEMPERATURE_COLORMAP,
3 "pink": PINK_COLORMAP,
4 "gray": GRAY_COLORMAP,
5 "bw": BW_COLORMAP,
6 "print": PRINT_COLORMAP,
7}

◆ TIME

pyqpanda3.profiling.gprof2dot.TIME = Event("Time", 0.0, add, lambda x: '(' + str(x) + ')')

◆ TIME_RATIO

pyqpanda3.profiling.gprof2dot.TIME_RATIO = Event("Time ratio", 0.0, add, lambda x: '(' + percentage(x) + ')')

◆ tol

int pyqpanda3.profiling.gprof2dot.tol = 2 ** -23

◆ TOTAL_SAMPLES

pyqpanda3.profiling.gprof2dot.TOTAL_SAMPLES = Event("Samples", 0, add, times)

◆ TOTAL_TIME

pyqpanda3.profiling.gprof2dot.TOTAL_TIME = Event("Total time", 0.0, fail)

◆ TOTAL_TIME_RATIO

pyqpanda3.profiling.gprof2dot.TOTAL_TIME_RATIO = Event("Total time ratio", 0.0, fail, percentage)

◆ totalMethod

str pyqpanda3.profiling.gprof2dot.totalMethod = 'callratios'