From patchwork Tue Jun 5 17:50:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10448915 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 07BD760375 for ; Tue, 5 Jun 2018 17:51:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA77129ACD for ; Tue, 5 Jun 2018 17:51:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF4C429B27; Tue, 5 Jun 2018 17:51:05 +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 47E6B29ACD for ; Tue, 5 Jun 2018 17:51:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 62D936EED6; Tue, 5 Jun 2018 17:50:59 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3613D6E31E for ; Tue, 5 Jun 2018 17:50:58 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id v131-v6so6760121wma.1 for ; Tue, 05 Jun 2018 10:50:58 -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=7WXDm23pAK4pwOVGeteUN3EPAncJNyCrAqLaE0lJ20c=; b=VOzHboa3CduUH+rK0BA+LtK7ONItaVQ3Hb0VyFQocmT/oRfJG8e9kD3ZYqWPTFAijd Oo7nP27+hjMqtqcmMkqJXA6KmdSzi60o/4m74lTd918c9Dz7atmUIXLmtXm4lmaUOOyB 2BQUgsSd8xWCpnZHpgFX4WAwtrQmsn6mhFiw67GA3G3sZh0iaC+dShk6yaDixrYS2Ync l0CfWEX7J/mM2CKnnh2jzV+9XuG65XB8Ol7iAgqa6fcRZDrlEMfNbiwtBSPeeYUCqOMA W08bWiVj730AxqJduYxHcAXrHTQVj3eM2ZZXkgN/eml/tzOXdkYHfuYVMiKjm6eQsw/k n28g== X-Gm-Message-State: APt69E26qbO1x2tADVYigKZ4qEN325BCs2HadrStN9tWDVA7CTcpjqY6 zUkVmB56GuC1X4dkNFSzo+BgVQ== X-Google-Smtp-Source: ADUXVKID7m4PJEjylo/hX34EDN2c8r6Y8G3em8ecz3jeNAH+2lE0lNiRuL4ZnbrYs2NZVd96HEVDlg== X-Received: by 2002:a1c:581:: with SMTP id 123-v6mr24910wmf.58.1528221056764; Tue, 05 Jun 2018 10:50:56 -0700 (PDT) Received: from localhost.localdomain ([95.146.151.144]) by smtp.gmail.com with ESMTPSA id u108-v6sm59739052wrc.40.2018.06.05.10.50.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Jun 2018 10:50:56 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: igt-dev@lists.freedesktop.org Date: Tue, 5 Jun 2018 18:50:44 +0100 Message-Id: <20180605175050.29850-2-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180605175050.29850-1-tvrtko.ursulin@linux.intel.com> References: <20180605175050.29850-1-tvrtko.ursulin@linux.intel.com> Subject: [Intel-gfx] [PATCH i-g-t 2/8] 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. Signed-off-by: Tvrtko Ursulin --- scripts/media-bench.pl | 2 +- scripts/trace.pl | 56 +++++++++++++++++++++++++++++++----------- 2 files changed, 42 insertions(+), 16 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 fd414f5a4b1e..7d5c19ffd2e7 100755 --- a/scripts/trace.pl +++ b/scripts/trace.pl @@ -727,9 +727,9 @@ 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 $queued_colour = $colour_contexts ? 'multi-colour light, vertical stripes' : 'blue'; +my $runnable_colour = $colour_contexts ? 'multi-colour dark, angled stripes' : 'grey'; +my $execute_colour = $colour_contexts ? 'multi-colour, horizontal stripes' : 'pink'; print < @@ -873,17 +873,23 @@ 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; } } else { if ($stage eq 'queue') { @@ -896,11 +902,34 @@ sub ctx_colour $s = 80; $l = 65; } + + $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%)"; +} + +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; + } - return "hsl($val, $s%, $l%);"; + 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; @@ -917,8 +946,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: 1, subgroupOrder: 1, content: '$content', $startend, style: \'$style\'},\n"; @@ -928,8 +956,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: 1, subgroupOrder: 2, content: '$content', $startend, style: \'$style\'},\n"; @@ -942,8 +969,7 @@ foreach my $key (sort sortQueue keys %db) { 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, 'execute'); } $content = "$name $db{$key}->{'port'}"; $content .= ' ??? ' if exists $db{$key}->{'incomplete'};