From patchwork Tue Mar 6 12:43: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: 10261593 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 AC5A86037E for ; Tue, 6 Mar 2018 12:43:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D1CB28A57 for ; Tue, 6 Mar 2018 12:43:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 91F0728E43; Tue, 6 Mar 2018 12:43:47 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 5114528A57 for ; Tue, 6 Mar 2018 12:43:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C8D4C6E6D5; Tue, 6 Mar 2018 12:43:46 +0000 (UTC) X-Original-To: Intel-gfx@lists.freedesktop.org Delivered-To: Intel-gfx@lists.freedesktop.org Received: from mail-wr0-x243.google.com (mail-wr0-x243.google.com [IPv6:2a00:1450:400c:c0c::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id D1ACE6E6A4 for ; Tue, 6 Mar 2018 12:43:31 +0000 (UTC) Received: by mail-wr0-x243.google.com with SMTP id o76so20787658wrb.7 for ; Tue, 06 Mar 2018 04:43:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ursulin-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dJqPfVBR9oiJYDQGvKXuGwjHdbiTg8TQyB9SU8wkHtQ=; b=s4yhpVMTE5aDrMAimdqqdnvotrjSUcxTSW9zSpNzpgd9kGxTz1ogryG20Vlr6C8VPk fLC4fQvC2mlEfkG/mJG90xVMn9aaxiom0Iow6pDlZvINtYk+M5OC5SZA8QZiirg8v0Bk nKKjL9YK8RMQCNPGfnljGlRlQ+5s/6z3koV02T7z9nYih72hG98ok3E6b+ChroAFQ1+9 Fn5wVyUGRjFc35MeIASOiMN+5v+rK24vKtkbvAFU6mJ2TG12hf8XCxZmm5FMY4nLYbt/ AvVAewnkUSmrhfBt85rVTjXMF9nnsNS9/wpxjZE+CLIOyUIY1fZpeLHTGZGbxb6u30Ff kQsA== 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=dJqPfVBR9oiJYDQGvKXuGwjHdbiTg8TQyB9SU8wkHtQ=; b=bArIAUKzzsh7jtAKJUWGowb7pxEwmky1SgIUXrnniP3DmPohgna8mY/jq3Px3ZefIl f01CUyGUkxqTFArw+o4ZO/5QIRUD8LinX3GAZftmi5my+yI1alBeMYCQy9TmCDyD/10e 789APK6QeWNTTfrK1pKcePQSmkKHLIIcDskSogDWw6mUw2MWv+Hf5m7tvwszxTw0O6rP FRP7sOUUnHoeBE5U+j3GTDWk7k45+bgJ7m7q3E+gEhGBGTa2oCf0QnXCBr4+bRUBltsb /VW8KK+yzRrMw2nFy9heSCPro7Jg8fpM6JgCH7HzFOrjk7FtN07Ezg6iqj+zgTfLXJv7 PH/g== X-Gm-Message-State: APf1xPCMZ56VXDJxyHRDcxcHL4P/gHY5IyRDZD++QWbifoCkxUn3zgtI cOapssRQ+TX93MApFHabklwOsw== X-Google-Smtp-Source: AG47ELtEZBWhR583W9Fnqes0VjGzr0BXvu2zJoUIvjhQaMALPFaQO/wVIC2maVZrb2oZdTjnOC6Xfw== X-Received: by 10.223.157.131 with SMTP id p3mr15524615wre.278.1520340210449; Tue, 06 Mar 2018 04:43:30 -0800 (PST) Received: from localhost.localdomain ([95.146.144.186]) by smtp.gmail.com with ESMTPSA id v8sm3646560wmh.25.2018.03.06.04.43.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 04:43:29 -0800 (PST) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: igt-dev@lists.freedesktop.org Date: Tue, 6 Mar 2018 12:43:10 +0000 Message-Id: <20180306124315.30208-7-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180306124315.30208-1-tvrtko.ursulin@linux.intel.com> References: <20180306124315.30208-1-tvrtko.ursulin@linux.intel.com> Subject: [Intel-gfx] [PATCH i-g-t 06/11] trace.pl: Move sortQueue near its user 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 Just to clear up some space for incoming code refactoring. Signed-off-by: Tvrtko Ursulin Cc: John Harrison Reviewed-by: Lionel Landwerlin --- scripts/trace.pl | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/trace.pl b/scripts/trace.pl index 509df6c0dd8b..d49d25d6c1ca 100755 --- a/scripts/trace.pl +++ b/scripts/trace.pl @@ -545,17 +545,6 @@ sub sortStart { return $val; } -sub sortQueue { - my $as = $db{$a}->{'queue'}; - my $bs = $db{$b}->{'queue'}; - my $val; - - $val = $as <=> $bs; - $val = $a cmp $b if $val == 0; - - return $val; -} - my @sorted_keys = sort sortStart keys %db; my $re_sort = 0; @@ -859,6 +848,17 @@ print <{'queue'}; + my $bs = $db{$b}->{'queue'}; + my $val; + + $val = $as <=> $bs; + $val = $a cmp $b if $val == 0; + + return $val; +} + my $i = 0; foreach my $key (sort sortQueue keys %db) { my ($name, $ctx, $seqno) = ($db{$key}->{'name'}, $db{$key}->{'ctx'}, $db{$key}->{'seqno'});