diff mbox series

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

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

Commit Message

Tvrtko Ursulin Oct. 18, 2018, 3:28 p.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 | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
diff mbox series

Patch

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);