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

[3/3] Restructure LIBDIR: Move the Profiling module to a sub-directory #11200

Merged
merged 1 commit into from
May 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@ Working version
(Sébastien Hinderer, review by David Allsopp, Nicolás Ojeda Bär,
Xavier Leroy, Vincent Laviron and Antonin Décimo)

- #11200: Install ocamlprof's Profiling runtime module to a +profiling,
removing it from the default namespace.
(David Allsopp, review by Sébastien Hinderer)

### Bug fixes:

- #11167: Fix memory leak from signal stack.
Expand Down
12 changes: 9 additions & 3 deletions tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -109,20 +109,26 @@ ocamloptp.opt$(EXE): $(call byte2native, $(OCAMLCP) ocamloptp.cmo)

opt:: profiling.cmx

INSTALL_LIBDIR_PROFILING = $(INSTALL_LIBDIR)/profiling

install::
# If installing over a previous OCaml version, ensure the module is removed
# from the previous installation.
rm -f "$(INSTALL_LIBDIR)"/profiling.cm* "$(INSTALL_LIBDIR)/profiling.$(O)"
$(MKDIR) "$(INSTALL_LIBDIR_PROFILING)"
$(INSTALL_DATA) \
profiling.cmi profiling.cmo \
"$(INSTALL_LIBDIR)"
"$(INSTALL_LIBDIR_PROFILING)"
ifeq "$(INSTALL_SOURCE_ARTIFACTS)" "true"
$(INSTALL_DATA) \
profiling.cmt profiling.cmti \
"$(INSTALL_LIBDIR)"
"$(INSTALL_LIBDIR_PROFILING)"
endif

installopt::
$(INSTALL_DATA) \
profiling.cmx profiling.$(O) \
"$(INSTALL_LIBDIR)"
"$(INSTALL_LIBDIR_PROFILING)"

# To help building mixed-mode libraries (OCaml + C)
OCAMLMKLIB = config.cmo build_path_prefix_map.cmo misc.cmo ocamlmklib.cmo
Expand Down
10 changes: 5 additions & 5 deletions tools/ocamlcp.ml
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ end;
if !with_impl then rev_profargs := "-impl" :: !rev_profargs;
if !with_intf then rev_profargs := "-intf" :: !rev_profargs;
let status =
Sys.command
(Printf.sprintf "ocamlc -pp \"ocamlprof -instrument %s\" %s %s"
(String.concat " " (List.rev !rev_profargs))
(if !make_archive then "" else "profiling.cmo")
(String.concat " " (List.rev !rev_compargs)))
ksprintf Sys.command
"ocamlc -pp \"ocamlprof -instrument %s\" -I +profiling %s %s"
(String.concat " " (List.rev !rev_profargs))
(if !make_archive then "" else "profiling.cmo")
(String.concat " " (List.rev !rev_compargs))
in
exit status
10 changes: 5 additions & 5 deletions tools/ocamloptp.ml
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ end;
if !with_impl then rev_profargs := "-impl" :: !rev_profargs;
if !with_intf then rev_profargs := "-intf" :: !rev_profargs;
let status =
Sys.command
(Printf.sprintf "ocamlopt -pp \"ocamlprof -instrument %s\" %s %s"
(String.concat " " (List.rev !rev_profargs))
(if !make_archive then "" else "profiling.cmx")
(String.concat " " (List.rev !rev_compargs)))
ksprintf Sys.command
"ocamlopt -pp \"ocamlprof -instrument %s\" -I +profiling %s %s"
(String.concat " " (List.rev !rev_profargs))
(if !make_archive then "" else "profiling.cmx")
(String.concat " " (List.rev !rev_compargs))
in
exit status