caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Profiling
@ 2002-03-14 14:47 Andrew Birkett
  2002-03-14 15:14 ` Markus Mottl
  2002-03-14 16:54 ` Remi VANICAT
  0 siblings, 2 replies; 11+ messages in thread
From: Andrew Birkett @ 2002-03-14 14:47 UTC (permalink / raw)
  To: caml-list

Hi,

Is there a technical reason why you can't profile a bytecode ocaml
program, or is it just something which has never been written?

Since this is my first post to the list, I'd just like to say how much I
like the ocaml language, particularly the speed of the compiler.  It makes
programming fun again!

Andrew

- www.tardis.ed.ac.uk/~adb -

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Caml-list] Profiling
  2002-03-14 15:14 ` Markus Mottl
@ 2002-03-14 15:13   ` Georges Mariano
  2002-03-15 10:15     ` Markus Mottl
  2002-03-14 15:46   ` [Caml-list] Profiling Andrew Birkett
  1 sibling, 1 reply; 11+ messages in thread
From: Georges Mariano @ 2002-03-14 15:13 UTC (permalink / raw)
  To: caml-list

On Thu, 14 Mar 2002 16:14:28 +0100
Markus Mottl <markus@oefai.at> wrote:

> On Thu, 14 Mar 2002, Andrew Birkett wrote:
> > Is there a technical reason why you can't profile a bytecode
> > ocaml program, or is it just something which has never been
> > written?
> 
> But of course you can: just compile your programs with the
> profiling flag, run them and use ocamlprof to get source codes
> with annotations telling you the number of times some
> expression was evaluated.

May I add that this functionality is available while
using the (excellent !!) OCamlMakefile "utility" designed by ...

...Markus Mottl  ;-)

make profiling-byte-code 

PS : thanks Markus ...

Cheers

-- 
mailto:georges.mariano@inrets.fr     tel: (33) 03 20 43 84 06   
INRETS, 20 rue Élisée Reclus         fax: (33) 03 20 43 83 59   
BP 317 -- 59666 Villeneuve d'Ascq       
http://www3.inrets.fr/estas/mariano
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Caml-list] Profiling
  2002-03-14 14:47 [Caml-list] Profiling Andrew Birkett
@ 2002-03-14 15:14 ` Markus Mottl
  2002-03-14 15:13   ` Georges Mariano
  2002-03-14 15:46   ` [Caml-list] Profiling Andrew Birkett
  2002-03-14 16:54 ` Remi VANICAT
  1 sibling, 2 replies; 11+ messages in thread
From: Markus Mottl @ 2002-03-14 15:14 UTC (permalink / raw)
  To: Andrew Birkett; +Cc: caml-list

On Thu, 14 Mar 2002, Andrew Birkett wrote:
> Is there a technical reason why you can't profile a bytecode ocaml
> program, or is it just something which has never been written?

But of course you can: just compile your programs with the profiling
flag, run them and use ocamlprof to get source codes with annotations
telling you the number of times some expression was evaluated.

Regards,
Markus Mottl

-- 
Markus Mottl                                             markus@oefai.at
Austrian Research Institute
for Artificial Intelligence                  http://www.oefai.at/~markus
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Caml-list] Profiling
  2002-03-14 15:14 ` Markus Mottl
  2002-03-14 15:13   ` Georges Mariano
@ 2002-03-14 15:46   ` Andrew Birkett
  2002-03-14 16:09     ` David Monniaux
  2002-03-23 22:48     ` David MENTRE
  1 sibling, 2 replies; 11+ messages in thread
From: Andrew Birkett @ 2002-03-14 15:46 UTC (permalink / raw)
  To: caml-list

On Thu, 14 Mar 2002, Markus Mottl wrote:

> use ocamlprof to get source codes with annotations telling you the
> number of times some expression was evaluated.

Ah! Let me try that one again ...

Is it possible to get a profile of execution time of a bytecode program.
Ocamlprof gives execution counts for bytecode programs, and you can gprof
native-compiled programs for execution times.  Why can't you profile
execution times with bytecode programs?

Andrew

- www.tardis.ed.ac.uk/~adb -

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Caml-list] Profiling
  2002-03-14 15:46   ` [Caml-list] Profiling Andrew Birkett
