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

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Mon May 20 14:47:17 UTC 2019


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>
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 scripts/trace.pl | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/scripts/trace.pl b/scripts/trace.pl
index 1f4953b02ef6..77587f24197a 100755
--- a/scripts/trace.pl
+++ b/scripts/trace.pl
@@ -488,16 +488,21 @@ while (<>) {
 		$ringmap{$rings{$ring}} = $ring;
 		$db{$key} = \%req;
 	} elsif ($tp_name eq 'i915:i915_request_out:') {
-		my $nkey;
+		if ($tp{'completed?'}) {
+			my $nkey;
 
-		die unless exists $db{$key};
-		die unless exists $db{$key}->{'start'};
-		die if exists $db{$key}->{'end'};
+			die unless exists $db{$key};
+			die unless exists $db{$key}->{'start'};
+			die if exists $db{$key}->{'end'};
 
-		$nkey = notify_key($ctx, $seqno);
+			$nkey = notify_key($ctx, $seqno);
 
-		$db{$key}->{'end'} = $time;
-		$db{$key}->{'notify'} = $notify{$nkey} if exists $notify{$nkey};
+			$db{$key}->{'end'} = $time;
+			$db{$key}->{'notify'} = $notify{$nkey}
+						if exists $notify{$nkey};
+		} else {
+			delete $db{$key};
+		}
 	} elsif ($tp_name eq 'dma_fence:dma_fence_signaled:') {
 		my $nkey;
 
-- 
2.20.1



More information about the Intel-gfx mailing list