[Intel-gfx] [PATCH i-g-t 04/11] trace.pl: Put single context at single vertical slot

Tvrtko Ursulin tursulin at ursulin.net
Mon Jul 9 13:19:57 UTC 2018


From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

Turn off timeline stacking in favour of putting all the boxes belonging to
a single context at the same vertical slot.

Also remove the custom sorting function in favour of correctly assigning
the subgroup id's and order which greatly speeds up the library operations.

And finally remove the 'Toggle stacking' button which never worked.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Cc: John Harrison <John.C.Harrison at Intel.com>
---
 scripts/trace.pl | 25 ++++++-------------------
 1 file changed, 6 insertions(+), 19 deletions(-)

diff --git a/scripts/trace.pl b/scripts/trace.pl
index 4d3e06434f05..e2978e5382c2 100755
--- a/scripts/trace.pl
+++ b/scripts/trace.pl
@@ -768,9 +768,6 @@ print <<ENDHTML if $html;
   <link href="node_modules/vis//dist/vis.css" rel="stylesheet" type="text/css" />
 </head>
 <body>
-
-<button onclick="toggleStackSubgroups()">Toggle stacking</button>
-
 <p>
 <b>Timeline request view:</b>
 <table>
@@ -997,6 +994,7 @@ foreach my $key (sort sortQueue keys %db) {
 	my $submit = $queue + $db{$key}->{'submit-delay'};
 	my ($content, $style);
 	my $group = $engine_start_id + $rings{$db{$key}->{'ring'}};
+	my $subgroup = $ctx - $min_ctx;
 	my $type = ' type: \'range\',';
 	my $startend;
 	my $skey;
@@ -1007,7 +1005,7 @@ foreach my $key (sort sortQueue keys %db) {
 		$style = box_style($ctx, 'queue');
 		$content = "$name<br>$db{$key}->{'submit-delay'}us <small>($db{$key}->{'execute-delay'}us)</small>";
 		$startend = 'start: \'' . ts($queue) . '\', end: \'' . ts($submit) . '\'';
-		print "\t{id: $i, key: $skey, $type group: $group, subgroup: 1, subgroupOrder: 1, content: '$content', $startend, style: \'$style\'},\n";
+		print "\t{id: $i, key: $skey, $type group: $group, subgroup: $subgroup, subgroupOrder: $subgroup, content: '$content', $startend, style: \'$style\'},\n";
 		$i++;
 	}
 
@@ -1017,7 +1015,7 @@ foreach my $key (sort sortQueue keys %db) {
 		$style = box_style($ctx, 'ready');
 		$content = "<small>$name<br>$db{$key}->{'execute-delay'}us</small>";
 		$startend = 'start: \'' . ts($submit) . '\', end: \'' . ts($start) . '\'';
-		print "\t{id: $i, key: $skey, $type group: $group, subgroup: 1, subgroupOrder: 2, content: '$content', $startend, style: \'$style\'},\n";
+		print "\t{id: $i, key: $skey, $type group: $group, subgroup: $subgroup, subgroupOrder: $subgroup, content: '$content', $startend, style: \'$style\'},\n";
 		$i++;
 	}
 
@@ -1033,7 +1031,7 @@ foreach my $key (sort sortQueue keys %db) {
 		$content .= ' <small><i>+</i></small> ' if exists $db{$key}->{'no-notify'};
 		$content .= "<br>$db{$key}->{'duration'}us <small>($db{$key}->{'context-complete-delay'}us)</small>";
 		$startend = 'start: \'' . ts($start) . '\', end: \'' . ts($notify) . '\'';
-		print "\t{id: $i, key: $skey, $type group: $group, subgroup: 2, subgroupOrder: 3, content: '$content', $startend, style: \'$style\'},\n";
+		print "\t{id: $i, key: $skey, $type group: $group, subgroup: $subgroup, subgroupOrder: $subgroup, content: '$content', $startend, style: \'$style\'},\n";
 		$i++;
 	}
 
@@ -1047,7 +1045,7 @@ foreach my $key (sort sortQueue keys %db) {
 		$content .= ' <small><i>++</i></small> ' if exists $db{$key}->{'no-end'};
 		$content .= ' <small><i>+</i></small> ' if exists $db{$key}->{'no-notify'};
 		$startend = 'start: \'' . ts($notify) . '\', end: \'' . ts($end) . '\'';
-		print "\t{id: $i, key: $skey, $type group: $group, subgroup: 2, subgroupOrder: 4, content: '$content', $startend, style: \'$style\'},\n";
+		print "\t{id: $i, key: $skey, $type group: $group, subgroup: $subgroup, subgroupOrder: $subgroup, content: '$content', $startend, style: \'$style\'},\n";
 		$i++;
 	}
 
@@ -1090,29 +1088,18 @@ $first_ts = ts($first_ts);
 print <<ENDHTML;
   ]);
 
-  function customOrder (a, b) {
-  // order by id
-    return a.subgroupOrder - b.subgroupOrder;
-  }
-
   // Configuration for the Timeline
   var options = { groupOrder: 'content',
 		  horizontalScroll: true,
-		  stack: true,
+		  stack: false,
 		  stackSubgroups: false,
 		  zoomKey: 'ctrlKey',
 		  orientation: 'top',
-		  order: customOrder,
 		  start: '$first_ts',
 		  end: '$end_ts'};
 
   // Create a Timeline
   var timeline = new vis.Timeline(container, items, groups, options);
-
-    function toggleStackSubgroups() {
-        options.stackSubgroups = !options.stackSubgroups;
-        timeline.setOptions(options);
-    }
 ENDHTML
 
 print <<ENDHTML;
-- 
2.17.1



More information about the Intel-gfx mailing list