@ 2002-03-14 16:09     ` David Monniaux
  2002-03-23 22:48     ` David MENTRE
  1 sibling, 0 replies; 11+ messages in thread
From: David Monniaux @ 2002-03-14 16:09 UTC (permalink / raw)
  To: Liste CAML

On Thu, 14 Mar 2002, Andrew Birkett wrote:

> Ocamlprof gives execution counts for bytecode programs, and you can gprof

Actually, one should also be able to get execution counts for native-code
programs. Some programs are just too complex and slow to be bearable in
bytecode!

David Monniaux            http://www.di.ens.fr/~monniaux
Laboratoire d'informatique de l'École Normale Supérieure,
Paris, France

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Caml-list] Profiling
  2002-03-14 14:47 [Caml-list] Profiling Andrew Birkett
  2002-03-14 15:14 ` Markus Mottl
@ 2002-03-14 16:54 ` Remi VANICAT
  1 sibling, 0 replies; 11+ messages in thread
From: Remi VANICAT @ 2002-03-14 16:54 UTC (permalink / raw)
  To: caml-list

Andrew Birkett <adb@tardis.ed.ac.uk> writes:

> Hi,
> 
> Is there a technical reason why you can't profile a bytecode ocaml
> program, or is it just something which has never been written?

you should use ocamlprof. It's in the standard distrib and it is made
for this. 
-- 
Rémi Vanicat
vanicat@labri.u-bordeaux.fr
http://dept-info.labri.u-bordeaux.fr/~vanicat
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Caml-list] Profiling
  2002-03-14 15:13   ` Georges Mariano
@ 2002-03-15 10:15     ` Markus Mottl
  2002-03-15 10:45       ` [Caml-list] Ocamldot for functions and types Mattias Waldau
  0 siblings, 1 reply; 11+ messages in thread
From: Markus Mottl @ 2002-03-15 10:15 UTC (permalink / raw)
  To: Georges Mariano; +Cc: caml-list

On Thu, 14 Mar 2002, Georges Mariano wrote:
> make profiling-byte-code 

Btw., one can also use shortcuts, which is much more convenient from
the command-line:

  make pbc

> PS : thanks Markus ...

You are welcome!

Regards,
Markus Mottl

-- 
Markus Mottl                                             markus@oefai.at
Austrian Research Institute
for Artificial Intelligence                  http://www.oefai.at/~markus
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Caml-list] Ocamldot for functions and types
  2002-03-15 10:15     ` Markus Mottl
@ 2002-03-15 10:45       ` Mattias Waldau
  2002-03-15 11:10         ` Daniel de Rauglaudre
  2002-03-15 15:22         ` RE : " Boris Yakobowski
  0 siblings, 2 replies; 11+ messages in thread
From: Mattias Waldau @ 2002-03-15 10:45 UTC (permalink / raw)
  To: caml-list

Ocamldot can create a picture showing how ocaml files
depend on each other.

Is there a similar tool that shows how functions and
types within a bigger program with many modules
depend on each other?

If I would create something like that, should I use
camlp4? 

Or is there another internal representation
where I can get that information? For example, 
the infered internal types would also
be interesting.

/mattias

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Caml-list] Ocamldot for functions and types
  2002-03-15 10:45       ` [Caml-list] Ocamldot for functions and types Mattias Waldau
@ 2002-03-15 11:10         ` Daniel de Rauglaudre
  2002-03-15 15:22         ` RE : " Boris Yakobowski
  1 sibling, 0 replies; 11+ messages in thread
From: Daniel de Rauglaudre @ 2002-03-15 11:10 UTC (permalink / raw)
  To: caml-list

Hi,

On Fri, Mar 15, 2002 at 11:45:02AM +0100, Mattias Waldau wrote:

