From patchwork Tue May 22 11:14:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10418025 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 CF1A16053B for ; Tue, 22 May 2018 11:14:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF31528C0F for ; Tue, 22 May 2018 11:14:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B3CEE28C16; Tue, 22 May 2018 11:14:49 +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 CDC9C28C0F for ; Tue, 22 May 2018 11:14:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 26A9289CBA; Tue, 22 May 2018 11:14:48 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wr0-x244.google.com (mail-wr0-x244.google.com [IPv6:2a00:1450:400c:c0c::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id A73FC89CBA for ; Tue, 22 May 2018 11:14:46 +0000 (UTC) Received: by mail-wr0-x244.google.com with SMTP id p3-v6so647159wrn.7 for ; Tue, 22 May 2018 04:14:46 -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=bQtZYa0+2rPD6G5i2R/CpnwlBFHyLSihogYIi69IAfE=; b=hN1ify1W/aJM8FCIZTy5aNpCpZrCOMa2q9djqcUbE+npBqlIyElUOGOuw+OY4+CQEW RLEj1QCX0mLRCPH3WOsiolLZYga6WqMHH0AOnH82HhAfyZcpRRlnG0mDKggl7WORpbkG GmtsoIq2hq9Xh6BVPy58mjT6gcgZvWnRV+OC/PLHuEDlkWkrdpCX9IP7xkG1SvSnP0kS nqLjlmiWEO0SWEhq8x40N/07IikcPJAdYWk+fIEAqBkniBLiOLIHIk6HFBkOPQfAwJMx gmp/RC1dReSrrF/n0+zQ2BIdTbReTXWOz/gWZlEGuL5cHnD9IfRSHdMIRMsgiD+6Lm/k KHbA== X-Gm-Message-State: ALKqPwfIdos3F5gUsyOUNERNu6djg9V9FH8/wEGwhil2A7lcze0vAQms 0BMCxBDYdWmZMa/8bSt3bEbxnw== X-Google-Smtp-Source: AB8JxZoE0z5mX/6Lj8FY2iQQ85MdNVvAaINBAZLFFzJNIC72MAFfjTsyRS1GKBAwQUO7KI7thEth+w== X-Received: by 2002:adf:a282:: with SMTP id s2-v6mr1519104wra.114.1526987685192; Tue, 22 May 2018 04:14:45 -0700 (PDT) Received: from localhost.localdomain ([95.146.151.144]) by smtp.gmail.com with ESMTPSA id 60-v6sm1527558wrc.42.2018.05.22.04.14.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 May 2018 04:14:44 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: igt-dev@lists.freedesktop.org Date: Tue, 22 May 2018 12:14:39 +0100 Message-Id: <20180522111439.31340-1-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: References: Subject: [Intel-gfx] [PATCH i-g-t v2 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. 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. Signed-off-by: Tvrtko Ursulin --- scripts/media-bench.pl | 2 +- scripts/trace.pl | 31 ++++++++++++++++++++----------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/scripts/media-bench.pl b/scripts/media-bench.pl index 723e5f1cf1b8..bfea9ca008d9 100755 --- a/scripts/media-bench.pl +++ b/scripts/media-bench.pl @@ -212,7 +212,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..754075703edd 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 < @@ -892,11 +892,23 @@ sub ctx_colour my ($ctx, $s, $l) = (@_); my $val; - return 'Pink;' unless $colour_contexts; + return 'Pink' unless $colour_contexts; $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'};