From patchwork Thu Jul 12 10:59:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10521465 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1BB02603D7 for ; Thu, 12 Jul 2018 11:00:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 045A02925C for ; Thu, 12 Jul 2018 11:00:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ECEF329271; Thu, 12 Jul 2018 11:00:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6494A2925C for ; Thu, 12 Jul 2018 11:00:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 310CB6EF66; Thu, 12 Jul 2018 11:00:10 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by gabe.freedesktop.org (Postfix) with ESMTPS id B682A6EF50 for ; Thu, 12 Jul 2018 11:00:07 +0000 (UTC) Received: by mail-wr1-x442.google.com with SMTP id c13-v6so21205605wrt.1 for ; Thu, 12 Jul 2018 04:00:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=RdFdyKo3sPzUgkaEoNlrwFgn5hQU2JegkhvBIcXI1mQ=; b=ROXXQ75oYg8VpHC7eLPgvyvB+UA8lJq006y88nO3oQEYiAxV8T+Kr/jJwbDqQBkuuH nktk3uxPX+lXxoWyIdrpobeU7LxFudASwRPXRwKYOzEahHaSJq+EHBoNDzp/YVHn5H+i irR1ZRJacvXXcT6xf4jK5wPXJiiUctwq8Dw37SsNpe4pTXPo98N1vHHo6tzzVqOC29Ky wpYMj4XXl1A0MZfXPvlMDF16P0533aBb2mroCx2rWn0yIJFaRttv+AIcIfWOeOaF8kC5 ey/4j29nQh5eSsl/NBtdyklQ8HfGHdUh/J0Lz+nmQe5Q9rsd3p6mJ+sHfnc02c8bp3gy Jc3g== X-Gm-Message-State: AOUpUlGFw2iLehRNtdN/HXE/kl8uowmnKuFKLcqbYPhJbuxKQnzrSQf9 fX4y8ttgU29Ov786jD4/BHhg2g== X-Google-Smtp-Source: AAOMgpdHo0TNZqwvk3gQ8LJz0iLUMCfgLXmAXO2d0vf2y5n3OZ9vy2XTFJwMyB/AhA5G/WDPchCfeA== X-Received: by 2002:adf:e405:: with SMTP id g5-v6mr1436761wrm.96.1531393206380; Thu, 12 Jul 2018 04:00:06 -0700 (PDT) Received: from localhost.localdomain ([95.146.151.144]) by smtp.gmail.com with ESMTPSA id z5-v6sm23494585wrv.2.2018.07.12.04.00.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Jul 2018 04:00:05 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: igt-dev@lists.freedesktop.org Date: Thu, 12 Jul 2018 11:59:52 +0100 Message-Id: <20180712105958.12953-4-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180712105958.12953-1-tvrtko.ursulin@linux.intel.com> References: <20180712105958.12953-1-tvrtko.ursulin@linux.intel.com> Subject: [Intel-gfx] [PATCH i-g-t 3/9] trace.pl: Improve readability of graphical timeline representation X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-gfx@lists.freedesktop.org MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP From: Tvrtko Ursulin We add stripes for different stages of request execution so it is easier to follow one context in the multi-colour mode. Vertical stripe pattern indicates pipeline "blockages" - requests waiting for dependencies before they are runnable. Diagonal stripes indicate runnable requests waiting for GPU time. Horizontal strips are requests executing on the GPU. Also use this new multi-coloured mode from media-bench.pl. v2: John Harrison: * Mention media-bench.pl in the commit. * Fix HTML for single colour mode. v3: * Rebase. * Apply stripes to legacy colouring as well. v4: John Harrison: * Use per context colours for ctxsave and incomplete boxes. * Clearer timeline legend. Signed-off-by: Tvrtko Ursulin Cc: John Harrison Reviewed-by: John Harrison --- scripts/media-bench.pl | 2 +- scripts/trace.pl | 112 ++++++++++++++++++++++++++++++++--------- 2 files changed, 90 insertions(+), 24 deletions(-) diff --git a/scripts/media-bench.pl b/scripts/media-bench.pl index c5628c7f2836..375844d9cdf6 100755 --- a/scripts/media-bench.pl +++ b/scripts/media-bench.pl @@ -207,7 +207,7 @@ sub trace_workload show_cmd($cmd); system($cmd); - $cmd = "perf script | $tracepl --html -x ctxsave -s "; + $cmd = "perf script | $tracepl --html -x ctxsave -s -c "; $cmd .= join ' ', map("-i $_", @skip_engine); $cmd .= " > ${file}.html"; show_cmd($cmd); diff --git a/scripts/trace.pl b/scripts/trace.pl index 726c90d44547..56a4d4fd8bb2 100755 --- a/scripts/trace.pl +++ b/scripts/trace.pl @@ -737,9 +737,14 @@ foreach my $key (keys %reqwait) { say sprintf('GPU: %.2f%% idle, %.2f%% busy', $flat_busy{'gpu-idle'}, $flat_busy{'gpu-busy'}) unless $html; -my $queued_colour = $colour_contexts ? 'multi-colour light' : 'blue'; -my $runnable_colour = $colour_contexts ? 'multi-colour dark' : 'grey'; -my $execute_colour = $colour_contexts ? 'multi-colour' : 'pink'; +my $timeline_text = $colour_contexts ? + 'Per context coloured shading like:' : 'Box shading like:'; + +my $queued_style = box_style($min_ctx, 'queue'); +my $ready_style = box_style($min_ctx, 'ready'); +my $execute_style = box_style($min_ctx, 'execute'); +my $ctxsave_style = box_style($min_ctx, 'ctxsave'); +my $incomplete_style = box_style($min_ctx, 'incomplete'); print < @@ -758,9 +763,28 @@ print <

-$execute_colour = requests executing on the GPU
-$runnable_colour = runnable requests waiting for a slot on GPU
-$queued_colour = requests waiting on fences and dependencies before they are runnable
+Timeline request view: + + + + + + + + + + + + +
$timeline_text
QUEUED
READY
EXECUTE
CTXSAVE
(INCOMPLETE)
+

+

+ +QUEUED = requests executing on the GPU
+READY = runnable requests waiting for a slot on GPU
+EXECUTE = requests waiting on fences and dependencies before they are runnable
+CTXSAVE = GPU saving the context image
+

Boxes are in format 'ctx-id/seqno'. @@ -880,17 +904,31 @@ sub sortQueue { sub ctx_colour { - my ($ctx, $stage) = (@_); + my ($ctx, $stage, $lfac) = (@_); my ($s, $l); my $val; unless ($colour_contexts) { if ($stage eq 'queue') { - return 'lightblue;'; + $val = 210; + $s = 65; + $l = 52; } elsif ($stage eq 'ready') { - return 'lightgrey;'; + $val = 0; + $s = 0; + $l = 47; } elsif ($stage eq 'execute') { - return 'pink;'; + $val = 346; + $s = 68; + $l = 65; + } elsif ($stage eq 'ctxsave') { + $val = 26; + $s = 90; + $l = 52; + } elsif ($stage eq 'incomplete') { + $val = 0; + $s = 85; + $l = 50; } } else { if ($stage eq 'queue') { @@ -902,12 +940,45 @@ sub ctx_colour } elsif ($stage eq 'execute') { $s = 80; $l = 65; + } elsif ($stage eq 'ctxsave') { + $s = 75; + $l = 70; + } elsif ($stage eq 'incomplete') { + $s = 80; + $l = 25; } + + $val = int(360 / ($max_ctx - $min_ctx + 1)) * ($ctx - $min_ctx); } - $val = int(360 / ($max_ctx - $min_ctx + 1)) * ($ctx - $min_ctx); + $l = int($l * $lfac); - return "hsl($val, $s%, $l%);"; + return "hsl($val, $s%, $l%)"; +} + +sub box_style +{ + my ($ctx, $stage) = @_; + my $deg; + + if ($stage eq 'queue') { + $deg = 90; + } elsif ($stage eq 'ready') { + $deg = 45; + } elsif ($stage eq 'execute') { + $deg = 0; + } elsif ($stage eq 'ctxsave') { + $deg = 105; + } elsif ($stage eq 'incomplete') { + $deg = 0; + } + + return 'color: black; background: repeating-linear-gradient(' . + $deg . 'deg, ' . + ctx_colour($ctx, $stage, 1.0) . ', ' . + ctx_colour($ctx, $stage, 1.0) . ' 10px, ' . + ctx_colour($ctx, $stage, 0.90) . ' 10px, ' . + ctx_colour($ctx, $stage, 0.90) . ' 20px);'; } my $i = 0; @@ -925,8 +996,7 @@ foreach my $key (sort sortQueue keys %db) { # submit to execute unless (exists $skip_box{'queue'}) { $skey = 2 * $max_seqno * $ctx + 2 * $seqno; - $style = 'color: black; background-color: ' . - ctx_colour($ctx, 'queue'); + $style = box_style($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: $subgroup, subgroupOrder: $subgroup, content: '$content', $startend, style: \'$style\'},\n"; @@ -936,8 +1006,7 @@ foreach my $key (sort sortQueue keys %db) { # execute to start unless (exists $skip_box{'ready'}) { $skey = 2 * $max_seqno * $ctx + 2 * $seqno + 1; - $style = 'color: black; background-color: ' . - ctx_colour($ctx, 'ready'); + $style = box_style($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: $subgroup, subgroupOrder: $subgroup, content: '$content', $startend, style: \'$style\'},\n"; @@ -947,12 +1016,9 @@ foreach my $key (sort sortQueue keys %db) { # start to user interrupt unless (exists $skip_box{'execute'}) { $skey = -2 * $max_seqno * $ctx - 2 * $seqno - 1; - if (exists $db{$key}->{'incomplete'}) { - $style = 'color: white; background-color: red;'; - } else { - $style = 'color: black; background-color: ' . - ctx_colour($ctx, 'execute'); - } + $style = box_style($ctx, + exists $db{$key}->{'incomplete'} ? + 'incomplete' : 'execute'); $content = "$name $db{$key}->{'port'}"; $content .= ' ??? ' if exists $db{$key}->{'incomplete'}; $content .= ' ++ ' if exists $db{$key}->{'no-end'}; @@ -966,7 +1032,7 @@ foreach my $key (sort sortQueue keys %db) { # user interrupt to context complete unless (exists $skip_box{'ctxsave'}) { $skey = -2 * $max_seqno * $ctx - 2 * $seqno; - $style = 'color: black; background-color: orange;'; + $style = box_style($ctx, 'ctxsave'); my $ctxsave = $db{$key}->{'end'} - $db{$key}->{'notify'}; $content = "$name
${ctxsave}us
"; $content .= ' ??? ' if exists $db{$key}->{'incomplete'};