> Is there a similar tool that shows how functions and
> types within a bigger program with many modules
> depend on each other?
> 
> If I would create something like that, should I use
> camlp4? 

I don't think Camlp4 could help. You can program the "ocamldep"
program with Camlp4 because modules are syntactically visible: they
are uppercase identifiers followed by a dot.

But there is no syntactic way to know in which module some function
"f" or some type "t" is defined. For that, you need a semantic
analysis.

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE : [Caml-list] Ocamldot for functions and types
  2002-03-15 10:45       ` [Caml-list] Ocamldot for functions and types Mattias Waldau
  2002-03-15 11:10         ` Daniel de Rauglaudre
@ 2002-03-15 15:22         ` Boris Yakobowski
  1 sibling, 0 replies; 11+ messages in thread
From: Boris Yakobowski @ 2002-03-15 15:22 UTC (permalink / raw)
  To: caml-list

> From : owner-caml-list@pauillac.inria.fr
[mailto:owner-caml-list@pauillac.inria.fr] De la part de Mattias Waldau
>
> Ocamldot can create a picture showing how ocaml files
> depend on each other.
>
> Is there a similar tool that shows how functions and
> types within a bigger program with many modules
> depend on each other?
>
> Or is there another internal representation
> where I can get that information? For example, 
> the infered internal types would also
> be interesting.

I'm having more or less the same kind of needs. I'm currently modifying
a big project, which I did not write in the first place, and in which
many functions are never used.  Unfortunately, all the modules are
linked since some of the functions of each module are used.

What would be perfect is a command-line option which tells me which
function of a module has never been used. I realize this might not be
easy because (for example) of functors. Another solutions would be to
print (during link phase) which functions are effectively called. That
way it would become possible to find out which are never used.

Since Caml is a project a bit too large to be understood in two or three
weeks, could someone give me some clues about which files I should look
into for that kind of modifications (I just want to put some
print_string at key points, I do not intend to make deep changes).


Boris Yakobowski

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Caml-list] Profiling
  2002-03-14 15:46   ` [Caml-list] Profiling Andrew Birkett
  2002-03-14 16:09     ` David Monniaux
@ 2002-03-23 22:48     ` David MENTRE
  1 sibling, 0 replies; 11+ messages in thread
From: David MENTRE @ 2002-03-23 22:48 UTC (permalink / raw)
  To: Andrew Birkett; +Cc: caml-list

Andrew Birkett <adb@tardis.ed.ac.uk> writes:

> Ah! Let me try that one again ...
> 
> Is it possible to get a profile of execution time of a bytecode program.
> Ocamlprof gives execution counts for bytecode programs, and you can gprof
> native-compiled programs for execution times.  Why can't you profile
> execution times with bytecode programs?

You can (even if I doubt of its usefulness) :

 1. build an ocaml with "-pg" option to cc 
    ('./configure -prefix "gcc -pg" && make world && make install')

 2. make your byte code ocaml program with the ocamlc made in step 1

 3. run your program, it should produce a "gmon.out" file

 4. run gprof on ocamlrun, with the "gmon.out" file in the same
    directory as ocamlrun

 5. admire the wonderful produced statistics :-)


Best regards,
david
-- 
 david.mentre@wanadoo.fr
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2002-03-23 22:49 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-14 14:47 [Caml-list] Profiling Andrew Birkett
2002-03-14 15:14 ` Markus Mottl
2002-03-14 15:13   ` Georges Mariano
2002-03-15 10:15     ` Markus Mottl
2002-03-15 10:45       ` [Caml-list] Ocamldot for functions and types Mattias Waldau
2002-03-15 11:10         ` Daniel de Rauglaudre
2002-03-15 15:22         ` RE : " Boris Yakobowski
2002-03-14 15:46   ` [Caml-list] Profiling Andrew Birkett
2002-03-14 16:09     ` David Monniaux
2002-03-23 22:48     ` David MENTRE
2002-03-14 16:54 ` Remi VANICAT

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).