From 93cf6931b33e2c0f5b89c89b65817fe245ecc391 Mon Sep 17 00:00:00 2001 From: Tvrtko Ursulin Date: Mon, 9 Jul 2018 14:19:54 +0100 Subject: trace.pl: Fix no context colouring mode Commit 87d2affc380da96ba66c258c5337c363fe8651ef ("trace.pl: Add support for colouring context execution"), due some dodgy attempts at patch splitting broke the legacy colouring mode. Fix it by passing in the request stage into the helper so all stages can be correctly coloured in both modes. Signed-off-by: Tvrtko Ursulin Cc: John Harrison Reviewed-by: John Harrison --- scripts/trace.pl | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/trace.pl b/scripts/trace.pl index ea6c6676..fd414f5a 100755 --- a/scripts/trace.pl +++ b/scripts/trace.pl @@ -873,10 +873,30 @@ sub sortQueue { sub ctx_colour { - my ($ctx, $s, $l) = (@_); + my ($ctx, $stage) = (@_); + my ($s, $l); my $val; - return 'Pink;' unless $colour_contexts; + unless ($colour_contexts) { + if ($stage eq 'queue') { + return 'lightblue;'; + } elsif ($stage eq 'ready') { + return 'lightgrey;'; + } elsif ($stage eq 'execute') { + return 'pink;'; + } + } else { + if ($stage eq 'queue') { + $s = 35; + $l = 85; + } elsif ($stage eq 'ready') { + $s = 35; + $l = 45; + } elsif ($stage eq 'execute') { + $s = 80; + $l = 65; + } + } $val = int(360 / ($max_ctx - $min_ctx + 1)) * ($ctx - $min_ctx); @@ -898,7 +918,7 @@ foreach my $key (sort sortQueue keys %db) { unless (exists $skip_box{'queue'}) { $skey = 2 * $max_seqno * $ctx + 2 * $seqno; $style = 'color: black; background-color: ' . - ctx_colour($ctx, 35, 85); + ctx_colour($ctx, 'queue'); $content = "$name
$db{$key}->{'submit-delay'}us ($db{$key}->{'execute-delay'}us)"; $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"; @@ -909,7 +929,7 @@ foreach my $key (sort sortQueue keys %db) { unless (exists $skip_box{'ready'}) { $skey = 2 * $max_seqno * $ctx + 2 * $seqno + 1; $style = 'color: black; background-color: ' . - ctx_colour($ctx, 35, 45); + ctx_colour($ctx, 'ready'); $content = "$name
$db{$key}->{'execute-delay'}us
"; $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"; @@ -923,7 +943,7 @@ foreach my $key (sort sortQueue keys %db) { $style = 'color: white; background-color: red;'; } else { $style = 'color: black; background-color: ' . - ctx_colour($ctx, 80, 65); + ctx_colour($ctx, 'execute'); } $content = "$name $db{$key}->{'port'}"; $content .= ' ??? ' if exists $db{$key}->{'incomplete'}; -- cgit v1.2.3