QPanda3
0.1.0
Supported by OriginQ
|
Parser for linux perf callgraph output. More...
Public Member Functions | |
__init__ (self, infile) | |
readline (self) | |
parse (self) | |
parse_event (self) | |
parse_callchain (self) | |
parse_call (self) | |
Public Member Functions inherited from pyqpanda3.profiling.gprof2dot.LineParser | |
lookahead (self) | |
consume (self) | |
eof (self) | |
Public Member Functions inherited from pyqpanda3.profiling.gprof2dot.Parser |
Public Attributes | |
profile = Profile() | |
Public Attributes inherited from pyqpanda3.profiling.gprof2dot.LineParser | |
int | line_no = 0 |
Static Public Attributes | |
call_re = re.compile(r'^\s+(?P<module>.*)`(?P<symbol>.*)') | |
addr2_re = re.compile(r'\+0x[0-9a-fA-F]+$') | |
Static Public Attributes inherited from pyqpanda3.profiling.gprof2dot.LineParser | |
XML_ELEMENT_START | |
XML_ELEMENT_END | |
XML_CHARACTER_DATA | |
XML_EOF | |
Static Public Attributes inherited from pyqpanda3.profiling.gprof2dot.Parser | |
bool | stdinInput = True |
bool | multipleInput = False |
Additional Inherited Members | |
Protected Attributes inherited from pyqpanda3.profiling.gprof2dot.LineParser | |
_stream = stream | |
Parser for linux perf callgraph output.
It expects output generated with
# Refer to https://github.com/brendangregg/FlameGraph#dtrace # 60 seconds of user-level stacks, including time spent in-kernel, for PID 12345 at 97 Hertz sudo dtrace -x ustackframes=100 -n 'profile-97 /pid == 12345/ { @[ustack()] = count(); } tick-60s { exit(0); }' -o out.user_stacks # The dtrace output gprof2dot.py -f dtrace out.user_stacks # Notice: sometimes, the dtrace outputs format may be latin-1, and gprof2dot will fail to parse it. # To solve this problem, you should use iconv to convert to UTF-8 explicitly. # TODO: add an encoding flag to tell gprof2dot how to decode the profile file. iconv -f ISO-8859-1 -t UTF-8 out.user_stacks | gprof2dot.py -f dtrace
pyqpanda3.profiling.gprof2dot.DtraceParser.__init__ | ( | self, | |
infile ) |
Reimplemented from pyqpanda3.profiling.gprof2dot.LineParser.
pyqpanda3.profiling.gprof2dot.DtraceParser.parse | ( | self | ) |
Reimplemented from pyqpanda3.profiling.gprof2dot.Parser.
pyqpanda3.profiling.gprof2dot.DtraceParser.parse_call | ( | self | ) |
pyqpanda3.profiling.gprof2dot.DtraceParser.parse_callchain | ( | self | ) |
pyqpanda3.profiling.gprof2dot.DtraceParser.parse_event | ( | self | ) |
pyqpanda3.profiling.gprof2dot.DtraceParser.readline | ( | self | ) |
Reimplemented from pyqpanda3.profiling.gprof2dot.LineParser.
|
static |
|
static |
pyqpanda3.profiling.gprof2dot.DtraceParser.profile = Profile() |