@@ -180,6 +180,7 @@ pub enum Profiler {
180
180
Eprintln ,
181
181
LlvmLines ,
182
182
MonoItems ,
183
+ DepGraph ,
183
184
}
184
185
185
186
impl Profiler {
@@ -201,6 +202,7 @@ impl Profiler {
201
202
"eprintln" => Ok ( Profiler :: Eprintln ) ,
202
203
"llvm-lines" => Ok ( Profiler :: LlvmLines ) ,
203
204
"mono-items" => Ok ( Profiler :: MonoItems ) ,
205
+ "dep-graph" => Ok ( Profiler :: DepGraph ) ,
204
206
_ => Err ( anyhow ! ( "'{}' is not a known profiler" , name) ) ,
205
207
}
206
208
}
@@ -222,6 +224,7 @@ impl Profiler {
222
224
Profiler :: Eprintln => "eprintln" ,
223
225
Profiler :: LlvmLines => "llvm-lines" ,
224
226
Profiler :: MonoItems => "mono-items" ,
227
+ Profiler :: DepGraph => "dep-graph" ,
225
228
}
226
229
}
227
230
@@ -241,6 +244,7 @@ impl Profiler {
241
244
| Profiler :: Callgrind
242
245
| Profiler :: DHAT
243
246
| Profiler :: Massif
247
+ | Profiler :: DepGraph
244
248
| Profiler :: MonoItems
245
249
| Profiler :: Eprintln => {
246
250
if build_kind == BuildKind :: Doc {
@@ -272,6 +276,8 @@ impl Profiler {
272
276
| Profiler :: Massif
273
277
| Profiler :: MonoItems
274
278
| Profiler :: Eprintln => true ,
279
+ // only incremental
280
+ Profiler :: DepGraph => scenario_kind != ScenarioKind :: Full ,
275
281
Profiler :: LlvmLines => scenario_kind == ScenarioKind :: Full ,
276
282
}
277
283
}
@@ -1183,6 +1189,21 @@ impl<'a> Processor for ProfileProcessor<'a> {
1183
1189
}
1184
1190
}
1185
1191
1192
+ Profiler :: DepGraph => {
1193
+ let tmp_file = filepath ( data. cwd . as_ref ( ) , "dep_graph.txt" ) ;
1194
+ let output =
1195
+ filepath ( self . output_dir , & out_file ( "dep-graph" ) ) . with_extension ( "txt" ) ;
1196
+
1197
+ fs:: copy ( & tmp_file, & output) ?;
1198
+
1199
+ let tmp_file = filepath ( data. cwd . as_ref ( ) , "dep_graph.dot" ) ;
1200
+ let output =
1201
+ filepath ( self . output_dir , & out_file ( "dep-graph" ) ) . with_extension ( "dot" ) ;
1202
+
1203
+ // May not exist if not incremental, but then that's OK.
1204
+ fs:: copy ( & tmp_file, & output) ?;
1205
+ }
1206
+
1186
1207
// `cargo llvm-lines` writes its output to stdout. We copy that
1187
1208
// output into a file in the output dir.
1188
1209
Profiler :: LlvmLines => {
0 commit comments