From patchwork Thu May 10 10:19:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10391593 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 1E65060153 for ; Thu, 10 May 2018 10:20:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0EC07289BC for ; Thu, 10 May 2018 10:20:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 01188289C5; Thu, 10 May 2018 10:19:59 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 CCB032890F for ; Thu, 10 May 2018 10:19:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2CB226EEDD; Thu, 10 May 2018 10:19:55 +0000 (UTC) X-Original-To: Intel-gfx@lists.freedesktop.org Delivered-To: Intel-gfx@lists.freedesktop.org Received: from mail-wr0-x243.google.com (mail-wr0-x243.google.com [IPv6:2a00:1450:400c:c0c::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 170C06EED8 for ; Thu, 10 May 2018 10:19:54 +0000 (UTC) Received: by mail-wr0-x243.google.com with SMTP id q3-v6so1453099wrj.6 for ; Thu, 10 May 2018 03:19:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ursulin-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=d/As0FIQqsI2ueQDTKPt+IfKn39JH+gpkg6ROUPpVgU=; b=v3fG9qT+4DGfqZO/jp1o48DfKdJ+/Z3gxVMAq7Qo7erzZB7DprIi5o1XV3howAqdJ6 AgFTlnjoreuC8vj0xSxFWWAjyG6lrYJ6TrYE1sIzowRmCGZ20fLZTLA6OkLfTxEK4W0i NDVQyT8OuVk23ayd1Yew9uifSDeuQ9Mid+aY40Or6MKOrQ/G8Ku0lP3nIkOtBGyZH1Ae VQKifxfzK1iC/UKgjfU5hP8XglPBe+Ob5XRaqDqRkKLmApoisb6KhnV1dQJ8p5WWJ1VE gkcu338ZojPv6f/Y9Ruxb5IogKmdtnVWh1N8ADwbx45Rwe5d0JJvMuNToKXIiUVOOgyp TQtQ== 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=d/As0FIQqsI2ueQDTKPt+IfKn39JH+gpkg6ROUPpVgU=; b=pd6VF7k/E3EogtEylvQri2yStAz15nYQck5gZJxN69WDb/xrMj+d8uYVZ9+BwL6hlY XyK28sfjQlEgL9ZDFENIp6/VD934psF4jYVHkzau8hQ5CUkS1mysIArju5c080CBfIDM Yfs01y4/VVU4RxY1+0Zw1xmEbreyD5hQ+dKzslsQjhERttdQ743Pe9pkH55EEzmIhelh 3RmlTv8DvRGYunT7nDA7HdvoFO+qjCJx1A16mGtOEmgllPBfKGFqnoGBtXEoC+K4Larc IWeugiJuox4TdInV/1YpeBchVJWXm9SK7+he6aeQHL8dRl3Cotr8aY03x+nflz2zrq2e xPQQ== X-Gm-Message-State: ALKqPwf6ZCUXyR3n5Xqvs37v1wQGGYlvqku6nersBLq7W2Wc7lCjSou7 itRdlosn1cKJZNIR/KuxVj3kXdBa X-Google-Smtp-Source: AB8JxZrv99RpFUrspoBydWtiupFIL2W9qTDIjAF9wTgNMHLt2V5rar/m4JjHXgdqK3ZOatfLsUkDsQ== X-Received: by 2002:adf:e843:: with SMTP id d3-v6mr854784wrn.146.1525947592715; Thu, 10 May 2018 03:19:52 -0700 (PDT) Received: from localhost.localdomain ([95.146.151.144]) by smtp.gmail.com with ESMTPSA id o53-v6sm1178774wrc.96.2018.05.10.03.19.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 May 2018 03:19:52 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: igt-dev@lists.freedesktop.org Date: Thu, 10 May 2018 11:19:17 +0100 Message-Id: <20180510101924.20814-2-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180510101924.20814-1-tvrtko.ursulin@linux.intel.com> References: <20180510101924.20814-1-tvrtko.ursulin@linux.intel.com> Subject: [Intel-gfx] [PATCH i-g-t 2/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. Signed-off-by: Tvrtko Ursulin --- scripts/media-bench.pl | 2 +- scripts/trace.pl | 29 +++++++++++++++++++---------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/scripts/media-bench.pl b/scripts/media-bench.pl index 78f45199e95d..c07555b0dc74 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 --squash-ctx-id "; + $cmd = "perf script | $tracepl --html -x ctxsave -s -c --squash-ctx-id "; $cmd .= join ' ', map("-i $_", @skip_engine); $cmd .= " > ${file}.html"; show_cmd($cmd); diff --git a/scripts/trace.pl b/scripts/trace.pl index c8182a8ea86d..7f181a3fa2f5 100755 --- a/scripts/trace.pl +++ b/scripts/trace.pl @@ -743,9 +743,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 < @@ -896,7 +896,19 @@ sub ctx_colour $val = int(360 / ($max_ctx - $min_ctx + 1)) * ($ctx - $min_ctx); - return "hsl($val, $s%, $l%);"; + return "hsl($val, $s%, $l%)"; +} + +sub box_style +{ + my ($ctx, $deg, $s, $l) = @_; + + return 'color: black; background: repeating-linear-gradient(' . + $deg . 'deg, ' . + ctx_colour($ctx, $s, $l) . ', ' . + ctx_colour($ctx, $s, $l) . ' 10px, ' . + ctx_colour($ctx, $s, int($l * 0.90)) . ' 10px, ' . + ctx_colour($ctx, $s, int($l * 0.90)) . ' 20px);'; } my $i = 0; @@ -913,8 +925,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, 35, 85); + $style = box_style($ctx, 90, 35, 85); $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"; @@ -924,8 +935,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, 35, 45); + $style = box_style($ctx, 45, 35, 45); $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"; @@ -938,8 +948,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, 80, 65); + $style = box_style($ctx, 0, 80, 65); } $content = "$name $db{$key}->{'port'}"; $content .= ' ??? ' if exists $db{$key}->{'incomplete'};