From patchwork Thu Oct 18 15:28:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10647495 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 50F7615E2 for ; Thu, 18 Oct 2018 15:28:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4120528C20 for ; Thu, 18 Oct 2018 15:28:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 35A2028CCF; Thu, 18 Oct 2018 15:28:35 +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 2876728D0A for ; Thu, 18 Oct 2018 15:28:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D179489F03; Thu, 18 Oct 2018 15:28:29 +0000 (UTC) X-Original-To: Intel-gfx@lists.freedesktop.org Delivered-To: Intel-gfx@lists.freedesktop.org Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by gabe.freedesktop.org (Postfix) with ESMTPS id 484C389B46 for ; Thu, 18 Oct 2018 15:28:27 +0000 (UTC) Received: by mail-wr1-x442.google.com with SMTP id 61-v6so34169850wrb.6 for ; Thu, 18 Oct 2018 08:28:27 -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=G/o09CJEDF2kXcq32WI57yTpVmpC6fRDYCe1a0UzdCY=; b=fyi7kcREhj3HFVNwA5oVzXOfsvfCpBGXm+WfHkBlqAZx01MkPS84ICGd1n10B7hnXT WMzHamGfR1OsWsSk7X2tOuQcJxtM4Gg5Di3yHITH5td+QDAuJPNX3Aa0zDGe0rOy9I+h 4RTmivehvkKjWWwsMXtrdG+lnvpRVjUBlu0ChoN/TzUUyFVMY+SYOZmEXxWeBMNgUMp6 AsyiDRGImhrEt63Arab1lUXFU9wawQY1Hv41xYsIWAkACAgz3awbX0oFpLEvimWGzjS0 Xa8kPHmL5CzjZ8qqW214EOItMSlS0RSfMlaHyMwmb83wE3Ei6TUade1QOcHJjwrc7xaG MlNg== X-Gm-Message-State: ABuFfoibgUeek7I6ydpBXcpC4AbVXrULcLg4UD14ud4twNW+FYP3hSSK dr2+lPtVpAnLyT75yx1FBYlwGg== X-Google-Smtp-Source: ACcGV60Lkkz4eZysy4QNXAjuEceLpTQCBPUq+1aHSkV3HpmYzMkTuJSK5cYfPLVr5RTSpDuTBN1/Nw== X-Received: by 2002:a5d:4292:: with SMTP id k18-v6mr28590265wrq.225.1539876505817; Thu, 18 Oct 2018 08:28:25 -0700 (PDT) Received: from localhost.localdomain ([91.110.193.16]) by smtp.gmail.com with ESMTPSA id i6-v6sm19530387wrq.4.2018.10.18.08.28.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Oct 2018 08:28:25 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: igt-dev@lists.freedesktop.org Date: Thu, 18 Oct 2018 16:28:01 +0100 Message-Id: <20181018152815.31816-4-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181018152815.31816-1-tvrtko.ursulin@linux.intel.com> References: <20181018152815.31816-1-tvrtko.ursulin@linux.intel.com> Subject: [Intel-gfx] [PATCH i-g-t 03/17] trace.pl: Virtual engine preemption support 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 Use the 'completed?' tracepoint field to detect more robustly when a request has been preempted and remove it from the engine database if so. Otherwise the script can hit a scenario where the same global seqno will be mentioned multiple times (on an engine seqno) which aborts processing. Signed-off-by: Tvrtko Ursulin --- scripts/trace.pl | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/scripts/trace.pl b/scripts/trace.pl index 72747b046202..a55e4f39539a 100755 --- a/scripts/trace.pl +++ b/scripts/trace.pl @@ -481,12 +481,16 @@ while (<>) { } elsif ($tp_name eq 'i915:i915_request_out:') { my $gkey = global_key($ring, $tp{'global'}); - die unless exists $db{$key}; - die unless exists $db{$key}->{'start'}; - die if exists $db{$key}->{'end'}; + if ($tp{'completed?'}) { + die unless exists $db{$key}; + die unless exists $db{$key}->{'start'}; + die if exists $db{$key}->{'end'}; - $db{$key}->{'end'} = $time; - $db{$key}->{'notify'} = $notify{$gkey} if exists $notify{$gkey}; + $db{$key}->{'end'} = $time; + $db{$key}->{'notify'} = $notify{$gkey} if exists $notify{$gkey}; + } else { + delete $db{$key}; + } } elsif ($tp_name eq 'i915:intel_engine_notify:') { my $gkey = global_key($ring, $seqno);