Rollup merge of #106274 - jyn514:dump-mono-stats, r=lqd
Add JSON output to -Zdump-mono-stats Follow-up to https://github.com/rust-lang/rust/pull/105481 r? `@lqd` cc `@wesleywiser`
This commit is contained in:
commit
fbfaeb6795
11 changed files with 111 additions and 26 deletions
|
|
@ -0,0 +1,6 @@
|
|||
# `dump-mono-stats-format`
|
||||
|
||||
--------------------
|
||||
|
||||
The `-Z dump-mono-stats-format` compiler flag controls what file format to use for `-Z dump-mono-stats`.
|
||||
The default is markdown; currently JSON is also supported. JSON can be useful for programatically manipulating the results (e.g. to find the item that took the longest to compile).
|
||||
14
src/doc/unstable-book/src/compiler-flags/dump-mono-stats.md
Normal file
14
src/doc/unstable-book/src/compiler-flags/dump-mono-stats.md
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# `dump-mono-stats`
|
||||
|
||||
--------------------
|
||||
|
||||
The `-Z dump-mono-stats` compiler flag generates a file with a list of the monomorphized items in the current crate.
|
||||
It is useful for investigating compile times.
|
||||
|
||||
It accepts an optional directory where the file will be located. If no directory is specified, the file will be placed in the current directory.
|
||||
|
||||
See also `-Z dump-mono-stats-format` and `-Z print-mono-items`. Unlike `print-mono-items`,
|
||||
`dump-mono-stats` aggregates monomorphized items by definition and includes a size estimate of how
|
||||
large the item is when codegened.
|
||||
|
||||
See <https://rustc-dev-guide.rust-lang.org/backend/monomorph.html> for an overview of monomorphized items.
|
||||
5
src/test/run-make/dump-mono-stats/Makefile
Normal file
5
src/test/run-make/dump-mono-stats/Makefile
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
include ../../run-make-fulldeps/tools.mk
|
||||
|
||||
all:
|
||||
$(RUSTC) --crate-type lib foo.rs -Z dump-mono-stats=$(TMPDIR) -Zdump-mono-stats-format=json
|
||||
cat $(TMPDIR)/foo.mono_items.json | $(CGREP) '"name":"bar"'
|
||||
1
src/test/run-make/dump-mono-stats/foo.rs
Normal file
1
src/test/run-make/dump-mono-stats/foo.rs
Normal file
|
|
@ -0,0 +1 @@
|
|||
pub fn bar() {}
|
||||
|
|
@ -35,7 +35,8 @@
|
|||
-Z dump-mir-exclude-pass-number=val -- exclude the pass number when dumping MIR (used in tests) (default: no)
|
||||
-Z dump-mir-graphviz=val -- in addition to `.mir` files, create graphviz `.dot` files (and with `-Z instrument-coverage`, also create a `.dot` file for the MIR-derived coverage graph) (default: no)
|
||||
-Z dump-mir-spanview=val -- in addition to `.mir` files, create `.html` files to view spans for all `statement`s (including terminators), only `terminator` spans, or computed `block` spans (one span encompassing a block's terminator and all statements). If `-Z instrument-coverage` is also enabled, create an additional `.html` file showing the computed coverage spans.
|
||||
-Z dump-mono-stats=val -- output statistics about monomorphization collection (format: markdown)
|
||||
-Z dump-mono-stats=val -- output statistics about monomorphization collection
|
||||
-Z dump-mono-stats-format=val -- the format to use for -Z dump-mono-stats (`markdown` (default) or `json`)
|
||||
-Z dwarf-version=val -- version of DWARF debug information to emit (default: 2 or 4, depending on platform)
|
||||
-Z dylib-lto=val -- enables LTO for dylib crate type
|
||||
-Z emit-stack-sizes=val -- emit a section containing stack size metadata (default: no)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue