From patchwork Mon Jul 9 13:19:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10514567 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 7045B6032A for ; Mon, 9 Jul 2018 13:20:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 091F02894E for ; Mon, 9 Jul 2018 13:20:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F107228AFA; Mon, 9 Jul 2018 13:20:15 +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 728A728ABC for ; Mon, 9 Jul 2018 13:20:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0F18D6E160; Mon, 9 Jul 2018 13:20:13 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by gabe.freedesktop.org (Postfix) with ESMTPS id 152F46E123 for ; Mon, 9 Jul 2018 13:20:12 +0000 (UTC) Received: by mail-wr1-x436.google.com with SMTP id c13-v6so10929223wrt.1 for ; Mon, 09 Jul 2018 06:20:12 -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=YuuqDLfnn661igdahAIQ6NouazcDZvpf/o6Z+Xt+Lv0=; b=OeDKb/Hj9330ggOTdoNcSOdmjOySjxevDB3McNkTLK2areyvvMcexaP7A2qy6E+eTI us7nBezhJZfBaBRCbTwbn/TPjK/wrP3ZpNoD0xh+9gBL3RGq7GFNB2Bc9LjUKtnHnDsh U056zRKD0sK6j+/NCXnRTupCSBAs0YIT2jZratcPPJ8HPKAm03qieLT0w4TAnP4e/1Nz zSzuQ6tdHGuHIM6ukfBfAOd9IGuwW83TdwW3fQIGMdLEd7bGgjqQpiKQRoQFTjO84sDz IvXxFU63Ykf9ntT2Q3aFEwRDQLYrGyr4DC8hkawahEmTnG97Vigo5R+jKwmsMEO4WMOZ bcAw== X-Gm-Message-State: AOUpUlG/xSW/j87uQZnf37RJQDYmYJ1F0P0QrlDaEk4zvs2S5zPf5KBa RMVtPMbneChh2UjV7HLyCNZfzQ== X-Google-Smtp-Source: AAOMgpcYPBAq42FGXMjARkAnVsjQheocI6SzAzVHu5FtTDk1u7hlJ0LhsQQKjjY50lBpCfXYt/uOlw== X-Received: by 2002:adf:b456:: with SMTP id v22-v6mr4287654wrd.187.1531142410735; Mon, 09 Jul 2018 06:20:10 -0700 (PDT) Received: from localhost.localdomain ([95.146.151.144]) by smtp.gmail.com with ESMTPSA id l10-v6sm21585637wrv.23.2018.07.09.06.20.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Jul 2018 06:20:10 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: igt-dev@lists.freedesktop.org Date: Mon, 9 Jul 2018 14:19:54 +0100 Message-Id: <20180709132004.14468-2-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180709132004.14468-1-tvrtko.ursulin@linux.intel.com> References: <20180709132004.14468-1-tvrtko.ursulin@linux.intel.com> Subject: [Intel-gfx] [PATCH i-g-t 01/11] 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 Reviewed-by: 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'};