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

Make 'profile' a stable option #44673

Closed
wants to merge 2 commits into from
Closed
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# `profiler_runtime`

The tracking issue for this feature is: [#42524](https://github.com/rust-lang/rust/issues/42524).
This feature is internal to the Rust compiler and is not intended for general use.

------------------------
4 changes: 2 additions & 2 deletions src/librustc/session/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,8 @@ options! {CodegenOptions, CodegenSetter, basic_codegen_options,
"set the inlining threshold for"),
panic: Option<PanicStrategy> = (None, parse_panic_strategy,
[TRACKED], "panic strategy to compile crate with"),
profile: bool = (false, parse_bool, [TRACKED],
"insert gcov profiling code"),
}

options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
Expand Down Expand Up @@ -1065,8 +1067,6 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
"a single extra argument to prepend the linker invocation (can be used several times)"),
pre_link_args: Option<Vec<String>> = (None, parse_opt_list, [UNTRACKED],
"extra arguments to prepend to the linker invocation (space separated)"),
profile: bool = (false, parse_bool, [TRACKED],
"insert profiling code"),
relro_level: Option<RelroLevel> = (None, parse_relro_level, [TRACKED],
"choose which RELRO level to use"),
nll: bool = (false, parse_bool, [UNTRACKED],
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_metadata/creader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ impl<'a> CrateLoader<'a> {
}

fn inject_profiler_runtime(&mut self) {
if self.sess.opts.debugging_opts.profile {
if self.sess.opts.cg.profile {
info!("loading profiler");

let symbol = Symbol::intern("profiler_builtins");
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ pub fn start_async_translation(sess: &Session,
}
}

if sess.opts.debugging_opts.profile {
if sess.opts.cg.profile {
modules_config.passes.push("insert-gcov-profiling".to_owned())
}

Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/debuginfo/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ pub fn compile_unit_metadata(scc: &SharedCrateContext,
0,
split_name.as_ptr() as *const _);

if sess.opts.debugging_opts.profile {
if sess.opts.cg.profile {
let cu_desc_metadata = llvm::LLVMRustMetadataAsValue(debug_context.llcontext,
unit_metadata);

Expand Down
2 changes: 1 addition & 1 deletion src/test/run-make/profile/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

all:
ifeq ($(PROFILER_SUPPORT),1)
$(RUSTC) -g -Z profile test.rs
$(RUSTC) -g -C profile test.rs
$(call RUN,test) || exit 1
[ -e "$(TMPDIR)/test.gcno" ] || (echo "No .gcno file"; exit 1)
[ -e "$(TMPDIR)/test.gcda" ] || (echo "No .gcda file"; exit 1)
Expand Down