All pastes #455636 Raw Edit

Stuff

public text v1 · immutable
·published 2007-04-24 10:30 UTC
rendered paste body
Hi!

I want to compile POY4 to bytecode so I can be able to analyze the OCaml code using the ocamlprof tool. This is necessary since gprof doesn't show the original OCaml functions when compiling the project as a native application, only does it show the most low level function calls that aren't of interest.

The instructions in the Makefile tells the user this:
 # You can compile a profiled bytecode app by specifying
 #     OCAMLC=ocamlcp DEBUG="-p a"

Removing the comment and putting   OCAMLC=ocamlcp DEBUG="-p a"  after the inclusion of the config file doesn't work (giving errors at build time). I have also tried to substitute things in the config file without results. I am definitely no expert using makefiles, so I hope I could get some help on this issue.

I compile the project like this:

make depend
make mpoy

Of course, I might be doing wrong here too, since this is the way to go when building the native application.


(maybe offtopic):
Another problem I have experienced is that when I try to profile the native app, the times differs considerably. Compiling WITHOUT the PROFILE=-p flag and running a script using the native application gives approximately 150 seconds while gprof (app. compiled with -p flag) gives around 110 seconds. Since gprof is based on a sampling process we maybe wanted to blame difference on other processes running. But the utilization of the CPU was around 99% when running POY and that makes me wonder, might there be some functions in C or OCaml that  aren't included in the profile for gprof at all? (I have noticed that small C functions, even if highly utilized and consuming much time, aren't included in the profile. However it seems like the parent functions are accounted for such children, so nothing is really lost, except the resolution)
 

I would really like to hear your comments.

Thank you in advance.

// Johan Ånäs