From patchwork Fri Jul 13 10:02:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10522977 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 154E560245 for ; Fri, 13 Jul 2018 10:02:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 055FD286B2 for ; Fri, 13 Jul 2018 10:02:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EDE49286C1; Fri, 13 Jul 2018 10:02:14 +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 8D5F9286B2 for ; Fri, 13 Jul 2018 10:02:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 08EF06F1E6; Fri, 13 Jul 2018 10:02:14 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8A2E86F1E6 for ; Fri, 13 Jul 2018 10:02:12 +0000 (UTC) Received: by mail-wr1-x42a.google.com with SMTP id t6-v6so24518508wrn.7 for ; Fri, 13 Jul 2018 03:02:12 -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=NMyjigOGBmGjwcatuxcnidWx8UDkkjgpZqkVPVXN9XS7iltnpfixIwinPSWurZitqV 0d1racmuDkwePfcqGaowN7PueQDgNg3bk2IVQfwxaM4RjxGihpPXmgh2ynHOFyMvzpAN tnSbYYB/o4oPJCtkv8pSIp1nn0f0D3/gEhB3exUooyV6KN/dlzXap97wU4YFpI9Fc3lN 9FxdRoVp3YBUQUcl7RUCDP5E1spvDP8EmI7xzuJ+XTLL0QRMH03nIcffguhyvEdA9mNs yJrhGnOU+Uocc6s+X2IsfYNqTQaWg7q4DayhFhI13uguJGc+VLW6bcA8AyrLrGcFhpyQ YDaw== X-Gm-Message-State: AOUpUlGOsM3O3q9bzOmz7YWHED+RI+HU8Q1qw+G6KT+VdZM2m1Cj56CM OY6BYeTdgpgbP2MTMnwniwbq9Q== X-Google-Smtp-Source: AAOMgpeuDAff6QWExhBp12pWIGAoOuOUXeOzDTBHFG+DTjVThLn/2u034AOJPHzVvTwCQsJGrKMwWA== X-Received: by 2002:adf:ecc6:: with SMTP id s6-v6mr4605987wro.160.1531476131192; Fri, 13 Jul 2018 03:02:11 -0700 (PDT) Received: from localhost.localdomain ([95.146.151.144]) by smtp.gmail.com with ESMTPSA id r68-v6sm867717wmr.2.2018.07.13.03.02.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Jul 2018 03:02:10 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: igt-dev@lists.freedesktop.org Date: Fri, 13 Jul 2018 11:02:05 +0100 Message-Id: <20180713100205.21370-1-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180712105958.12953-3-tvrtko.ursulin@linux.intel.com> References: <20180712105958.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 Reviewed-by: John Harrison --- 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 <