From patchwork Fri Jul 13 09:56:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10522965 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 B907D60245 for ; Fri, 13 Jul 2018 09:56:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A85262978D for ; Fri, 13 Jul 2018 09:56:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9B92C29791; Fri, 13 Jul 2018 09:56:19 +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 403452978D for ; Fri, 13 Jul 2018 09:56:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A181F6F1DC; Fri, 13 Jul 2018 09:56:18 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by gabe.freedesktop.org (Postfix) with ESMTPS id 573226F1DB for ; Fri, 13 Jul 2018 09:56:17 +0000 (UTC) Received: by mail-wr1-x431.google.com with SMTP id b15-v6so24541901wrv.10 for ; Fri, 13 Jul 2018 02:56:17 -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=e/2Yar7WwqU2Uk4Ko/MxDJa/h+P0H3nJEQ9/MI5PJBM=; b=YLc5sQHKQwhjMAlGsRzWPnB1GYXgC4/UMVY1nZl9d9naTbwZiF9QxgbYHRPjDmcHs+ 9PN6rBdaKEHaWnp2p4sJDRYVG17ABDd+yCv0jP5FLeNYxDBnSiofpeXs9FTUxcFYghQQ xahlvLVxZk7/pNtGH8SjKIH4Br3kyak8+y7oMbAl5MXz7DF8M1V/NqRKQYHXONlk2aec wXAjWbqwtb1whls0Gfb6n9U02x+2RuF2glYpBLrrZtowCSRtoltFRWmED5BhbocLI382 SDo74MjTUdAbFLinZUtIBo0rCLmW7Ug+XYVAmnAqZkE1RTeOlRtU5+/r8ZfkARJE238N kJDg== X-Gm-Message-State: AOUpUlFILu8+oIN9pbIhMfzEi1WJRsRzwH3gt5NQ4te3ZEfHxni6oOCz wHLBDWsrD1eMSOwYC2GK4Uk9YQ== X-Google-Smtp-Source: AAOMgpdggGhOEuti1HB4reKaKZv47D3W4rigAIDSJDdkEOX7BlXJbqdZL+2kofFUpQCNhvVo8bcJ5g== X-Received: by 2002:adf:94e2:: with SMTP id 89-v6mr3258398wrr.48.1531475776043; Fri, 13 Jul 2018 02:56:16 -0700 (PDT) Received: from localhost.localdomain ([95.146.151.144]) by smtp.gmail.com with ESMTPSA id d102-v6sm12385458wma.10.2018.07.13.02.56.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Jul 2018 02:56:15 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: igt-dev@lists.freedesktop.org Date: Fri, 13 Jul 2018 10:56:10 +0100 Message-Id: <20180713095610.21164-1-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <0180712105958.12953-3-tvrtko.ursulin@linux.intel.com> References: <0180712105958.12953-3-tvrtko.ursulin@linux.intel.com> Subject: [Intel-gfx] [PATCH i-g-t v3 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. v3: Another tweak for time axis changes. Signed-off-by: Tvrtko Ursulin Suggested-by: John Harrison Cc: John Harrison Reviewed-by: John Harrison # v2 --- scripts/trace.pl | 54 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 50 insertions(+), 4 deletions(-) diff --git a/scripts/trace.pl b/scripts/trace.pl index 41f10749a153..4b5f4ef77aef 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; @@ -999,11 +1015,28 @@ $first_ts = ts($first_ts); print <