Skip to content
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

Closed
vicuna opened this issue Mar 4, 2005 · 3 comments
Closed

ocamlcp chokes on option -thread #3511

vicuna opened this issue Mar 4, 2005 · 3 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Mar 4, 2005

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 string with 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.

@vicuna
Copy link
Author

vicuna commented Mar 7, 2005

Comment author: administrator

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

@vicuna
Copy link
Author

vicuna commented Mar 7, 2005

Comment author: administrator

Right. It also explains why I couldn't make much sense of the counts ;-)

Sebastian.


Dr. Sebastian Egner
Senior Scientist Channel Coding & Modulation
Philips Research Laboratories
Prof. Holstlaan 4 (WDC 1-051, 1st floor, room 51)
5656 AA Eindhoven
The Netherlands
tel: +31 40 27-43166 *** SINCE 10-Feb-2005 ***
fax: +31 40 27-44004
email: sebastian.egner@philips.com

Damien Doligez caml-bugs@pauillac.inria.fr
07-03-2005 14:46

    To:     Sebastian Egner/EHV/RESEARCH/PHILIPS@PHILIPS
    cc: 
    Subject:        Re: ocamlcp chokes on option -thread (#3511)
    Classification: 

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



Right. It also explains why I couldn't
make much sense of the counts ;-)



Sebastian.



----

Dr. Sebastian Egner

Senior Scientist Channel Coding & Modulation

Philips Research Laboratories

Prof. Holstlaan 4 (WDC 1-051, 1st floor, room 51)

5656 AA Eindhoven

The Netherlands

tel:       +31 40 27-43166   *** SINCE 10-Feb-2005
***

fax:      +31 40 27-44004

email: sebastian.egner@philips.com










Damien Doligez <caml-bugs@pauillac.inria.fr>

07-03-2005 14:46

       
        To:        Sebastian Egner/EHV/RESEARCH/PHILIPS@PHILIPS
        cc:        
        Subject:        Re: ocamlcp chokes on option -thread (#3511)

        Classification:        




> 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


---------------- ----------------

@vicuna
Copy link
Author

vicuna commented Mar 9, 2005

Comment author: administrator

fixed 2005-03-09 DD

@vicuna vicuna closed this as completed Mar 9, 2005
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant