From patchwork Thu Jul 12 10:59: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: 10521461 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 283AB6032C for ; Thu, 12 Jul 2018 11:00:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 125392925C for ; Thu, 12 Jul 2018 11:00:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 06E9A29271; Thu, 12 Jul 2018 11:00:16 +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 9D7002925C for ; Thu, 12 Jul 2018 11:00:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C82D86EF70; Thu, 12 Jul 2018 11:00:11 +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 6F77C6EF67 for ; Thu, 12 Jul 2018 11:00:09 +0000 (UTC) Received: by mail-wr1-x436.google.com with SMTP id q10-v6so21246897wrd.4 for ; Thu, 12 Jul 2018 04:00:09 -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=GzT6k5/3Asx8cdKqLFqg+1enGeIyWvrNxMMG43j7CEs=; b=T1oilTdq9yEUbCydn4JmmqPn8RAHQj+Rs5OSFiYHVShT5BKD+P2fAbvkPPwOglHQhj QfjNdu8afz7uz/UmbLqFL8FAg4rRYhez785lvDMkxlnzQX0tVfCu0u8sJ/O5uELoBUhM shlFKHtqzjDiKGPWW8XCsn/Gk62HcqfSXTUMr+nbuFlenm1Thfs/VEQjVVDIOzI+H6j3 qGDGRhZQkXW6ck7PQEMmkGcf0AgREpELnRM2F4ajd6AOIRcd4GSX2Jgkvdjemu+rggjt 3SI0+fzFCuuk/0p01q90pjPta3f+O+ND3Q4uhr2Y/Y0ybI3enMRv3s+MQmSyaDxS3L+u 38FA== X-Gm-Message-State: AOUpUlGztw0nod0wE250G4A0K4Iy5VDAicsyPxzJND2x5umDnF/LZMfq kRnLt8pvlve71Mngbyx34cDOrQ== X-Google-Smtp-Source: AAOMgpc1bJjyVG8v0yGpbE6EA/CIlDYTbjR8m0GUFZrfKUDEwhI6kbKwu0KhJLGeFE8EQRINfHyU5A== X-Received: by 2002:adf:e50f:: with SMTP id j15-v6mr1415176wrm.111.1531393207995; Thu, 12 Jul 2018 04:00:07 -0700 (PDT) Received: from localhost.localdomain ([95.146.151.144]) by smtp.gmail.com with ESMTPSA id z5-v6sm23494585wrv.2.2018.07.12.04.00.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Jul 2018 04:00:07 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: igt-dev@lists.freedesktop.org Date: Thu, 12 Jul 2018 11:59:54 +0100 Message-Id: <20180712105958.12953-6-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180712105958.12953-1-tvrtko.ursulin@linux.intel.com> References: <20180712105958.12953-1-tvrtko.ursulin@linux.intel.com> Subject: [Intel-gfx] [PATCH i-g-t 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. Signed-off-by: Tvrtko Ursulin Cc: John Harrison Cc: Tvrtko Ursulin Signed-off-by: John Harrison Reviewed-by: John Harrison --- scripts/trace.pl | 69 ++++++++++++++++++++++++++++++------------------ 1 file changed, 43 insertions(+), 26 deletions(-) diff --git a/scripts/trace.pl b/scripts/trace.pl index 7cafb3f52ba4..bd3039511f5d 100755 --- a/scripts/trace.pl +++ b/scripts/trace.pl @@ -738,9 +738,35 @@ 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 @ctxts; + + if( $colour_contexts ) { + @ctxts = sort keys %ctxdb; + } else { + @ctxts = ($min_ctx); + } + + $ctx_table .= ''; + + foreach my $ctx (@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 +780,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 +799,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 +988,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, ' .