Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Specifying ocamlprof.dump output filename
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-11-12 (09:15)
From: Janne Hellsten <jjhellst@g...>
Subject: Specifying ocamlprof.dump output filename
Hi all,

I have come across a slight usability issue with the use of the
ocamlprof utility.  The problem is the accumulation of results when my
profilee program is executed several times in several different
working directories.

My OCaml program is a command line tool that gets tested by my
regression test suite.  The regression test calls my command line tool
from several different locations, e.g.


As my profilee gets executed from these separate directories (size,
speed, func), the "ocamlprof.dump" files also end up in these
different directories.  This is problematic for the following reasons:

1. Profiling results are not accumulated across all of the separate
   testers.  Each test directory produce a separate results file, and
   I need to go through these results one by one.  I'd like to only
   get the combined results:



   $PROJ/bin/ocamlprof.dump  # combined result

2. Running other bytecode programs compiled for profiling resets the
   dump files.  I run several OCamlprof-enabled programs in my
   regression suite.  As all of these are run in the same working
   directory, these programs end up overwriting each others results.

This problem could be solved by being able to specify where the
ocamlprof.dump files get generated.  If I could do this, I would
simply generate ocamlprof.dump files in the bin directory of my tested

Would it make sense to add a command line option for ocamlcp that
would override the default ocamlprof.dump output path?


P.S. I have workarounded this problem temporarily by always switching
my working dir when running my tool.