@@ -179,6 +179,31 @@ const cargoProfile = computed((): CargoProfileMetadata => {
179
179
const chartElement: Ref <HTMLElement | null > = ref (null );
180
180
const graphRange = computed (() => getGraphRange (props .artifact ));
181
181
182
+ enum ProfileCommand {
183
+ Before = " before" ,
184
+ After = " after" ,
185
+ Diff = " diff" ,
186
+ }
187
+
188
+ const profileCommand: Ref <ProfileCommand > = ref (ProfileCommand .Diff );
189
+ const profileCommit = computed (() => {
190
+ if (profileCommand .value === ProfileCommand .Before ) {
191
+ return props .baseArtifact .commit ;
192
+ }
193
+ return props .artifact .commit ;
194
+ });
195
+ const profileBaselineCommit = computed (() => {
196
+ if (profileCommand .value === ProfileCommand .Diff ) {
197
+ return props .baseArtifact .commit ;
198
+ }
199
+ return undefined ;
200
+ });
201
+
202
+ function changeProfileCommand(event : Event ) {
203
+ const target = event .target as HTMLSelectElement ;
204
+ profileCommand .value = target .value as ProfileCommand ;
205
+ }
206
+
182
207
onMounted (() => renderGraph ());
183
208
</script >
184
209
@@ -288,12 +313,34 @@ onMounted(() => renderGraph());
288
313
Local profiling command<Tooltip >
289
314
Execute this command in a checkout of
290
315
<a href =" https://github.com/rust-lang/rustc-perf" >rustc-perf</a >
291
- to generate a Cachegrind diff between the two artifacts .
316
+ to generate a Cachegrind profile .
292
317
</Tooltip >
293
318
</div >
319
+
320
+ <select @change =" changeProfileCommand" >
321
+ <option
322
+ :value =" ProfileCommand.Diff"
323
+ :selected =" profileCommand === ProfileCommand.Diff"
324
+ >
325
+ Diff
326
+ </option >
327
+ <option
328
+ :value =" ProfileCommand.Before"
329
+ :selected =" profileCommand === ProfileCommand.Before"
330
+ >
331
+ Baseline commit
332
+ </option >
333
+ <option
334
+ :value =" ProfileCommand.After"
335
+ :selected =" profileCommand === ProfileCommand.After"
336
+ >
337
+ Benchmarked commit
338
+ </option >
339
+ </select >
340
+
294
341
<CachegrindCmd
295
- :commit =" artifact.commit "
296
- :baseline_commit = " baseArtifact.commit "
342
+ :commit =" profileCommit "
343
+ :baseline-commit = " profileBaselineCommit "
297
344
:test-case =" testCase"
298
345
/>
299
346
</div >
0 commit comments