]> git.lizzy.rs Git - rust.git/commit
Add profiling support, through the rustc -Z profile flag.
authorwhitequark <whitequark@whitequark.org>
Mon, 13 Feb 2017 09:57:50 +0000 (09:57 +0000)
committerwhitequark <whitequark@whitequark.org>
Mon, 1 May 2017 09:16:20 +0000 (09:16 +0000)
commit42754ce710a777b38402b12728daf54d68ea2b50
tree471e30da0626a6b7b2182799280742ba11466ac6
parent06fb4d25642a3f223db1441972dd5962085cfba1
Add profiling support, through the rustc -Z profile flag.

When -Z profile is passed, the GCDAProfiling LLVM pass is added
to the pipeline, which uses debug information to instrument the IR.
After compiling with -Z profile, the $(OUT_DIR)/$(CRATE_NAME).gcno
file is created, containing initial profiling information.
After running the program built, the $(OUT_DIR)/$(CRATE_NAME).gcda
file is created, containing branch counters.

The created *.gcno and *.gcda files can be processed using
the "llvm-cov gcov" and "lcov" tools. The profiling data LLVM
generates does not faithfully follow the GCC's format for *.gcno
and *.gcda files, and so it will probably not work with other tools
(such as gcov itself) that consume these files.
32 files changed:
configure
src/Cargo.lock
src/bootstrap/check.rs
src/bootstrap/config.rs
src/bootstrap/config.toml.example
src/bootstrap/lib.rs
src/doc/unstable-book/src/SUMMARY.md
src/doc/unstable-book/src/compiler-flags/profile.md [new file with mode: 0644]
src/doc/unstable-book/src/language-features/profiler-runtime.md [new file with mode: 0644]
src/doc/unstable-book/src/library-features/profiler-runtime-lib.md [new file with mode: 0644]
src/libprofiler_builtins/Cargo.toml [new file with mode: 0644]
src/libprofiler_builtins/build.rs [new file with mode: 0644]
src/libprofiler_builtins/lib.rs [new file with mode: 0644]
src/librustc/middle/cstore.rs
src/librustc/session/config.rs
src/librustc_driver/driver.rs
src/librustc_llvm/ffi.rs
src/librustc_metadata/creader.rs
src/librustc_metadata/cstore.rs
src/librustc_metadata/cstore_impl.rs
src/librustc_trans/back/link.rs
src/librustc_trans/back/write.rs
src/librustc_trans/base.rs
src/librustc_trans/context.rs
src/librustc_trans/debuginfo/metadata.rs
src/librustc_trans/debuginfo/mod.rs
src/libstd/Cargo.toml
src/libsyntax/feature_gate.rs
src/rustllvm/RustWrapper.cpp
src/test/compile-fail/feature-gate-profiler-runtime.rs [new file with mode: 0644]
src/test/run-make/profile/Makefile [new file with mode: 0644]
src/test/run-make/profile/test.rs [new file with mode: 0644]