From patchwork Thu Jul 12 10:59:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10521453 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 302996032C for ; Thu, 12 Jul 2018 11:00:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1AA632925C for ; Thu, 12 Jul 2018 11:00:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0EBD629271; Thu, 12 Jul 2018 11:00:10 +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 B62422925C for ; Thu, 12 Jul 2018 11:00:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AE9F46EF64; Thu, 12 Jul 2018 11:00:08 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by gabe.freedesktop.org (Postfix) with ESMTPS id B3D346EF44 for ; Thu, 12 Jul 2018 11:00:06 +0000 (UTC) Received: by mail-wr1-x444.google.com with SMTP id c13-v6so21205538wrt.1 for ; Thu, 12 Jul 2018 04:00:06 -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=2Mbecofz24YnbqA63zagLH3azXjrGiv5EgRltaSEDh4=; b=nJcVPIGMoEm0cE9zKtW4lO/bQPxUlE7CZqpEF2laYcNSo3Ca/P3A5PJtyi9s+iiZOa EqUEdIaVjXTqQrV9w2FPjQEb4riWkZh82ZQehtiZBaXEo2Gwrlx7A1jPBt2JBZoYCMhu ikYSxMBFH4d2ddL9Axa4rJzGKb/3gtXcvmhJJ4RAs7NcSRouS/9ET8+K5gz0uO7uekJT WmuqXSnffEc4j3N4xIr0WMKDUTPPt7z+Sbb/3YJ3JYpIIHI7J0hye8T+thcnN1gvNAnT CWvxHnP0SWbdPJCWQS+a4wxbbT/RAhvgnlysMcOoxtAJCXbeY77HQ2sFA6vvcZQVClGj 5ttw== X-Gm-Message-State: AOUpUlFSm0I4IOPYt5qtya97dXKP60HylPoXjukd95vRbLDMFnEbF+FJ w5cjAFWgMj6OSB4gw0G3q8eiCw== X-Google-Smtp-Source: AAOMgpe4ADvOBdWUuj9B36r2qck8VEsaNd0zz2xcyvCAFPaWqZ2/aZus/9JmNvbPKYiFHvT/U+tn5A== X-Received: by 2002:adf:f210:: with SMTP id p16-v6mr1422952wro.184.1531393205454; Thu, 12 Jul 2018 04:00:05 -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.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Jul 2018 04:00:04 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: igt-dev@lists.freedesktop.org Date: Thu, 12 Jul 2018 11:59:51 +0100 Message-Id: <20180712105958.12953-3-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 2/9] trace.pl: Scale timeline for better precision 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 vis library has a limited precision compared to our trace data which prevents zooming into the timeline and seeing the fine detail. Scale the HTML view by a thousand to work around it. v2: Rebase for time axis changes. Signed-off-by: Tvrtko Ursulin Suggested-by: John Harrison Cc: John Harrison Reviewed-by: John Harrison # v1 Reviewed-by: John Harrison --- scripts/trace.pl | 46 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/scripts/trace.pl b/scripts/trace.pl index 89491125490d..726c90d44547 100755 --- a/scripts/trace.pl +++ b/scripts/trace.pl @@ -40,6 +40,7 @@ my $trace = 0; my $avg_delay_stats = 0; my $gpu_timeline = 0; my $colour_contexts = 0; +my $no_timeline_scaling = 0; my @args; @@ -281,6 +282,18 @@ sub arg_colour_contexts return @_; } +sub arg_no_timeline_scaling +{ + return unless scalar(@_); + + if ($_[0] eq '--no-timeline-scaling') { + shift @_; + $no_timeline_scaling = 1; + } + + return @_; +} + @args = @ARGV; while (@args) { my $left = scalar(@args); @@ -296,6 +309,7 @@ while (@args) { @args = arg_ignore_ring(@args); @args = arg_skip_box(@args); @args = arg_colour_contexts(@args); + @args = arg_no_timeline_scaling(@args); last if $left == scalar(@args); } @@ -334,6 +348,8 @@ sub ts my ($us) = @_; my ($y, $mo, $d, $h, $m, $s); + $us *= 1000 unless $no_timeline_scaling; + $s = int($us / 1000000); $us = $us % 1000000; @@ -1001,11 +1017,28 @@ print < 1) { + if (scale == 'second') + scale = 'millisecond'; + else if (scale == 'minute') + scale = 'second'; + } + if (scale == 'millisecond') return "+" + ms.toFixed(3) + "ms"; else if (scale == 'second')