-
Notifications
You must be signed in to change notification settings - Fork 12.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #106274 - jyn514:dump-mono-stats, r=lqd
Add JSON output to -Zdump-mono-stats Follow-up to #105481 r? `@lqd` cc `@wesleywiser`
- Loading branch information
Showing
11 changed files
with
111 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/doc/unstable-book/src/compiler-flags/dump-mono-stats-format.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 changes: 14 additions & 0 deletions
14
src/doc/unstable-book/src/compiler-flags/dump-mono-stats.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub fn bar() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters