From patchwork Fri Jul 13 09:56:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10522967 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 6624960245 for ; Fri, 13 Jul 2018 09:56:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B3FC20223 for ; Fri, 13 Jul 2018 09:56:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3D19F29791; Fri, 13 Jul 2018 09:56:47 +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 C4A5C2978D for ; Fri, 13 Jul 2018 09:56:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4D8DE6F1DE; Fri, 13 Jul 2018 09:56:46 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) by gabe.freedesktop.org (Postfix) with ESMTPS id 410516F1DE for ; Fri, 13 Jul 2018 09:56:45 +0000 (UTC) Received: by mail-wm0-x233.google.com with SMTP id i139-v6so8210069wmf.4 for ; Fri, 13 Jul 2018 02:56:45 -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=wXgDLro8z76O9qFTXOGVsEtPN4lbOW//GQDhCy1MXeI=; b=YPYYww/aImm5VLOXa4J/H1IYx4D8qGHutRH+rBrWz6jRJvmV/JoI5N0JLOdC1kplUx mELYb/iW03o9yme7nO+u/1JMoJ3A5tduhqLZzaGUR+GYevPA8FUR0wwRH0bdlnLy5Sd9 jQ3DfwZBlAUKtb+FExXRNPaQ73GUanbYXgeRPXJVbhOD9rqtcfnbcAAB1c7T3XMrKYc5 Ofn1SEBxwo6bRFWZSFOqqmfNAi/cX8m/sALQAeezYbU2hG/yF73I36llp/pqh3z5dItg /+Lc10FQY+k9gsrBP3GL+UuFd4y4V4LSDzTS6JD05FaXgcLuggCIrw/tLStPvz3C9kbz /DfA== X-Gm-Message-State: AOUpUlGuKa997Kv46F00R8cS1yB/yVA5D95+f5gwHazxcJzAj1FzFNh1 IUN8IE9xMNs9WuNNz4TE4vmQsQ== X-Google-Smtp-Source: AAOMgpesWlaAfBMDy3bCAjp1uSeY0hU8k1pC5e047BCXBwVgNVoZ7EwLCdpgfg/kIKOmK4uR8TXQrg== X-Received: by 2002:a1c:f46:: with SMTP id 67-v6mr3258744wmp.122.1531475803866; Fri, 13 Jul 2018 02:56:43 -0700 (PDT) Received: from localhost.localdomain ([95.146.151.144]) by smtp.gmail.com with ESMTPSA id f17-v6sm21581225wrs.46.2018.07.13.02.56.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Jul 2018 02:56:43 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: igt-dev@lists.freedesktop.org Date: Fri, 13 Jul 2018 10:56:38 +0100 Message-Id: <20180713095638.21254-1-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <22253257-4205-c82d-97b2-b64dac1c1730@Intel.com> References: <22253257-4205-c82d-97b2-b64dac1c1730@Intel.com> Subject: [Intel-gfx] [PATCH i-g-t v3 5/9] trace.pl: Improved key/colours 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: John Harrison Improve the timeline legend to show actual context colours. v2: (Tvrtko Ursulin) * Commit msg. * Tweak layout for more compactness and more readability. v3: * Limit number of shown contexts in the legend. (John Harrison) Signed-off-by: John Harrison Signed-off-by: Tvrtko Ursulin Cc: John Harrison Cc: Tvrtko Ursulin Reviewed-by: John Harrison Reviewed-by: John Harrison --- scripts/trace.pl | 80 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 54 insertions(+), 26 deletions(-) diff --git a/scripts/trace.pl b/scripts/trace.pl index bad5414e11d6..d86eab6b0a8b 100755 --- a/scripts/trace.pl +++ b/scripts/trace.pl @@ -738,9 +738,46 @@ say sprintf('GPU: %.2f%% idle, %.2f%% busy', $flat_busy{'gpu-idle'}, $flat_busy{'gpu-busy'}) unless $html; my $timeline_text = $colour_contexts ? - 'Per context coloured shading like:' : 'Box shading like:'; + 'per context coloured shading like' : 'box shading like'; my %ctx_colours; +my $ctx_table; + +sub generate_ctx_table +{ + my @states = ('queue', 'ready', 'execute', 'ctxsave', 'incomplete'); + my $max_show = 6; + my (@ctxts, @disp_ctxts); + my $step; + + if( $colour_contexts ) { + @ctxts = sort keys %ctxdb; + } else { + @ctxts = ($min_ctx); + } + + # Limit number of shown context examples + $step = int(scalar(@ctxts) / $max_show); + if ($step) { + foreach my $i (0..$#ctxts) { + push @disp_ctxts, $ctxts[$i] unless $i % $step; + last if scalar(@disp_ctxts) == $max_show; + } + } + + $ctx_table .= ''; + + foreach my $ctx (@disp_ctxts) { + $ctx_table .= "\n"; + $ctx_table .= " \n" if $colour_contexts; + foreach my $state (@states) { + $ctx_table .= " \n"; + } + $ctx_table .= "\n"; + } + + $ctx_table .= '
Context $ctx
" . uc($state) . "
'; +} sub generate_ctx_colours { @@ -754,12 +791,7 @@ sub generate_ctx_colours generate_ctx_colours() if $html and $colour_contexts; - -my $queued_style = box_style($min_ctx, 'queue'); -my $ready_style = box_style($min_ctx, 'ready'); -my $execute_style = box_style($min_ctx, 'execute'); -my $ctxsave_style = box_style($min_ctx, 'ctxsave'); -my $incomplete_style = box_style($min_ctx, 'incomplete'); +generate_ctx_table() if $html; print < @@ -778,35 +810,27 @@ print <

-Timeline request view: +Timeline request view is $timeline_text: - - - - - - - - - - -
$timeline_text
QUEUED
READY
EXECUTE
CTXSAVE
(INCOMPLETE)
-

-

- -QUEUED = requests executing on the GPU
+ +$ctx_table + + +QUEUE = requests executing on the GPU
READY = runnable requests waiting for a slot on GPU
EXECUTE = requests waiting on fences and dependencies before they are runnable
CTXSAVE = GPU saving the context image
-
-

+INCOMPLETE = request of unknown completion time

Boxes are in format 'ctx-id/seqno'.

Use Ctrl+scroll-action to zoom-in/out and scroll-action or dragging to move around the timeline.

+ + +

GPU idle: $flat_busy{'gpu-idle'}%
@@ -975,20 +999,24 @@ sub box_style { my ($ctx, $stage) = @_; my $deg; + my $text_col = 'white'; if ($stage eq 'queue') { $deg = 90; + $text_col = 'black' if $colour_contexts; } elsif ($stage eq 'ready') { $deg = 45; } elsif ($stage eq 'execute') { $deg = 0; + $text_col = 'black' if $colour_contexts; } elsif ($stage eq 'ctxsave') { $deg = 105; + $text_col = 'black' if $colour_contexts; } elsif ($stage eq 'incomplete') { $deg = 0; } - return 'color: black; background: repeating-linear-gradient(' . + return "color: $text_col; background: repeating-linear-gradient(" . $deg . 'deg, ' . ctx_colour($ctx, $stage, 1.0) . ', ' . ctx_colour($ctx, $stage, 1.0) . ' 10px, ' .