@@ -258,7 +258,7 @@ impl<'a> CargoProcess<'a> {
258
258
// subcommand that itself invokes `rustc` (so that the `FAKE_RUSTC`
259
259
// machinery works).
260
260
let subcommand = if let Some ( ( ref mut processor, run_kind, ..) ) = self . processor_etc {
261
- let profiler = processor. profiler ( ) ;
261
+ let profiler = processor. profiler ( self . build_kind ) ;
262
262
if !profiler. is_run_kind_allowed ( run_kind) {
263
263
return Err ( anyhow:: anyhow!(
264
264
"this profiler doesn't support {:?} runs" ,
@@ -300,7 +300,7 @@ impl<'a> CargoProcess<'a> {
300
300
// onto rustc for the final crate, which is exactly the crate for which
301
301
// we want to wrap rustc.
302
302
if let Some ( ( ref mut processor, ..) ) = self . processor_etc {
303
- let profiler = processor. profiler ( ) . name ( ) ;
303
+ let profiler = processor. profiler ( self . build_kind ) . name ( ) ;
304
304
cmd. arg ( "--wrap-rustc-with" ) ;
305
305
cmd. arg ( profiler) ;
306
306
cmd. args ( & self . rustc_args ) ;
@@ -385,7 +385,7 @@ pub struct ProcessOutputData<'a> {
385
385
/// processing.
386
386
pub trait Processor {
387
387
/// The `Profiler` being used.
388
- fn profiler ( & self ) -> Profiler ;
388
+ fn profiler ( & self , _ : BuildKind ) -> Profiler ;
389
389
390
390
/// Process the output produced by the particular `Profiler` being used.
391
391
fn process_output (
@@ -507,8 +507,8 @@ impl<'a> MeasureProcessor<'a> {
507
507
}
508
508
509
509
impl < ' a > Processor for MeasureProcessor < ' a > {
510
- fn profiler ( & self ) -> Profiler {
511
- if self . is_first_collection && self . self_profile {
510
+ fn profiler ( & self , build : BuildKind ) -> Profiler {
511
+ if self . is_first_collection && self . self_profile && build != BuildKind :: Doc {
512
512
Profiler :: PerfStatSelfProfile
513
513
} else {
514
514
Profiler :: PerfStat
@@ -633,7 +633,7 @@ impl<'a> ProfileProcessor<'a> {
633
633
}
634
634
635
635
impl < ' a > Processor for ProfileProcessor < ' a > {
636
- fn profiler ( & self ) -> Profiler {
636
+ fn profiler ( & self , _ : BuildKind ) -> Profiler {
637
637
self . profiler
638
638
}
639
639
0 commit comments