diff mbox series

[i-g-t,05/25] trace.pl: Virtual engine preemption support

Message ID 20190517112526.6738-6-tvrtko.ursulin@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series Media scalability tooling | expand

Commit Message

Tvrtko Ursulin May 17, 2019, 11:25 a.m. UTC
From: Tvrtko Ursulin <tvrtko.ursulin@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@intel.com>
---
 scripts/trace.pl | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

Comments

Chris Wilson May 17, 2019, 7:24 p.m. UTC | #1
Quoting Tvrtko Ursulin (2019-05-17 12:25:06)
> From: Tvrtko Ursulin <tvrtko.ursulin@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@intel.com>

Ok. In the future, we will end up with requests still in the db, but
this does what you say on the tin.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
diff mbox series

Patch

diff --git a/scripts/trace.pl b/scripts/trace.pl
index 873376d0e063..c4ce7176b3e3 100755
--- a/scripts/trace.pl
+++ b/scripts/trace.pl
@@ -483,17 +483,23 @@  while (<>) {
 		$ringmap{$rings{$ring}} = $ring;
 		$db{$key} = \%req;
 	} elsif ($tp_name eq 'i915:i915_request_out:') {
-		my $gkey;
-
 		die unless exists $ctxengines{$ctx};
-		die unless exists $db{$key};
-		die unless exists $db{$key}->{'start'};
-		die if exists $db{$key}->{'end'};
 
-		$gkey = db_key($ctxengines{$ctx}, $ctx, $seqno);
+		if ($tp{'completed?'}) {
+			my $gkey;
+
+			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};
+			$gkey = db_key($ctxengines{$ctx}, $ctx, $seqno);
+
+			$db{$key}->{'end'} = $time;
+			$db{$key}->{'notify'} = $notify{$gkey}
+						if exists $notify{$gkey};
+		} else {
+			delete $db{$key};
+		}
 	} elsif ($tp_name eq 'dma_fence:dma_fence_signaled:') {
 		my $gkey;