New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ocamlcp chokes on option -thread #3511
Comments
Comment author: administrator
This is not going to work because counter-based profiling is not thread-safe. -- Damien |
Comment author: administrator Right. It also explains why I couldn't make much sense of the counts ;-) Sebastian. Dr. Sebastian Egner Damien Doligez caml-bugs@pauillac.inria.fr
This is not going to work because counter-based profiling is not -- Damien
> The profiling compiler 'ocamlcp' does not process the option "-thread" > properly. This is not going to work because counter-based profiling is not thread-safe. I'll file your report as a feature wish: either give a better error message or use locks to protect the counter updates when -thread is given. -- Damien ---------------- ---------------- |
Comment author: administrator fixed 2005-03-09 DD |
Original bug ID: 3511
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Sebastian Egner
Version: Ocaml 3.08.2
OS: Linux 2.4.20-31.9 smp
Submission from: neo1a.ehv.campus.philips.com (194.171.252.100)
The profiling compiler 'ocamlcp' does not process the option "-thread"
properly.
--- begin example
ocamlcp -p a -c -thread dummy.mli # dummy.mli just contains a comment
/home/egner/usr/local/bin/ocamlprof: unknown option `-thread'.
Usage: ocamlprof
options are:
-f Use as dump file (default ocamlprof.dump)
-F
Insert stringwith the counts-impl Process as a .ml file
-instrument (undocumented)
-intf Process as a .mli file
-m (undocumented)
-help Display this list of options
--help Display this list of options
Preprocessor error
--- end example
I have been able to hack/fix this problem by modifying the Sys.command
at the end of $OCAML/tools/ocamlcp.ml into:
let status =
Sys.command
(Printf.sprintf "ocamlc -pp "ocamlprof -instrument %s" %s %s"
(String.concat " " (List.rev !profargs))
(if !make_archive then "" else "profiling.cmo")
(String.concat " " (List.rev !compargs)))
This modification prevents ocamlcp from passing '-thread' to ocamlprof, so
ocamlprof cannot choke on the option during instrumentation.
However, since I do not really understand the interface between ocamlc, ocamlcp,
and ocamlprof it is advisable if a person who does understand it would fix this
problem cleanly.
The text was updated successfully, but these errors were encountered: