summaryrefslogtreecommitdiff
path: root/tools/ocamlprof.ml
diff options
context:
space:
mode:
authorDamien Doligez <damien.doligez-inria.fr>2004-06-16 16:58:46 +0000
committerDamien Doligez <damien.doligez-inria.fr>2004-06-16 16:58:46 +0000
commitfae0bc9d9ba0359d0f3d26325762e93a8e63c209 (patch)
tree249fcd8b32989bc89842cab98213e425569d4293 /tools/ocamlprof.ml
parent477942df0ee5c54d182b4ad002b06b4dfbbdfb77 (diff)
downloadocaml-fae0bc9d9ba0359d0f3d26325762e93a8e63c209.tar.gz
PR#1938
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6415 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'tools/ocamlprof.ml')
-rw-r--r--tools/ocamlprof.ml16
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/ocamlprof.ml b/tools/ocamlprof.ml
index 6ae04d3dbf..d283162fbb 100644
--- a/tools/ocamlprof.ml
+++ b/tools/ocamlprof.ml
@@ -22,7 +22,7 @@ open Misc
open Parsetree
(* User programs must not use identifiers that start with these prefixes. *)
-let idprefix = "__ocaml_prof";;
+let idprefix = "__ocaml_prof_";;
let modprefix = "OCAML__prof_";;
@@ -88,10 +88,10 @@ let add_incr_counter modul (kind,pos) =
| Close -> fprintf !outchan ")";
| Open ->
fprintf !outchan
- "(%sArray.set %s_cnt_%s %d \
- (%sPervasives.succ (%sArray.get %s_cnt_%s %d)); "
- modprefix idprefix modul !prof_counter
- modprefix modprefix idprefix modul !prof_counter;
+ "(%sArray.set %s_cnt %d \
+ (%sPervasives.succ (%sArray.get %s_cnt %d)); "
+ modprefix idprefix !prof_counter
+ modprefix modprefix idprefix !prof_counter;
incr prof_counter;
;;
@@ -132,12 +132,12 @@ let init_rewrite modes mod_name =
if !instr_mode then begin
fprintf !outchan "module %sArray = Array;; " modprefix;
fprintf !outchan "module %sPervasives = Pervasives;; " modprefix;
- fprintf !outchan "let %s_cnt_%s = Array.create 0000000" idprefix mod_name;
+ fprintf !outchan "let %s_cnt = Array.create 0000000" idprefix;
pos_len := pos_out !outchan;
fprintf !outchan
" 0;; Profiling.counters := \
- (\"%s\", (\"%s\", %s_cnt_%s)) :: !Profiling.counters;; "
- mod_name modes idprefix mod_name
+ (\"%s\", (\"%s\", %s_cnt)) :: !Profiling.counters;; "
+ mod_name modes idprefix;
end
let final_rewrite add_function =