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.
This commit is contained in:
parent
06fb4d2564
commit
42754ce710
32 changed files with 296 additions and 9 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
- [Compiler flags](compiler-flags.md)
|
||||
- [linker_flavor](compiler-flags/linker-flavor.md)
|
||||
- [profile](compiler-flags/profile.md)
|
||||
- [remap_path_prefix](compiler-flags/remap-path-prefix.md)
|
||||
- [Language features](language-features.md)
|
||||
- [abi_msp430_interrupt](language-features/abi-msp430-interrupt.md)
|
||||
|
|
@ -71,6 +72,7 @@
|
|||
- [plugin_registrar](language-features/plugin-registrar.md)
|
||||
- [prelude_import](language-features/prelude-import.md)
|
||||
- [proc_macro](language-features/proc-macro.md)
|
||||
- [profiler_runtime](language-features/profiler-runtime.md)
|
||||
- [quote](language-features/quote.md)
|
||||
- [relaxed_adts](language-features/relaxed-adts.md)
|
||||
- [repr_align](language-features/repr-align.md)
|
||||
|
|
@ -180,6 +182,7 @@
|
|||
- [print](library-features/print.md)
|
||||
- [proc_macro_internals](library-features/proc-macro-internals.md)
|
||||
- [process_try_wait](library-features/process-try-wait.md)
|
||||
- [profiler_runtime_lib](library-features/sanitizer-runtime-lib.md)
|
||||
- [question_mark_carrier](library-features/question-mark-carrier.md)
|
||||
- [rand](library-features/rand.md)
|
||||
- [range_contains](library-features/range-contains.md)
|
||||
|
|
|
|||
5
src/doc/unstable-book/src/compiler-flags/profile.md
Normal file
5
src/doc/unstable-book/src/compiler-flags/profile.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
# `profile`
|
||||
|
||||
The tracking issue for this feature is: None
|
||||
|
||||
------------------------
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
# `profiler_runtime`
|
||||
|
||||
The tracking issue for this feature is: None.
|
||||
|
||||
------------------------
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
# `profiler_runtime_lib`
|
||||
|
||||
This feature is internal to the Rust compiler and is not intended for general use.
|
||||
|
||||
------------------------
|
||||
Loading…
Add table
Add a link
Reference in a new issue