Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gprof2Dot can't parse my prof file :/ #75

Closed
portnov opened this issue Sep 25, 2021 · 2 comments
Closed

Gprof2Dot can't parse my prof file :/ #75

portnov opened this issue Sep 25, 2021 · 2 comments
Labels

Comments

@portnov
Copy link

portnov commented Sep 25, 2021

I have a .prof file, which is generated by python 3.9.2 which is built into Blender 2.93.1.
Now I try to parse it with my system's python 3.9.2:

[portnov]$ python3 ./gprof2dot.py /tmp/test.prof                                                          master [9:58]
Traceback (most recent call last):
  File "/home/portnov/src/gprof2dot/./gprof2dot.py", line 3555, in <module>
    main()
  File "/home/portnov/src/gprof2dot/./gprof2dot.py", line 3509, in main
    profile = parser.parse()
  File "/home/portnov/src/gprof2dot/./gprof2dot.py", line 1322, in parse
    self.parse_cg()
  File "/home/portnov/src/gprof2dot/./gprof2dot.py", line 1304, in parse_cg
    while not self._cg_header_re.match(self.readline()):
  File "/home/portnov/src/gprof2dot/./gprof2dot.py", line 1142, in readline
    line = self.fp.readline()
  File "/usr/lib/python3.9/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfb in position 0: invalid start byte

I also tried with Blender's python, just in case the problem is in python's compilation options:

[portnov]$ ~/soft/blender-2.93.1-linux-x64/2.93/python/bin/python3.9 ./gprof2dot.py /tmp/test.prof       master [10:01]
Traceback (most recent call last):
  File "/home/portnov/src/gprof2dot/./gprof2dot.py", line 3555, in <module>
    main()
  File "/home/portnov/src/gprof2dot/./gprof2dot.py", line 3509, in main
    profile = parser.parse()
  File "/home/portnov/src/gprof2dot/./gprof2dot.py", line 1322, in parse
    self.parse_cg()
  File "/home/portnov/src/gprof2dot/./gprof2dot.py", line 1304, in parse_cg
    while not self._cg_header_re.match(self.readline()):
  File "/home/portnov/src/gprof2dot/./gprof2dot.py", line 1142, in readline
    line = self.fp.readline()
  File "/home/portnov/soft/blender-2.93.1-linux-x64/2.93/python/lib/python3.9/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfb in position 0: invalid start byte

No luck either :/

Attaching prof file:
test.zip

Also note: https://github.com/baverman/flameprof tool parses the same file successfully.

@jrfonseca
Copy link
Owner

:/

Please refer to the documentation about Python profilers on https://github.com/jrfonseca/gprof2dot#python-profile .

Note in particular the -f pstats option. Without -f option gprof2dot believes the input is gprof format.

@portnov
Copy link
Author

portnov commented Sep 25, 2021

Thanks, -f pstats worked!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants