@@ -12,7 +12,6 @@ import {daysBetweenDates, getFutureDate, getPastDate} from "./utils";
12
12
import {GraphRenderOpts , renderPlots } from " ../../../../graph/render" ;
13
13
import {GraphData , GraphKind , GraphsSelector } from " ../../../../graph/data" ;
14
14
import uPlot from " uplot" ;
15
- import CachegrindCmd from " ../../../../components/cachegrind-cmd.vue" ;
16
15
import {
17
16
COMPILE_DETAIL_GRAPHS_RESOLVER ,
18
17
COMPILE_DETAIL_SECTIONS_RESOLVER ,
@@ -23,6 +22,7 @@ import {
23
22
} from " ./detail-resolver" ;
24
23
import CompileSectionsChart from " ./sections-chart.vue" ;
25
24
import PerfettoLink from " ../../../../components/perfetto-link.vue" ;
25
+ import ProfileShortcut from " ./shortcuts/profile-shortcut.vue" ;
26
26
27
27
const props = defineProps <{
28
28
testCase: CompileTestCase ;
@@ -269,31 +269,6 @@ const relativeChartElement: Ref<HTMLElement | null> = ref(null);
269
269
const absoluteChartElement: Ref <HTMLElement | null > = ref (null );
270
270
const graphRange = computed (() => getGraphRange (props .artifact ));
271
271
272
- enum ProfileCommand {
273
- Before = " before" ,
274
- After = " after" ,
275
- Diff = " diff" ,
276
- }
277
-
278
- const profileCommand: Ref <ProfileCommand > = ref (ProfileCommand .Diff );
279
- const profileCommit = computed (() => {
280
- if (profileCommand .value === ProfileCommand .Before ) {
281
- return props .baseArtifact .commit ;
282
- }
283
- return props .artifact .commit ;
284
- });
285
- const profileBaselineCommit = computed (() => {
286
- if (profileCommand .value === ProfileCommand .Diff ) {
287
- return props .baseArtifact .commit ;
288
- }
289
- return undefined ;
290
- });
291
-
292
- function changeProfileCommand(event : Event ) {
293
- const target = event .target as HTMLSelectElement ;
294
- profileCommand .value = target .value as ProfileCommand ;
295
- }
296
-
297
272
const sectionsDetail: Ref <CompileDetailSections | null > = ref (null );
298
273
onMounted (() => {
299
274
loadGraphs ().then ((d ) => {
@@ -455,40 +430,11 @@ onMounted(() => {
455
430
</div >
456
431
</div >
457
432
</div >
458
- <div class =" command" >
459
- <div class =" title bold" >
460
- Local profiling command<Tooltip >
461
- Execute this command in a checkout of
462
- <a href =" https://github.com/rust-lang/rustc-perf" >rustc-perf</a >,
463
- after a `cargo build --release`, to generate a Cachegrind profile.
464
- </Tooltip >
465
- </div >
466
-
467
- <select @change =" changeProfileCommand" >
468
- <option
469
- :value =" ProfileCommand.Diff"
470
- :selected =" profileCommand === ProfileCommand.Diff"
471
- >
472
- Diff
473
- </option >
474
- <option
475
- :value =" ProfileCommand.Before"
476
- :selected =" profileCommand === ProfileCommand.Before"
477
- >
478
- Baseline commit
479
- </option >
480
- <option
481
- :value =" ProfileCommand.After"
482
- :selected =" profileCommand === ProfileCommand.After"
483
- >
484
- Benchmarked commit
485
- </option >
486
- </select >
487
-
488
- <CachegrindCmd
489
- :commit =" profileCommit"
490
- :baseline-commit =" profileBaselineCommit"
491
- :test-case =" testCase"
433
+ <div class =" shortcut" >
434
+ <ProfileShortcut
435
+ :artifact =" props.artifact"
436
+ :base-artifact =" props.baseArtifact"
437
+ :test-case =" props.testCase"
492
438
/>
493
439
</div >
494
440
</div >
@@ -521,7 +467,7 @@ onMounted(() => {
521
467
align-items : center ;
522
468
}
523
469
}
524
- .command {
470
+ .shortcut {
525
471
margin-top : 15px ;
526
472
text-align : left ;
527
473
}
0 commit comments