File tree Expand file tree Collapse file tree 2 files changed +33
-1
lines changed Expand file tree Collapse file tree 2 files changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,8 @@ const AXES_COLOR = getCssColor('--canvas-axes');
68
68
const GRID_COLOR = getCssColor ( '--canvas-grid' ) ;
69
69
const CODEGEN_COLOR = getCssColor ( '--canvas-codegen' ) ;
70
70
const LINK_COLOR = getCssColor ( '--canvas-link' ) ;
71
+ // Final leftover section after link
72
+ const OTHER_COLOR = getCssColor ( '--canvas-other' ) ;
71
73
const CUSTOM_BUILD_COLOR = getCssColor ( '--canvas-custom-build' ) ;
72
74
const NOT_CUSTOM_BUILD_COLOR = getCssColor ( '--canvas-not-custom-build' ) ;
73
75
const DEP_LINE_COLOR = getCssColor ( '--canvas-dep-line' ) ;
@@ -222,6 +224,13 @@ function render_pipeline_graph() {
222
224
line : false
223
225
} ) ;
224
226
}
227
+ if ( presentSections . has ( "other" ) ) {
228
+ legend_entries . push ( {
229
+ name : "Other" ,
230
+ color : OTHER_COLOR ,
231
+ line : false
232
+ } ) ;
233
+ }
225
234
draw_legend ( ctx , 160 , legend_entries ) ;
226
235
ctx . restore ( ) ;
227
236
}
@@ -289,6 +298,8 @@ function get_section_color(name) {
289
298
return CODEGEN_COLOR ;
290
299
} else if ( name === "link" ) {
291
300
return LINK_COLOR ;
301
+ } else if ( name === "other" ) {
302
+ return OTHER_COLOR ;
292
303
} else {
293
304
// We do not know what section this is, so just use the default color
294
305
return NOT_CUSTOM_BUILD_COLOR ;
Original file line number Diff line number Diff line change @@ -615,7 +615,27 @@ impl<'gctx> Timings<'gctx> {
615
615
. collect ( ) ;
616
616
let aggregated = ut. aggregate_sections ( ) ;
617
617
let sections = match aggregated {
618
- AggregatedSections :: Sections ( sections) => Some ( sections) ,
618
+ AggregatedSections :: Sections ( mut sections) => {
619
+ // We draw the sections in the pipeline graph in a way where the frontend
620
+ // section has the "default" build color, and then additional sections
621
+ // (codegen, link) are overlayed on top with a different color.
622
+ // However, there might be some time after the final (usually link) section,
623
+ // which definitely shouldn't be classified as "Frontend". We thus try to
624
+ // detect this situation and add a final "Other" section.
625
+ if let Some ( ( _, section) ) = sections. last ( )
626
+ && section. end < ut. duration
627
+ {
628
+ sections. push ( (
629
+ "other" . to_string ( ) ,
630
+ SectionData {
631
+ start : section. end ,
632
+ end : ut. duration ,
633
+ } ,
634
+ ) ) ;
635
+ }
636
+
637
+ Some ( sections)
638
+ }
619
639
AggregatedSections :: OnlyMetadataTime { .. }
620
640
| AggregatedSections :: OnlyTotalDuration => None ,
621
641
} ;
@@ -880,6 +900,7 @@ static HTML_TMPL: &str = r#"
880
900
--canvas-grid: #e6e6e6;
881
901
--canvas-codegen: #aa95e8;
882
902
--canvas-link: #95e8aa;
903
+ --canvas-other: #e895aa;
883
904
--canvas-custom-build: #f0b165;
884
905
--canvas-not-custom-build: #95cce8;
885
906
--canvas-dep-line: #ddd;
You can’t perform that action at this time.
0 commit comments