From patchwork Mon Jul 16 08:49:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10526249 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 C54956020A for ; Mon, 16 Jul 2018 08:49:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ABE3F287CC for ; Mon, 16 Jul 2018 08:49:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9FCB3287E5; Mon, 16 Jul 2018 08:49:57 +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 A069F287CC for ; Mon, 16 Jul 2018 08:49:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C67646E0C5; Mon, 16 Jul 2018 08:49:55 +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 068636E0C5 for ; Mon, 16 Jul 2018 08:49:54 +0000 (UTC) Received: by mail-wm0-x233.google.com with SMTP id 69-v6so14882670wmf.3 for ; Mon, 16 Jul 2018 01:49:54 -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=mQOxsQwBfXNjvV5vheSfIB5NNxVbao3gJtJU3eVKGpE=; b=t8uSKuOZmNSnhHZ7W7QpkzWgDPlBTtjlXJJctvTJGoRQgDKY91DKO76ehrebJyQgNG flBXF95VMcALbOuyo64UusZBcnFOLJxzmkGkYb9BGPxMbTxe//aj+rZl6P7izMlk5A6r IwlLpSYkiwg+84/1xZVhex0SnDbkigLT1gaR1tYbxi1uNyOQ5gr3N8c84ZXrJh0K6LGr huUd5X4N6uQgeDAP4EfLjUmS9x2M6dn5QnsWBvYqZwjy3w5LO9sL5AQiWGD7UlVNG7np E0A/8YAz9afMWVGxDko4StWJWRmuSzoPYNeKoS94EEXGLjAKZeocQufBxayzGlVwvkB/ xYow== X-Gm-Message-State: AOUpUlFcU3pVIQdSrteH55XhiMki1viM4Q2mF6DOv9Y7QVAERZFNAAAp Mz687vV7oqPHwK5gQhler9xJaA== X-Google-Smtp-Source: AAOMgpegoYkSt2W74N7Z4i3+ly8LsmWTbo30nweDfT+aCDPMjN2AOzNdpciBvSfv3B7MARCwxojBVw== X-Received: by 2002:a1c:e043:: with SMTP id x64-v6mr9467998wmg.58.1531730993646; Mon, 16 Jul 2018 01:49:53 -0700 (PDT) Received: from localhost.localdomain ([95.146.151.144]) by smtp.gmail.com with ESMTPSA id q1-v6sm17894150wrw.42.2018.07.16.01.49.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Jul 2018 01:49:53 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: igt-dev@lists.freedesktop.org Date: Mon, 16 Jul 2018 09:49:47 +0100 Message-Id: <20180716084947.7585-1-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: Subject: [Intel-gfx] [PATCH i-g-t v4 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) v4: * Unbreak legend display with small context counts. (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 | 82 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 56 insertions(+), 26 deletions(-) diff --git a/scripts/trace.pl b/scripts/trace.pl index bad5414e11d6..43b5fadc3a21 100755 --- a/scripts/trace.pl +++ b/scripts/trace.pl @@ -738,9 +738,48 @@ 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; + } + } else { + @disp_ctxts = @ctxts; + } + + $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 +793,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 +812,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 +1001,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, ' .