@@ -8,7 +8,7 @@ use collector::compile::benchmark::category::Category;
88use collector:: compile:: benchmark:: profile:: Profile ;
99use collector:: compile:: benchmark:: scenario:: Scenario ;
1010use collector:: compile:: benchmark:: {
11- compile_benchmark_dir, get_compile_benchmarks, Benchmark , BenchmarkName ,
11+ compile_benchmark_dir, get_compile_benchmarks, ArtifactType , Benchmark , BenchmarkName ,
1212} ;
1313use collector:: { runtime, utils, CollectorCtx , CollectorStepBuilder } ;
1414use database:: { ArtifactId , ArtifactIdNumber , Commit , CommitType , Connection , Pool } ;
@@ -586,6 +586,10 @@ struct DownloadCommand {
586586 #[ arg( long, short( 'c' ) , value_enum, global = true , default_value = "primary" ) ]
587587 category : Category ,
588588
589+ /// What artifact type (library or binary) does the benchmark build.
590+ #[ arg( long, short( 'a' ) , value_enum, global = true , default_value = "library" ) ]
591+ artifact : ArtifactType ,
592+
589593 #[ command( subcommand) ]
590594 command : DownloadSubcommand ,
591595}
@@ -948,9 +952,15 @@ fn main_result() -> anyhow::Result<i32> {
948952 }
949953 } ;
950954
951- add_perf_config ( & target_dir, cmd. category ) ;
955+ add_perf_config ( & target_dir, cmd. category , cmd . artifact ) ;
952956
953- println ! ( "Benchmark stored at {}" , target_dir. display( ) ) ;
957+ println ! (
958+ r#"Benchmark stored at {dir} using category `{}` and artifact type `{}`.
959+ Make sure to modify `{dir}/perf-config.json` if the category/artifact don't match your expectations."# ,
960+ cmd. category,
961+ cmd. artifact,
962+ dir = target_dir. display( ) ,
963+ ) ;
954964 Ok ( 0 )
955965 }
956966 }
@@ -1249,9 +1259,10 @@ async fn record_toolchain_sizes(
12491259 record ( conn, aid, "libLLVM" , paths. lib_llvm . as_deref ( ) ) . await ;
12501260}
12511261
1252- fn add_perf_config ( directory : & Path , category : Category ) {
1262+ fn add_perf_config ( directory : & Path , category : Category , artifact : ArtifactType ) {
12531263 let data = serde_json:: json!( {
1254- "category" : category. to_string( )
1264+ "category" : category,
1265+ "artifact" : artifact
12551266 } ) ;
12561267
12571268 let mut file = BufWriter :: new (
0 commit comments