From patchwork Tue Jun 5 17:50:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10448907 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 A426560375 for ; Tue, 5 Jun 2018 17:51:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 925C329ACD for ; Tue, 5 Jun 2018 17:51:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8766C29B27; Tue, 5 Jun 2018 17:51:01 +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 0DF4629ACD for ; Tue, 5 Jun 2018 17:51:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6ADFD6EED8; 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-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) by gabe.freedesktop.org (Postfix) with ESMTPS id 46D736E31E for ; Tue, 5 Jun 2018 17:50:57 +0000 (UTC) Received: by mail-wm0-x22d.google.com with SMTP id x6-v6so6524661wmc.3 for ; Tue, 05 Jun 2018 10:50:57 -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; bh=FlFkG9p0ja+Rs2TPrrbWks+n4bhK7C+ZV5B3H6SH6w8=; b=NCAfVxLCKIfAveEwlWbVbyaRxc3BWbd5ysOlwgs0O6/tlaNWuvoys2lEsjcbYUPkJI jfdGnQLzbWKjqdrj9GamMxbEP95nX/B07mAg9w9p1bJImFZN5ZXpCh+Q84mm/6k3eQxi ek1yuYHG72Vu+lJNEHTL9phtV9IckfjPf2O1gj3EXJujp0doDelXJAW2pJ9nr65D+IW0 ZG3UlZRNWv3HZEyYzbthnVSrVKcn2KJBUpIH0020BF835QCXAjA2Gel55Gf1B+TbXwIA 5W8trL/wwlvqpEZqtgE51L/39zDgute2XhRwzbk9OVfS5rm5NkUPJY5soFoa6i/RPVkZ kH8Q== X-Gm-Message-State: APt69E3RR80AMOGm2kYcfQ3f3qrOJ/YW+L6Av8+U273o1xWbYvXrZto+ ol/P9bvYd8cSX3+F9680tsgpSg== X-Google-Smtp-Source: ADUXVKKaaaG8T87u4JX6k4mAk8uhJLHvXI8d+3gvf6s6HMCsismksdxlUvo//C0ydAqWsHApU2VcBA== X-Received: by 2002:a1c:d509:: with SMTP id m9-v6mr109392wmg.69.1528221055832; Tue, 05 Jun 2018 10:50:55 -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:55 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: igt-dev@lists.freedesktop.org Date: Tue, 5 Jun 2018 18:50:43 +0100 Message-Id: <20180605175050.29850-1-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.17.0 Subject: [Intel-gfx] [PATCH i-g-t 1/8] trace.pl: Fix no context colouring mode 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 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 --- scripts/trace.pl | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/scripts/trace.pl b/scripts/trace.pl index ea6c667696f4..fd414f5a4b1e 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'};