[Intel-gfx] [PATCH i-g-t 03/17] trace.pl: Virtual engine preemption support

Tvrtko Ursulin tursulin at ursulin.net
Thu Oct 18 15:28:01 UTC 2018


From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

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 <tvrtko.ursulin at intel.com>
---
 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);
 
-- 
2.17.1



More information about the Intel-gfx mailing list