sawsen11 / jrfonseca

Automatically exported from code.google.com/p/jrfonseca
0 stars 0 forks source link

[gprof2dot] assert inevent in function on OSX 10.6.8 #82

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Use script under OSX 10.6.8 with the call:

gprof examples-osx-library/01_HelloWorld | gprof2dot.py | dot -Tpng -o 
output.png

it creates the error:

Traceback (most recent call last):
  File "/opt/local/bin/gprof2dot.py", line 2935, in <module>
    Main().main()
  File "/opt/local/bin/gprof2dot.py", line 2901, in main
    self.profile = parser.parse()
  File "/opt/local/bin/gprof2dot.py", line 1113, in parse
    profile.ratio(TIME_RATIO, TIME)
  File "/opt/local/bin/gprof2dot.py", line 563, in ratio
    assert inevent in function
AssertionError

Original issue reported on code.google.com by philipp....@flashpixx.de on 5 Apr 2013 at 10:03

GoogleCodeExporter commented 9 years ago
Please provide me the output of "gprof examples-osx-library/01_HelloWorld"

Original comment by Jose.R.F...@gmail.com on 8 Apr 2013 at 5:23

GoogleCodeExporter commented 9 years ago
here you are. Thx

Original comment by philipp....@flashpixx.de on 8 Apr 2013 at 5:41

Attachments:

GoogleCodeExporter commented 9 years ago
It looks like MacOSX's gprof is busted, it is truncating functions ID. Where it 
say:

                                       4             __ZN3irr5video11CNullDriver22setTextureCreationFlagENS0_23E_TEXTURE_CREATION_FLAGEb [123415]
[12341   0.0    0.00        0.00       0+4      
__ZN3irr5video11CNullDriver22setTextureCreationFlagENS0_23E_TEXTURE_CREATION_FLA
GEb [123415]
                0.00        0.00       2/45          __ZN3irr5video11CNullDriverC2EPNS_2io11IFileSystemERKNS_4core11dimension2dIjEE [43583]
                                       4             __ZN3irr5video11CNullDriver22setTextureCreationFlagENS0_23E_TEXTURE_CREATION_FLAGEb [123415]

It should actually be "[123415]" isntead of "[12341".

I'm afraid there's nothing further I can do in gprof2dot. As they say "garbagge 
in, garbagge out"...

Maybe there is some way (some option?) that one can pass to MacOSX gprof to not 
do this.

You might also get better results using MacOSX Shark Profiler, which is also 
supported by gprof2dot.

Original comment by Jose.R.F...@gmail.com on 8 Apr 2013 at 7:00

GoogleCodeExporter commented 9 years ago
Damn, I have tested Shark, but how can I push the shark data to gprof2dot.py?
I have exported the shark data to a cfg file but it seems this a binary format

Original comment by philipp....@flashpixx.de on 8 Apr 2013 at 8:32

GoogleCodeExporter commented 9 years ago
Yeah, doc is nill. I didn't write support for it myself.

I only did it once. I believe one needs to copy'n'paste from Shark.

I'll try to do it tomorrow and write some docs. I thought I had last time..

Original comment by Jose.R.F...@gmail.com on 8 Apr 2013 at 9:36

GoogleCodeExporter commented 9 years ago
Thanks, don't hurry

Original comment by philipp....@flashpixx.de on 8 Apr 2013 at 9:42

GoogleCodeExporter commented 9 years ago
It looks like Apple replaced Shark with a new tool called Intruments.

I tried it but the format is different.

So I'm afraid I can't help you. Maybe somebody will come along and add support 
for Instruments into gprof2dot.

I'm going to remove Shark support from gprof2dot.py .

Original comment by Jose.R.F...@gmail.com on 9 Apr 2013 at 1:58

GoogleCodeExporter commented 9 years ago
I've created a new issue, issue 83, with some details in case anybody wants to 
start.

Original comment by Jose.R.F...@gmail.com on 9 Apr 2013 at 2:08