about summary refs log tree commit diff
path: root/src/doc
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-01-04 07:28:54 +0100
committerGitHub <noreply@github.com>2023-01-04 07:28:54 +0100
commitfbfaeb67953b1ccaf09c5eacb8ff0dcc464c3274 (patch)
tree121d648c712a33ff9d7973a595d71c345a9de5d7 /src/doc
parent70468af5916cd13240e3c852f0921c7f325ec421 (diff)
parent5c79624bfaf28540b739f33ffe9d2d1f132555d2 (diff)
downloadrust-fbfaeb67953b1ccaf09c5eacb8ff0dcc464c3274.tar.gz
rust-fbfaeb67953b1ccaf09c5eacb8ff0dcc464c3274.zip
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`
Diffstat (limited to 'src/doc')
-rw-r--r--src/doc/unstable-book/src/compiler-flags/dump-mono-stats-format.md6
-rw-r--r--src/doc/unstable-book/src/compiler-flags/dump-mono-stats.md14
2 files changed, 20 insertions, 0 deletions
diff --git a/src/doc/unstable-book/src/compiler-flags/dump-mono-stats-format.md b/src/doc/unstable-book/src/compiler-flags/dump-mono-stats-format.md
new file mode 100644
index 00000000000..a497a75261f
--- /dev/null
+++ b/src/doc/unstable-book/src/compiler-flags/dump-mono-stats-format.md
@@ -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).
diff --git a/src/doc/unstable-book/src/compiler-flags/dump-mono-stats.md b/src/doc/unstable-book/src/compiler-flags/dump-mono-stats.md
new file mode 100644
index 00000000000..4c8bc8b4578
--- /dev/null
+++ b/src/doc/unstable-book/src/compiler-flags/dump-mono-stats.md
@@ -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.